Socket
Socket
Sign inDemoInstall

jsxte

Package Overview
Dependencies
0
Maintainers
1
Versions
34
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install
234Next

3.3.1

Diff

Changelog

Source

3.3.1 (March 16, 2024)

Features

  • feat: added an option to extend the allowed attribute type on all tags all at once (#330)

    Added a new functionality that allows users to define a type that all attributes on all tags will accept.

    class Box<T> {
      constructor(public v: T) {}
    
      toString() {
        return String(this.v);
      }
    }
    
    declare global {
      namespace JSXTE {
        interface AttributeAcceptedTypes {
          ALL: Box<any>;
        }
      }
    }
    
    // thanks to the interface declared above, the following will not raise errors:
    const div = <div class={new Box(123)}></div>; // ok
    
ncpa0cpl
published 3.3.0 •

Changelog

Source

3.3.0 (February 1, 2024)

Features

  • feat: improved the typing for the Dom renderer to better acommodate jsdom, happydom or similar libs (#312)

    Improved the typing for the DomRenderer to better accommodate for fake Dom libraries like jsdom, happy-dom, etc.

  • feat: add dom render methods to component api and allow for option overrides (#311)

    Added a renderToDom and renderToDomAsync options to the Component API.

    Added the option to override the renderer options when calling any render method via the Component API.

Bug Fixes

  • fix: prevent adding unintended whitespaces to the generated html (#310)

    Fixed an issue where the generated html with compact option set as false (which is the default) would add unintended whitespaces between text elements separated by open or closing tags.

    Also replaced the compact option with pretty, as from now on the default is to produce non formatted html.

ncpa0cpl
published 3.2.0 •

Changelog

Source

3.2.0 (January 28, 2024)

Features

  • feat: rewritten the renderer (#280)

    Rewritten the renderer into a more generic solution, previous version had 4 different copies of render functions (html sync /async renderers and json sync/async renderers) and a lot of duplicated code. This new version introduces a generic JsxteRenderer class which performs most of the work while unaware of the final output format, and is capable of both synchornous and asynchronous work. This separation allows for better code reuse and smaller library size, and makes it easier to introduce new changes in the future.

  • feat: removed the renderToStringTemplateTag render function (#279)

    Removed the string template renderer.

ncpa0cpl
published 3.1.10-canary-8b30b441724204f88dd56707d088ba9b7c12823e.0 •

ncpa0cpl
published 3.1.10-canary-99ea1f5a68f7eb363806037de4af6c5d92ba600b.0 •

ncpa0cpl
published 3.1.10-canary-4a7246aa5726670c37ceab2a7b18e660f05db470.0 •

ncpa0cpl
published 3.1.10-canary-5d95b153702c285c28febd4f5a03090a21cd6ef5.0 •

ncpa0cpl
published 3.1.9 •

Changelog

Source

3.1.9 (December 29, 2023)

Bug Fixes

  • fix: missing meta properties and button disabled prop type (#272)

    Added the missing <meta> tag properties to the prop type definitions (property and media).

    Fixed the typing on the <button> disabled property.

ncpa0cpl
published 3.1.8 •

Changelog

Source

3.1.8 (December 5, 2023)

Features

  • feat: removed fragments from the render error's component traces (#258)

    In the previous version a new feature was added that added component traces to the rendering errors. As a result you would see error messages that looked like this:

    JsxteRendererError: The below error has occurred in:
      <html>
      <body>
      <div>
      <>
      <span>
    
      Rendering has failed due to an error...
    

    These messages have been updated to omit fragments from these traces, i.e. <> tags will no longer appear in the error message traces.

  • feat: added types for the search tag (#256)

    Added a type definition for the newly standardized <search> tag.

Bug Fixes

  • fix: incorrect function name exported from jsx-dev-runtime (#257)

    The jsx-dev-runtime export is supposed to provide a named exported function under the name jsxDEV, that however was not the case, as it was only exporting functions that were named identically to those from jsx-runtime.

  • fix: meta's name and link's rel attribute types prevented valid values (#255)

    Type for the <meta>'s name attribute was preventing valid values from being used, same for the <link>'s rel attribute. These attributes will now allow any string to be used.

ncpa0cpl
published 3.1.7 •

Changelog

Source

3.1.7 (November 5, 2023)

Features

  • feat: added component traces to errors (#236)

    Added traces to errors thrown by the renderer to allow easier debugging. This is achieved by catching any errors during rendering and when that happens, throwing custom errors instead. Original errors can still be accessed via the .cause property.

    Example

    If an error occurs in a component called MyComponent you might see an error like this:

    JsxteRendererError: The below error has occurred in:
    <App>
    <html>
    <body>
    <Layout>
    <div>
    <MyComponent>
    
    Rendering has failed due to an error: <Actual error message>
    
    Accessing the original error
    try {
      const html = renderToHtml(<App />);
    } catch (error) {
      error; // -> JsxteRendererError
      error.cause; // -> original error
    }
    
  • feat: added toHtmlTag symbol (#235)

    Added a special symbol that allows to determine how an object should be stringified when used as a child of a JSX element.

    Example

    class User {
      constructor(
        public id: string,
        public username: string,
        public email: string,
      ) {}
    
      [Symbol.toHtmlTag]() {
        return `User: ${this.username}`;
      }
    }
    
    const user = new User("001", "Johny", "johny0169@gmail.com");
    
    renderToHtml(<div>{user}</div>);
    

    The above will produce this result:

    <div>User: Johny</div>
    
  • feat: added jsx-dev-runtime to the exported paths (#234)

    Added a new export under jsxte/jsx-dev-runtime, atm it exports the exact same functions as the jsxte/jsx-runtime. This should prevent build errors when the "jsx" build option is set to jsx-reactdev. This change specifically targets Bun, which always assumes this settings unless NODE_ENV is set to production.

Bug Fixes

  • fix: add "canonical" as allowed attribute for link-rel (#231)
234Next
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc