-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Description
Should this be an RFC?
- This is not a substantial change
Which package is this a feature request for?
SSR (@lit-labs/ssr)
Description
Part of #2391 and depends on #3588
With @lit-labs/ssr-react package being the core implementation of integrating Lit SSR with React Server DOM, it would be good to have an easy way to configure a Next.js project with a plugin.
We could have a package @lit-labs/nextjs which exports function withLitSsr which can be used to create/wrap the users's next.config.js. This could look like https://github.com/vercel/next.js/blob/canary/packages/next-mdx/index.js
The plugin would add to the webpack config of the Next.js project to add side-effect imports to bundle entrypoints to monkey patch React.createElement and also replace any runtime jsx transforms to use @lit-labs/ssr-react instead.
Alternatives considered:
- Users could manually configure
jsxImportSourceorjsxFactorydepending on the runtime mode of the project. The problem with this is that it will not work with components made using@lit-labs/react, or other precompiled React components housing Lit components.
Alternatives and Workarounds
N/A
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Status
✅ Done