Skip to content
This repository has been archived by the owner on Jan 4, 2023. It is now read-only.

fix!: enabled SSR by default and opt-out experimental state #200

Merged
merged 1 commit into from
Sep 30, 2021

Conversation

antfu
Copy link
Member

@antfu antfu commented Sep 8, 2021

Resolved #185, Close #189

The problem of #185 is caused by the check ignores the check for ssr: false and will also disable the server for client build.

So I guess maybe we could take the chance to respect the ssr: false option in the top-level nuxt config. Giving the SSR has been improved quite a lot since the previous releases, plus this package itself is marked experimental anyway. I'd feel the SSR support is kinda good enough to not be the "experimental-in-experimental" thing. Which this change, this PR makes the behavior less confusing and a bit more robust.

@codecov-commenter
Copy link

Codecov Report

Merging #200 (0ffb71a) into main (63586ee) will increase coverage by 1.96%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #200      +/-   ##
==========================================
+ Coverage   76.92%   78.88%   +1.96%     
==========================================
  Files          12       12              
  Lines         260      251       -9     
  Branches       57       52       -5     
==========================================
- Hits          200      198       -2     
+ Misses         60       53       -7     
Impacted Files Coverage Δ
src/index.ts 87.50% <ø> (+14.32%) ⬆️
test/fixture/nuxt.config.js 100.00% <ø> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 63586ee...0ffb71a. Read the comment docs.

@pi0 pi0 added the pending label Sep 8, 2021
@pi0
Copy link
Member

pi0 commented Sep 8, 2021

Hi @antfu.

Actually, the module itself (with client-build) is getting more stable to be used in all nuxt2 projects but SSR implementation is still unstable and hacky:

  • We are still using a workaround for vue2 plugin, which I guess also has no test suit covering SSR build
  • Depending on vite's rollup build and using two instances for server-side rendering in development, is probably not the best option. Ideally we should switch to vite builder (and vite plugins receive ssr flag). Doing this early introduces breaking changes when we actually swtich.

Also supporting SPA mode with disabled ssr (#185) should be anyway done as is a nuxt feature regardless of what default we use and #189 is probably not the best workaround :)

I hope this makes sense and we can merge this change when issues above are solved :)

@pi0 pi0 changed the base branch from main to feat/vite-ssr September 30, 2021 19:37
@pi0 pi0 removed the pending label Sep 30, 2021
@pi0 pi0 merged commit a8ee778 into feat/vite-ssr Sep 30, 2021
@pi0 pi0 deleted the fix/enable-ssr branch September 30, 2021 19:37
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

production build does not supports client only build
3 participants