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
Previous134Next

3.1.6

Diff

Changelog

Source

3.1.6 (October 23, 2023)

Features

  • feat: Add view-transition as allowed name for meta-tag. (#225)

    Updated types for the <meta> tag to allow for the view-transition as name attribute value.

  • feat: allow null, undefined, booleans, string and numbers as jsx elements (#221)

    It is now possible to return other things from function components than elements created via createElement or JSX syntax. Anything that is not an object, string or number will be treated as if <></> was returned, returned strings and numbers will be treated as <>{value}</>, objects are expected to be elements created via createElement or JSX syntax (no change here).

    This means that the following components are now possible:

    function MyComponent() {
      return !!condition && <div>...</div>;
    }
    
    function MyComponent() {
      return "Hello";
    }
    
    function MyComponent() {
      return 2023;
    }
    
    // ok
    renderToHtml(
      <div>
        <MyComponent />
      </div>,
    );
    
ncpa0cpl
published 3.1.5 •

Changelog

Source

3.1.5 (October 10, 2023)

Bug Fixes

  • fix: types for specific elements were missing (#218)

    Types for many elements were missing, this was because types for them were defined as a namespace interfaces in standalone files that were never imported and therefore TypeScript would never load them.

ncpa0cpl
published 3.1.4 •

Changelog

Source

3.1.4 (September 16, 2023)

Bug Fixes

  • fix: self closing tags (#203)

    Fixed the issue with the html renderer always producing a separate closing tag, even in cases where the tag could be self closing.

ncpa0cpl
published 3.1.3 •

Changelog

Source

3.1.3 (September 5, 2023)

BREAKING CHANGES

  • fix: removed prop types exports (#193)

    Exports of all tags prop types were removed, instead those are available via the JSXTE global namespace.

Bug Fixes

  • fix: as attribute typing for link tag (#193)

    Added missing property from the <link> tag's prop type, the as attribute.

ncpa0cpl
published 3.1.2 •

Changelog

Source

3.1.2 (August 27, 2023)

Bug Fixes

  • fix: export the InputType type (#189)
  • fix: Add "email" to InputTypes (#188)
ncpa0cpl
published 3.1.1 •

Changelog

Source

3.1.1 (August 24, 2023)

Bug Fixes

  • fix: added number as a possible type for input attributes step and value (#187)

    Added number as a possible type for input attributes step and value.

  • fix: added a few event handler property types that were missing (#186)

    Typing for the JSX html elements were missing some of the event handlers attributes (onpointer events, onfocusin etc.). This is fixed now.

ncpa0cpl
published 3.1.0 •

Changelog

Source

3.1.0 (August 22, 2023)

Features

  • feat: added a json renderer (#185)

    Added a new renderer that can generate a JSON structure instead of html. Api for it looks similar to renderToHtml with the only difference being it does not accept any indentation option.

  • feat: optimized the code (for..let loops over for..of, faster string join algo, etc.) (#184)

    Added code optimizations:

    1. Instead of for..of loops that rely on iterators used the good ol' for..let i = 0; loops which are much faster
    2. Replaced all usages of String.join() with a much faster custom implementation
    3. Reduced the amount of needless object instantiations, (there were some places where a new object or array was created for convenience reasons, but was not really necessary) - this should slightly reduce the required GC time for cases where a lot of JSX is being processed.
    4. JSX Elements props and children are made immutable up-front via Object.freeze
  • feat: improvements to the renderToStringTemplateTag (#183)

    Multiple improvements to the render function for string template tags:

    • New <Interpolate> and <InterpolateTag> components. Contents of those will be interpolated into the string template as is for Interpolate, and as a rendered tag for InterpolateTag (see JSDoc comments on those for more details.
    • Falsy values passed to the attributes will prevent those attributes from being added at all, while truthy values will cause those attributes to be added with their names as values.
    • Caching mechanism to allow for the same input to provide the exact same TemplateStringArray reference to the tag on every call.
ncpa0cpl
published 3.0.1 •

Changelog

Source

3.0.1 (August 19, 2023)

Features

  • chore: added a sideEffect property to package.json (#181)

    Added a sideEffect property to package.json to allow for tree-shaking.

ncpa0cpl
published 3.0.0 •

Changelog

Source

3.0.0 (July 9, 2023)

Features

  • feat: added helper methods to the context: Provider and Consumer (#161)

    Added two helper methods to the Context object. A Provider and a Consumer are JSXTE Components that provide similar functionality to the React's Context.

    Example

    const myCtx = defineContext<{ foo: string }>;
    
    const App = () => {
      return (
        <myCtx.Provider value={{ foo: "hello" }}>
          <myCtx.Consumer render={(cv) => <span>{cv.foo}</span>} />
        </myCtx.Provider>
      );
    };
    
  • feat: ContextMap replaced with ComponentApi (#160)

    Replaced the ContextMap argument that was available to to all components with a new ComponentApi. Contexts can still be accessed via the new API, via the ComponentApi.ctx property. Additionally the new api provides a render method, which can be used similarly to the renderToHtml, but the context's data will get forwarded to the rendered components.

ncpa0cpl
published 2.3.1 •

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