You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Supporting v14 seems a bit more complicated as they're now bundling react/jsx-dev-runtime and react/jsx-runtime rather than it being external for us to use the normal module replacement plugin. See vercel/next.js#46470 (comment) and vercel/next.js#55362
We may need to make users specify jsxImportSource instead and also forego with wrapping the webpack externals config. This means we no longer have the ability to touch any jsx-runtime imports within node_modules code, e.g. npm installed react components that use bare Lit components within them. This was considered a pretty niche use case to support but nonetheless disappointing to have to give up. Ergonomically it also defeats a large purpose for the plugin which is meant to be a one step config for enabling Lit SSR and also preserve the composability when already using an alternate runtime jsx.
Monkey-patching of React.createElement still seems to work. It used to be problematic in early v14 perhaps related to the esm loader approach they were doing for React to support using react canary with app router.
Activity
foadtkf commentedon Feb 16, 2024
what about the app router?

augustjk commentedon Feb 28, 2024
@foadtkf support for app router is tracked in a separate issue #3657
augustjk commentedon Feb 28, 2024
Supporting v14 seems a bit more complicated as they're now bundling
react/jsx-dev-runtimeandreact/jsx-runtimerather than it being external for us to use the normal module replacement plugin. See vercel/next.js#46470 (comment) and vercel/next.js#55362We may need to make users specify
jsxImportSourceinstead and also forego with wrapping the webpack externals config. This means we no longer have the ability to touch any jsx-runtime imports within node_modules code, e.g. npm installed react components that use bare Lit components within them. This was considered a pretty niche use case to support but nonetheless disappointing to have to give up. Ergonomically it also defeats a large purpose for the plugin which is meant to be a one step config for enabling Lit SSR and also preserve the composability when already using an alternate runtime jsx.Monkey-patching of
React.createElementstill seems to work. It used to be problematic in early v14 perhaps related to the esm loader approach they were doing for React to support using react canary with app router.augustjk commentedon Mar 9, 2024
Found a way to monkey-patch everything without resorting to module replacement in above linked PR.