graysonhicks / gatsby-plugin-loadable-components-ssr

Gatsby plugin for using @loadable/component with Gatsby's SSR
49 stars 26 forks source link

Support Gatsby 5 #70

Open leonburman opened 1 year ago

leonburman commented 1 year ago

I'm hoping to upgrade to Gatsby v5 soon but this plugin doesn't currently support it.

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: maclynn-gatsby@1.0.0
npm ERR! Found: gatsby@5.1.0
npm ERR! node_modules/gatsby
npm ERR!   gatsby@"^5.1.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer gatsby@"^2.12.1 || ^3.0.0 || ^4.0.0" from gatsby-plugin-loadable-components-ssr@4.3.2
npm ERR! node_modules/gatsby-plugin-loadable-components-ssr
npm ERR!   gatsby-plugin-loadable-components-ssr@"*" from the root project
kszot-ref commented 1 year ago

@leonburman Gatsby v5 is not specified as a peer dependency here, but if you force install it it seems to work fine (at least I didn't notice any issues in my project)

danielholmes commented 1 year ago

The README states they don't intend to support it:

Loadable https://github.com/gregberge/loadable-components/issues/718 and Gatsby v5 will require React 18. React 18 ships with React.lazy which performs the same code-splitting + SSR that we are accomplishing here. There are no plans to write compatibility for React 18 / Gatsby 5 with this plugin, so the migration path should be one to React.lazy. This should result in an overall simpler implementation, and should be considered a positive that this plugin will no longer be needed.