Skip to content

Commit fb95b59

Browse files
committed
squash
1 parent 738d44d commit fb95b59

File tree

91 files changed

+12954
-203
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

91 files changed

+12954
-203
lines changed

.vscode/settings.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,6 @@
3838
"typescript.preferences.preferTypeOnlyAutoImports": true,
3939
"typescript.preferences.importModuleSpecifierEnding": "js",
4040
"rust-analyzer.check.command": "clippy",
41+
"rust-analyzer.check.features": "all",
42+
"rust-analyzer.cargo.features": "all",
4143
}

AGENTS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ The CI runs these checks (replicate locally for confidence):
174174
5. **TypeScript compilation**: Part of `pnpm turbo build`
175175
6. **Unit tests**: `pnpm test` (vitest-based, requires build)
176176
7. **E2E tests**: Web platform tests with Playwright
177-
8. **Rust tests**: `cargo test` in Rust packages
177+
8. **Rust tests**: `cargo test --all-features` in Rust packages
178178
9. **Type checking**: `pnpm -r run test:type`
179179

180180
### GitHub Workflows

Cargo.lock

Lines changed: 66 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ members = [
77
"packages/react/transform/swc-plugin-reactlynx",
88
"packages/react/transform/swc-plugin-reactlynx-compat",
99
"packages/web-platform/web-mainthread-apis",
10+
"packages/web-platform/web-core-wasm",
1011
]
1112

1213
[workspace.dependencies]
@@ -30,9 +31,10 @@ swc_core = "47.0.3"
3031
swc_sourcemap = "9.3.0"
3132
version-compare = "0.2.0"
3233
wasm-bindgen = "0.2.105"
34+
web-sys = { version = "0.3.81" }
3335

3436
[profile.release]
3537
codegen-units = 1
3638
# debug = true
3739
lto = true
38-
opt-level = "s"
40+
opt-level = 3

packages/web-platform/tsconfig.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
{ "path": "./web-mainthread-apis/tsconfig.json" },
2222
{ "path": "./web-core-server/tsconfig.json" },
2323
{ "path": "./web-core/tsconfig.json" },
24+
{ "path": "./web-core-wasm/tsconfig.json" },
2425
{ "path": "./web-rsbuild-plugin/tsconfig.json" },
2526
{ "path": "./web-rsbuild-server-middleware/tsconfig.json" },
2627
/** packages-end */

packages/web-platform/web-constants/src/constants.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,15 @@ export const inShadowRootStyles: string[] = [
4646
overflow: visible;
4747
}`,
4848
];
49+
50+
// YnYRNREG
51+
export const MagicHeader = 0x596E59524E526567; // random magic number for verififying the stream is a Lynx encoded template
52+
53+
export const TemplateSectionLabel = {
54+
Manifest: 1,
55+
StyleInfo: 2,
56+
LepusCode: 3,
57+
CustomSections: 4,
58+
ElementTemplates: 5,
59+
Configurations: 6,
60+
} as const;

packages/web-platform/web-constants/src/eventName.ts

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,25 +10,13 @@ export const W3cEventNameToLynx: Record<string, string> = {
1010
lynxblur: 'blur',
1111
lynxinput: 'input',
1212
};
13-
export const LynxEventNameToW3cByTagName: Record<
14-
string,
15-
Record<string, string>
16-
> = {
17-
'X-INPUT': {
18-
'blur': 'lynxblur',
19-
'focus': 'lynxfocus',
20-
'input': 'lynxinput',
21-
},
22-
'X-TEXTAREA': {
23-
'blur': 'lynxblur',
24-
'focus': 'lynxfocus',
25-
'input': 'lynxinput',
26-
},
27-
};
2813

2914
export const LynxEventNameToW3cCommon: Record<string, string> = {
3015
tap: 'click',
3116
scroll: 'lynxscroll',
3217
scrollend: 'lynxscrollend',
3318
touch: 'overlaytouch',
19+
'lynxblur': 'lynxblur',
20+
'lynxfocus': 'lynxfocus',
21+
'lynxinput': 'lynxinput',
3422
};

packages/web-platform/web-constants/src/types/Element.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,13 @@
33
// LICENSE file in the root directory of this source tree.
44

55
import type { LynxEventType } from './EventType.js';
6+
export const uniqueIdSymbol = Symbol('uniqueId');
7+
8+
export type DecoratedHTMLElement = HTMLElement & {
9+
[uniqueIdSymbol]: number;
10+
componentAtIndex?: ComponentAtIndexCallback;
11+
enqueueComponent?: EnqueueComponentCallback;
12+
};
613

714
export interface LynxRuntimeInfo {
815
eventHandlerMap: Record<string, {

packages/web-platform/web-constants/src/types/LynxModule.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import type { PageConfig } from './PageConfig.js';
77
import type { StyleInfo } from './StyleInfo.js';
88

99
export type ElementTemplateData = {
10-
id: string;
1110
type: string;
1211
idSelector?: string;
1312
class?: string[];

packages/web-platform/web-constants/src/types/MainThreadGlobalThis.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ export type FirstElementPAPI = (
6262

6363
export type GetChildrenPAPI = (
6464
element: HTMLElement,
65-
) => HTMLElement[] | null;
65+
) => HTMLElement[];
6666

6767
export type GetParentPAPI = (
6868
element: HTMLElement,
@@ -321,7 +321,7 @@ export interface ElementPAPIs {
321321
__ElementFromBinary: ElementFromBinaryPAPI;
322322

323323
// __GetTemplateParts currently only provided by the thread-strategy = "all-on-ui" (default)
324-
__GetTemplateParts?: GetTemplatePartsPAPI;
324+
__GetTemplateParts: GetTemplatePartsPAPI;
325325

326326
__MarkPartElement: MarkPartElementPAPI;
327327
__MarkTemplateElement: MarkTemplateElementPAPI;

0 commit comments

Comments
 (0)