Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Nuxt 2 support #15

Closed
wants to merge 25 commits into from
Closed

[WIP] Nuxt 2 support #15

wants to merge 25 commits into from

Conversation

steveworkman
Copy link
Collaborator

Fixes #9

So far this is a refactor of the render code to split it for nuxt 2 and nuxt 3

@steveworkman
Copy link
Collaborator Author

steveworkman commented Oct 25, 2022

ToDo:

  • Nuxt 2 tests don't run because the webpack configuration validation fails saying that /\.js$/i is not a regular expression 🤯
  • Wrap the Vite plugin in an unplugin to get it wrapping components in Webpack
  • Re-work the Vue2 server rendering wrapper - the one in here right now is not in use

@steveworkman
Copy link
Collaborator Author

However, with it in its current state, the nuxt 2 playground runs and builds in SSR mode without crashing and most of the components hydrate correctly. DSD is not added but that will be solved by the above changes

@steveworkman steveworkman mentioned this pull request Oct 26, 2022
@steveworkman
Copy link
Collaborator Author

Today I replaced the @open-wc/import-meta-loader with one that resolves local file paths rather than just webpack localhost ones. This is fine in dev, but it doesn't build, saying it can't find the module. If I get that to find the module, it complains that source.replace is not a function - seemingly some objects other than strings are being passed through it, and it falls over.

Beyond that, vue-server-renderer for nuxt 2 needs the fs module that it is trying to load client-side, and beyond that, the latest nuxt RC is causing the component that is loaded first to be added as another document fragment, instead of replacing the SSR one, I think due to nuxt/framework#7527 or nuxt/framework#7713.

I'm no longer sure that the current approach of wrapping components will work, and we should look at rendering hooks instead

@prashantpalikhe
Copy link
Owner

Closing this for now. We can revisit it later if we want to add the Nuxt2 support.

@516310460
Copy link

Help nuxt2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Nuxt2 support
3 participants