Skip to content

Commit

Permalink
SSR & Rehydration (#26)
Browse files Browse the repository at this point in the history
* SSR & Rehydration

rechydration-experiments

improve rehydration

fix more rehydration cases

test for if rehydration

list rehydration

reactive lists rehydration

+

+

sample server

recover after failing rehydration

proper destroy for failing app

+

+

one more rehydration test

nested components ref

+

+

+

+

+

+

+

fix linting errors

+

+

+

+

+

more debug names

improve rehydration

+

todo - debug destroy issue

+

woo

improve tests

+

+

+

fix builds

improve testing setup

+

treeshakable api

+

+

* +

* fix ssr server

* +

* use sets for render-tree

* remove extra 'if' placeholder

* +

* Revert "+"

This reverts commit bec34f0.

* +
  • Loading branch information
lifeart authored Jan 15, 2024
1 parent 7ecd766 commit 08aed4e
Show file tree
Hide file tree
Showing 35 changed files with 1,788 additions and 162 deletions.
3 changes: 2 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@
<link rel="icon" type="image/png" href="/logo.png" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>The GlimmerNext (GXT) project</title>
<link rel="stylesheet" href="/src/style.css" />
</head>
<body>
<div id="app"></div>
<div id="app"><!--ssr-outlet--></div>
<script type="module">
import App from "/src/index.ts";
App();
Expand Down
9 changes: 6 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
},
"scripts": {
"dev": "vite",
"dev:ssr": "node server",
"dev:playwright": "tsc && vite --port 5174 -- --with-sourcemaps",
"build": "tsc && vite build --mode development",
"build:prod": "tsc && vite build",
Expand Down Expand Up @@ -63,11 +64,13 @@
"@glint/environment-glimmerx": "^1.2.1",
"@glint/template": "^1.2.1",
"@lifeart/tiny-router": "^0.0.8",
"@playwright/test": "^1.40.1",
"@types/babel__core": "^7.20.5",
"@types/qunit": "^2.19.9",
"autoprefixer": "^10.4.16",
"backburner.js": "^2.8.0",
"decorator-transforms": "^1.0.3",
"nyc": "^15.1.0",
"postcss": "^8.4.33",
"prettier": "^3.1.1",
"prettier-plugin-ember-template-tag": "^2.0.0",
Expand All @@ -78,15 +81,15 @@
"terser": "^5.26.0",
"tracerbench": "^8.0.1",
"typescript": "^5.2.2",
"v8-to-istanbul": "^9.2.0",
"vite": "^5.0.8",
"vite-plugin-babel": "^1.2.0",
"vite-plugin-circular-dependency": "^0.2.1",
"vite-plugin-dts": "^3.7.0",
"vitest": "^1.1.1",
"zx": "^7.2.3",
"@playwright/test": "^1.40.1",
"nyc": "^15.1.0",
"v8-to-istanbul": "^9.2.0"
"express": "^4.18.2",
"happy-dom": "^13.0.6"
},
"dependencies": {
"@babel/core": "^7.23.6",
Expand Down
2 changes: 1 addition & 1 deletion playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export default defineConfig({

/* Run your local dev server before starting the tests */
webServer: {
command: 'tsc && vite --port 5174 -- --with-sourcemaps',
command: 'pnpm dev:playwright',
url: 'http://localhost:5174',
// @ts-ignore missing types
reuseExistingServer: !process.env.CI,
Expand Down
5 changes: 4 additions & 1 deletion plugins/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,10 @@ export function serializeNode(
ctxName,
)}], ${ctxName})`;
} else {
if (typeof node === 'string') {
if (typeof node === 'string' || typeof node === 'number') {
if (typeof node === 'number') {
node = String(node);
}
if (isPath(node)) {
return serializePath(node);
} else {
Expand Down
Loading

0 comments on commit 08aed4e

Please sign in to comment.