-
Notifications
You must be signed in to change notification settings - Fork 122
feat: refactor SSR #2205
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
Merged
PupilTong
merged 25 commits into
lynx-family:main
from
PupilTong:p/hw/rust-refactor-ssr
Feb 28, 2026
Merged
feat: refactor SSR #2205
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
7e0a85d
+ cargo llvm-cov wasm32
PupilTong 51e2865
refactor: Clean up test setup, remove unused mocks, simplify CI cover…
PupilTong ff9fe78
fix: Correct typos in `AGENTS.md` and a comment in `inline_style.rs`.
PupilTong 021954b
+ opt
PupilTong 8ef5c0f
feat: Introduce server-side `add_class` API, refactor WASM bindings f…
PupilTong 937c227
chore: Ignore new template sections in decoding, prefix unused SSR AP…
PupilTong d3b31fd
feat: Implement server-side rendering (SSR) execution with new elemen…
PupilTong d6887e6
feat: Implement SSR for custom elements with shadow DOM and wrap outp…
PupilTong 843b529
+ fix
PupilTong c6e120d
+ fix
PupilTong 6759d09
+fix
PupilTong fc3c9a6
+ improve
PupilTong 2254b4d
+ fix ci
PupilTong 2ef6b44
+ opt
PupilTong d964453
feat: Add HTML attribute value escaping, make `__UpdateListCallbacks`…
PupilTong 67fee83
+ fix
PupilTong aae3c1d
+ fix comments
PupilTong 8ce4e11
refactor: Update server-side rendering (SSR) to enable inline style t…
PupilTong fc461a5
+ rust test
PupilTong d440278
feat: Infer CSS ID from parent components during SSR by enhancing `cr…
PupilTong 1f032e5
feat: Propagate `css_id` to elements during creation and add SSR test…
PupilTong 359a42c
+ changeset
PupilTong 181edd8
+fix
PupilTong b35ed50
+ test case
PupilTong d8dac79
- bigint
PupilTong File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| "@lynx-js/web-core-wasm": patch | ||
| --- | ||
|
|
||
| Refactor web element templates and server-side rendering logic | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| "@lynx-js/web-elements": patch | ||
| --- | ||
|
|
||
| fix: firefox 147+ layout issue |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 53 additions & 0 deletions
53
packages/web-platform/web-core-wasm-e2e/bench/server.bench.vitest.spec.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,53 @@ | ||
| import { bench, describe } from 'vitest'; | ||
| import * as path from 'path'; | ||
| import * as fs from 'fs'; | ||
| import { executeTemplate } from '@lynx-js/web-core-wasm/server'; | ||
| import { fileURLToPath } from 'url'; | ||
|
|
||
| const __dirname = path.dirname(fileURLToPath(import.meta.url)); | ||
|
|
||
| async function loadTemplate(name: string) { | ||
| const bundlePath = path.resolve(__dirname, `../dist/${name}.web.bundle`); | ||
| return fs.readFileSync(bundlePath); | ||
| } | ||
|
|
||
| const cases = { | ||
| 'basic-performance-div-10000': await loadTemplate( | ||
| 'basic-performance-div-10000', | ||
| ), | ||
| 'basic-performance-div-1000': await loadTemplate( | ||
| 'basic-performance-div-1000', | ||
| ), | ||
| 'basic-performance-div-100': await loadTemplate('basic-performance-div-100'), | ||
| 'basic-performance-nest-level-100': await loadTemplate( | ||
| 'basic-performance-nest-level-100', | ||
| ), | ||
| 'basic-performance-image-100': await loadTemplate( | ||
| 'basic-performance-image-100', | ||
| ), | ||
| 'basic-performance-scroll-view-100': await loadTemplate( | ||
| 'basic-performance-scroll-view-100', | ||
| ), | ||
| 'basic-performance-text-200': await loadTemplate( | ||
| 'basic-performance-text-200', | ||
| ), | ||
| 'basic-performance-large-css': await loadTemplate( | ||
| 'basic-performance-large-css', | ||
| ), | ||
| 'basic-performance-small-css': await loadTemplate( | ||
| 'basic-performance-small-css', | ||
| ), | ||
| }; | ||
|
|
||
| describe('server-bench', () => { | ||
| for (const [testName, rawTemplate] of Object.entries(cases)) { | ||
| bench(testName, async () => { | ||
| await executeTemplate( | ||
| rawTemplate, | ||
| {}, // initData | ||
| {}, // globalProps | ||
| {}, // initI18nResources | ||
| ); | ||
| }); | ||
| } | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.