Skip to content

Latest commit

 

History

History
306 lines (172 loc) · 16 KB

CHANGELOG.md

File metadata and controls

306 lines (172 loc) · 16 KB

@astrojs/lit

4.3.0

Minor Changes

  • #11234 4385bf7 Thanks @ematipico! - Adds a new function called addServerRenderer to the Container API. Use this function to manually store renderers inside the instance of your container.

    This new function should be preferred when using the Container API in environments like on-demand pages:

    import type { APIRoute } from 'astro';
    import { experimental_AstroContainer } from 'astro/container';
    import reactRenderer from '@astrojs/react/server.js';
    import vueRenderer from '@astrojs/vue/server.js';
    import ReactComponent from '../components/button.jsx';
    import VueComponent from '../components/button.vue';
    
    // MDX runtime is contained inside the Astro core
    import mdxRenderer from 'astro/jsx/server.js';
    
    // In case you need to import a custom renderer
    import customRenderer from '../renderers/customRenderer.js';
    
    export const GET: APIRoute = async (ctx) => {
      const container = await experimental_AstroContainer.create();
      container.addServerRenderer({ renderer: reactRenderer });
      container.addServerRenderer({ renderer: vueRenderer });
      container.addServerRenderer({ renderer: customRenderer });
      // You can pass a custom name too
      container.addServerRenderer({
        name: 'customRenderer',
        renderer: customRenderer,
      });
      const vueComponent = await container.renderToString(VueComponent);
      return await container.renderToResponse(Component);
    };

4.2.0

Minor Changes

  • #11144 803dd80 Thanks @ematipico! - The integration now exposes a function called getContainerRenderer, that can be used inside the Container APIs to load the relative renderer.

    import { experimental_AstroContainer as AstroContainer } from 'astro/container';
    import ReactWrapper from '../src/components/ReactWrapper.astro';
    import { loadRenderers } from 'astro:container';
    import { getContainerRenderer } from '@astrojs/react';
    
    test('ReactWrapper with react renderer', async () => {
      const renderers = await loadRenderers([getContainerRenderer()]);
      const container = await AstroContainer.create({
        renderers,
      });
      const result = await container.renderToString(ReactWrapper);
    
      expect(result).toContain('Counter');
      expect(result).toContain('Count: <!-- -->5');
    });

4.1.0

Minor Changes

  • #11164 cf9b2ff Thanks @scottnath! - Removes deprecated template attribute and replaces deprecated domparser function

4.0.1

Patch Changes

4.0.0

Major Changes

3.0.3

Patch Changes

  • #9018 23c9a30ad Thanks @augustjk! - Fix hydration ordering of nested custom elements. Child components will now wait for their parents to hydrate before hydrating themselves.

3.0.2

Patch Changes

3.0.1

Patch Changes

3.0.0

Major Changes

  • #8188 d0679a666 Thanks @ematipico! - Remove support for Node 16. The lowest supported version by Astro and all integrations is now v18.14.1. As a reminder, Node 16 will be deprecated on the 11th September 2023.

  • #8179 6011d52d3 Thanks @matthewp! - Astro 3.0 Release Candidate

3.0.0-rc.1

Major Changes

3.0.0-beta.0

Major Changes

  • 1eae2e3f7 Thanks @Princesseuh! - Remove support for Node 16. The lowest supported version by Astro and all integrations is now v18.14.1. As a reminder, Node 16 will be deprecated on the 11th September 2023.

2.1.1

Patch Changes

2.1.0

Minor Changes

2.0.2

Patch Changes

2.0.1

Patch Changes

  • #6752 c7eb0d431 Thanks @augustjk! - Provide renderInfo when rendering Lit components. Fixes issue with rendering nested components.

2.0.0

Major Changes

  • #6681 4b077318f Thanks @e111077! - Update to use @lit-labs/ssr@^3 [BREAKING] DOM shim required for Lit SSR has been greatly reduced. window, document, and other objects are no longer available in global. Most SSR-ready component code should not be affected but, if so, they can be fixed with optional chaining or by using the isServer environment checker from the lit package. See [lit.dev docs on authoring components for SSR].(https://lit.dev/docs/ssr/authoring/#browser-only-code) [BREAKING] Adds compatibility with [email protected] hydration behavior. Do not update if you're using [email protected] or lower. Includes support for template[shadowrootmode] support.

1.3.0

Minor Changes

1.2.1

Patch Changes

1.2.0

Minor Changes

  • #6111 ec38a8921 Thanks @e111077! - Implement client:only functionality in Lit and add lit to the client:only warning

1.1.2

Patch Changes

  • #6080 0db220415 Thanks @e111077! - Fixes Lit hydration not having the same reactive values as server (losing state upon hydration)

  • #6055 2567aa48b Thanks @e111077! - Add forwards compatibility for streaming Declarative Shadow DOM

1.1.1

Patch Changes

1.1.0

Minor Changes

1.0.2

Patch Changes

1.0.2-beta.0

See changes in 1.0.2-beta.0

Patch Changes

1.0.1

Patch Changes

1.0.0

Major Changes

0.3.2

Patch Changes

0.3.1

Patch Changes

0.3.0

Minor Changes

  • #3652 7373d61c Thanks @natemoo-re! - Adds support for passing named slots from .astro => Lit components.

    All slots are treated as Light DOM content.

0.2.0

Minor Changes

  • #3625 f5afaf24 Thanks @matthewp! - Conform to Constructor based rendering

    This changes @astrojs/lit to conform to the way rendering happens in all other frameworks. Instead of using the tag name <my-element client:load> you use the imported constructor function, <MyElement client:load> like you would do with any other framework.

    Support for tag-name syntax had to be removed due to the fact that it was a runtime feature that was not statically analyzable. To improve build performance, we have removed all runtime based component discovery. Using the imported Constructor name allows Astro to discover what components need to be built and bundled for production without ever running your file.

0.1.5

Patch Changes

0.1.4

Patch Changes

0.1.3

Patch Changes

  • #3375 fe61e469 Thanks @jdvivar! - Added tests and fix a small edge case for when you call render with no props/attrs

0.1.2

Patch Changes

0.1.1

Patch Changes

0.1.0

Minor Changes

0.0.2

Patch Changes

  • #2847 3b621f7a Thanks @tony-sull! - Adds keywords to the official integrations to support discoverability on Astro's Integrations site

0.0.2-next.0

Patch Changes

  • #2847 3b621f7a Thanks @tony-sull! - Adds keywords to the official integrations to support discoverability on Astro's Integrations site