Skip to content
Merged
Show file tree
Hide file tree
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 Jan 27, 2026
51e2865
refactor: Clean up test setup, remove unused mocks, simplify CI cover…
PupilTong Jan 28, 2026
ff9fe78
fix: Correct typos in `AGENTS.md` and a comment in `inline_style.rs`.
PupilTong Jan 28, 2026
021954b
+ opt
PupilTong Feb 3, 2026
8ef5c0f
feat: Introduce server-side `add_class` API, refactor WASM bindings f…
PupilTong Feb 5, 2026
937c227
chore: Ignore new template sections in decoding, prefix unused SSR AP…
PupilTong Feb 5, 2026
d3b31fd
feat: Implement server-side rendering (SSR) execution with new elemen…
PupilTong Feb 6, 2026
d6887e6
feat: Implement SSR for custom elements with shadow DOM and wrap outp…
PupilTong Feb 6, 2026
843b529
+ fix
PupilTong Feb 10, 2026
c6e120d
+ fix
PupilTong Feb 10, 2026
6759d09
+fix
PupilTong Feb 10, 2026
fc3c9a6
+ improve
PupilTong Feb 25, 2026
2254b4d
+ fix ci
PupilTong Feb 25, 2026
2ef6b44
+ opt
PupilTong Feb 25, 2026
d964453
feat: Add HTML attribute value escaping, make `__UpdateListCallbacks`…
PupilTong Feb 25, 2026
67fee83
+ fix
PupilTong Feb 26, 2026
aae3c1d
+ fix comments
PupilTong Feb 26, 2026
8ce4e11
refactor: Update server-side rendering (SSR) to enable inline style t…
PupilTong Feb 27, 2026
fc461a5
+ rust test
PupilTong Feb 27, 2026
d440278
feat: Infer CSS ID from parent components during SSR by enhancing `cr…
PupilTong Feb 27, 2026
1f032e5
feat: Propagate `css_id` to elements during creation and add SSR test…
PupilTong Feb 27, 2026
359a42c
+ changeset
PupilTong Feb 27, 2026
181edd8
+fix
PupilTong Feb 27, 2026
b35ed50
+ test case
PupilTong Feb 27, 2026
d8dac79
- bigint
PupilTong Feb 27, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/lemon-pigs-teach.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@lynx-js/web-core-wasm": patch
---
Comment thread
PupilTong marked this conversation as resolved.

Refactor web element templates and server-side rendering logic
5 changes: 5 additions & 0 deletions .changeset/nine-gifts-cheat.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@lynx-js/web-elements": patch
---

fix: firefox 147+ layout issue
2 changes: 1 addition & 1 deletion .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:
env:
CARGO_LLVM_COV_FLAGS_NO_RUNNER: --no-sparse
run: |
cargo llvm-cov nextest --all-features --profile ci --config-file .cargo/nextest.toml --lcov --output-path lcov.info --release
cargo llvm-cov nextest --all-targets --all-features --profile ci --config-file .cargo/nextest.toml --lcov --output-path lcov.info --release
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de # v5
with:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ jobs:
run: |
export NODE_OPTIONS="--max-old-space-size=32768"
export PLAYWRIGHT_JUNIT_OUTPUT_NAME=test-report.junit.xml
pnpm --filter @lynx-js/web-elements run test --reporter='github,dot,junit,html' --shard=${{ matrix.shard }}/4
pnpm --filter @lynx-js/web-elements run test --reporter='github,dot,junit,html' --shard=${{ matrix.shard }}/2
pnpm --filter @lynx-js/web-elements run coverage:ci
playwright-linux:
needs: build
Expand Down Expand Up @@ -127,7 +127,7 @@ jobs:
fi
export NODE_OPTIONS="--max-old-space-size=32768"
export PLAYWRIGHT_JUNIT_OUTPUT_NAME=test-report.junit.xml
pnpm --filter @lynx-js/web-tests run test --reporter='github,dot,junit,html' --shard=${{ matrix.shard }}/4
pnpm --filter @lynx-js/web-tests run test --reporter='github,dot,junit,html' --shard=${{ matrix.shard }}/3
pnpm --filter @lynx-js/web-tests run coverage:ci
web-core-wasm-e2e:
needs: build
Expand All @@ -152,7 +152,7 @@ jobs:
fi
export NODE_OPTIONS="--max-old-space-size=32768"
export PLAYWRIGHT_JUNIT_OUTPUT_NAME=test-report.junit.xml
pnpm --filter @lynx-js/web-core-wasm-e2e run test --reporter='github,dot,junit,html' --shard=${{ matrix.shard }}/4
pnpm --filter @lynx-js/web-core-wasm-e2e run test --reporter='github,dot,junit,html' --shard=${{ matrix.shard }}/2
test-api:
needs: build
uses: ./.github/workflows/workflow-test.yml
Expand Down
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ The CI runs these checks (replicate locally for confidence):
5. **TypeScript compilation**: Part of `pnpm turbo build`
6. **Unit tests**: `pnpm test` (vitest-based, requires build)
7. **E2E tests**: Web platform tests with Playwright
8. **Rust tests**: `cargo test --all-features` in Rust packages
8. **Rust tests**: `cargo test --all-targets --all-features` in Rust packages
9. **Type checking**: `pnpm -r run test:type`

### GitHub Workflows
Expand Down
9 changes: 9 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ members = [
"packages/react/transform/swc-plugin-reactlynx",
"packages/react/transform/swc-plugin-reactlynx-compat",
"packages/web-platform/web-core-wasm",
"packages/web-platform/web-elements",
"packages/web-platform/web-mainthread-apis",
]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ export const test: typeof base = base.extend({
const pages = new Set<Page>();

context.on('page', async (page) => {
if (testInfo.titlePath.join(' ').includes('SSR No JS')) {
return;
}
await page.coverage.startJSCoverage({
reportAnonymousScripts: true,
resetOnNavigation: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const workerLimit = Math.floor(((cpuCount, envCPULimit) => {
export const playwrightConfigCommon: Parameters<typeof defineConfig>[0] = {
/** global timeout https://playwright.dev/docs/test-timeouts#global-timeout */
globalTimeout: 20 * 60 * 1000,
// testMatch,
testMatch: '**/tests/*',
Comment thread
PupilTong marked this conversation as resolved.
/* Run tests in files in parallel */
fullyParallel: true,
workers: isCI ? workerLimit : undefined,
Expand Down
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
);
});
}
});
5 changes: 4 additions & 1 deletion packages/web-platform/web-core-wasm-e2e/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"license": "Apache-2.0",
"type": "module",
"scripts": {
"bench": "vitest bench",
"build": "pnpm dlx premove dist && pnpm run --stream \"/^build:.*/\"",
"build:csr": "node ./scripts/generate-build-command.js",
"coverage": "nyc report --cwd=$(realpath ../)",
Expand All @@ -23,6 +24,8 @@
"@lynx-js/web-core-wasm": "workspace:*",
"@playwright/test": "^1.58.2",
"@rsbuild/core": "catalog:rsbuild",
"nyc": "^17.1.0"
"nyc": "^17.1.0",
"prettier": "^3.8.1",
"vitest": "^3.2.4"
}
}
7 changes: 7 additions & 0 deletions packages/web-platform/web-core-wasm-e2e/rsbuild.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { defineConfig } from '@rsbuild/core';
import { fileURLToPath } from 'node:url';
import { ssrMiddleware } from './shell-project/devMiddleware.js';

const __filename = fileURLToPath(import.meta.url);
const port = process.env.PORT ?? 3080;
Expand All @@ -20,6 +21,12 @@ export default defineConfig({
hmr: false,
liveReload: false,
writeToDisk: true,
setupMiddlewares: [
(middlewares: any) => {
middlewares.unshift(ssrMiddleware);
return middlewares;
},
],
},
server: {
port: Number(port),
Expand Down
Loading
Loading