ElMassimo / iles

🏝 The joyful site generator
https://iles.pages.dev
MIT License
1.07k stars 31 forks source link

revert "fix: use createSSRApp to enable more efficient hydration" #159

Closed ElMassimo closed 2 years ago

ElMassimo commented 2 years ago

Description 📖

Reverts ElMassimo/iles#156

@maoberlehner The proposed PR suffers from the same problems I mentioned in https://github.com/ElMassimo/iles/issues/149#issuecomment-1180889417.

Happy to revisit this later on, but for now I haven't found a way for the final build not to have hydration mismatches in the docs site.

Removing the comments Vue injects fixes the hydration mismatches in development.

The following screenshots were taken by running a full build:all in https://github.com/ElMassimo/iles/commit/49d4d9a2a26dd7662f9ae552e5a8c809512e96d1, with the precaution of disabling the PWA and unregistering all service workers, to ensure I was testing the right thing.

Development

Screen Shot 2022-07-13 at 19 09 44

Production

Screen Shot 2022-07-13 at 19 10 16
nx-cloud[bot] commented 2 years ago

Nx Cloud Report

CI is running for commit 8f0bc649c671e9d0dd533d3183a71cb0a5f2af77.

📂 Click to track the progress, see the status, the terminal output, and the build insights.


Sent with 💌 from NxCloud.

maoberlehner commented 2 years ago

Removing the comments Vue injects fixes the hydration mismatches in development.

What about the following then?

-  // Remove comments from Vue renderer to allow plain text, RSS, or JSON output.
-  content = content.replace(commentsRegex, '')

  // Skip HTML shell to allow Vue to render plain text, RSS, or JSON output.
-  if (!route.outputFilename.endsWith('.html'))
+  if (!route.outputFilename.endsWith('.html')) {
+    // Remove comments from Vue renderer to allow plain text, RSS, or JSON outpu
t.
+    content = content.replace(commentsRegex, '')
    return content
+  }