Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 0 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,6 @@ jobs:
run: >
pnpm
--filter @lynx-js/react-runtime
--filter @lynx-js/react-worklet-runtime
--filter @lynx-js/react-transform
run test
--reporter=github-actions
Expand Down
2 changes: 2 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ export default tseslint.config(
'packages/react/runtime/jsx-runtime/**',
'packages/react/runtime/lazy/**',
'packages/react/runtime/lepus/**',
// Generated worklet bundles are published assets, not source files.
'packages/react/runtime/worklet-runtime/**',
'packages/react/runtime/src/renderToOpcodes/**',
'packages/react/runtime/types/**',

Expand Down
6 changes: 3 additions & 3 deletions packages/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,11 @@
},
"./worklet-runtime": {
"types": "./runtime/lib/worklet-runtime/index.d.ts",
"default": "./worklet-runtime/dist/main.js"
"default": "./runtime/worklet-runtime/main.js"
},
"./worklet-dev-runtime": {
"types": "./runtime/lib/worklet-runtime/index.d.ts",
"default": "./worklet-runtime/dist/dev.js"
"default": "./runtime/worklet-runtime/dev.js"
},
"./worklet-runtime/bindings": {
"types": "./runtime/lib/worklet-runtime/bindings/index.d.ts",
Expand Down Expand Up @@ -163,14 +163,14 @@
"transform",
"types",
"docs",
"worklet-runtime",
"testing-library",
"CHANGELOG.md",
"internal.js",
"README.md",
"README.zh.md"
],
"scripts": {
"build": "rslib build",
"api-extractor": "api-extractor run --verbose"
},
"dependencies": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2025 The Lynx Authors. All rights reserved.
// Copyright 2026 The Lynx Authors. All rights reserved.
// Licensed under the Apache License Version 2.0 that can be found in the
// LICENSE file in the root directory of this source tree.

Expand All @@ -15,13 +15,16 @@ export default defineConfig({
__DEV__: 'true',
},
entry: {
dev: '../runtime/src/worklet-runtime/index.ts',
dev: './runtime/src/worklet-runtime/index.ts',
},
},
output: {
sourceMap: {
js: 'inline-source-map',
},
distPath: {
root: './runtime/worklet-runtime',
},
},
},
{
Expand All @@ -33,11 +36,14 @@ export default defineConfig({
__DEV__: 'false',
},
entry: {
main: '../runtime/src/worklet-runtime/index.ts',
main: './runtime/src/worklet-runtime/index.ts',
},
},
output: {
minify: true,
distPath: {
root: './runtime/worklet-runtime',
},
},
},
],
Expand Down
1 change: 1 addition & 0 deletions packages/react/runtime/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
coverage/
lib/
/worklet-runtime/
!debug
2 changes: 2 additions & 0 deletions packages/react/runtime/.npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,5 @@
!lepus/*
!lib/**
!lib/*
!worklet-runtime/*
!worklet-runtime/**
1 change: 1 addition & 0 deletions packages/react/runtime/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"src"
],
"scripts": {
"build": "tsc --build",
"test": "vitest run --coverage"
},
"devDependencies": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,20 @@ class PageElement {
}

export function querySelector(cssSelector: string): Element | null {
const element = __QuerySelector(PageElement.get(), cssSelector, {});
const pageElement = PageElement.get();
if (!pageElement) {
return null;
}
const element = __QuerySelector(pageElement, cssSelector, {});
return element ? new Element(element) : null;
}

export function querySelectorAll(cssSelector: string): Element[] {
return __QuerySelectorAll(PageElement.get(), cssSelector, {}).map(
const pageElement = PageElement.get();
if (!pageElement) {
return [];
}
return __QuerySelectorAll(pageElement, cssSelector, {}).map(
(element) => {
return new Element(element);
},
Expand Down
11 changes: 8 additions & 3 deletions packages/react/runtime/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,19 @@
"compilerOptions": {
"composite": true,
"outDir": "./lib",
// Keep incremental metadata under lib so clearing generated outputs also
// invalidates the runtime build cache for worklet-runtime artifacts.
"tsBuildInfoFile": "./lib/tsconfig.tsbuildinfo",
"baseUrl": "./",
"paths": {
// Resolve the public bindings specifier back to source while building
// runtime itself, so the emitted lib output never becomes its own input.
"@lynx-js/react/worklet-runtime/bindings": ["./src/worklet-runtime/bindings/index.ts"],
},
"rootDir": "./src",
"jsx": "react-jsx",
"jsxImportSource": "./",
},
"references": [{
"path": "../worklet-runtime/tsconfig.json",
}],
"include": [
"debug",
"jsx-dev-runtime",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,16 @@
"build": {
"dependsOn": [],
"inputs": [
"../runtime/src/worklet-runtime/**",
"rslib.config.ts"
"debug/**",
"jsx-dev-runtime/**",
"jsx-runtime/**",
"lepus/**",
"src/**",
"types/**",
"tsconfig.json"
],
"outputs": [
"dist"
"lib/**"
]
}
}
Expand Down
1 change: 1 addition & 0 deletions packages/react/runtime/vitest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ export default defineConfig({
'vitest.config.ts',
'__test__/utils/**',
'lib/**',
'worklet-runtime/**',
'src/index.ts',
'src/lynx.ts',
'src/root.ts',
Expand Down
3 changes: 0 additions & 3 deletions packages/react/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@
{
"path": "./components/tsconfig.json",
},
{
"path": "./worklet-runtime/tsconfig.json",
},
{
"path": "./transform/rspack-napi/tsconfig.json",
}
Expand Down
9 changes: 8 additions & 1 deletion packages/react/turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,17 @@
"build": {
"dependsOn": [
"@lynx-js/react-refresh#build",
"@lynx-js/react-runtime#build",
"@lynx-js/react-transform#build:wasm",
"@lynx-js/react-worklet-runtime#build",
"@lynx-js/reactlynx-testing-library#build",
"@lynx-js/testing-environment#build"
],
"inputs": [
"runtime/src/worklet-runtime/**",
"rslib.config.ts"
],
"outputs": [
"runtime/worklet-runtime/**"
]
}
}
Expand Down
3 changes: 0 additions & 3 deletions packages/react/worklet-runtime/.gitignore

This file was deleted.

4 changes: 0 additions & 4 deletions packages/react/worklet-runtime/.npmignore

This file was deleted.

This file was deleted.

28 changes: 0 additions & 28 deletions packages/react/worklet-runtime/package.json

This file was deleted.

16 changes: 0 additions & 16 deletions packages/react/worklet-runtime/tsconfig.json

This file was deleted.

13 changes: 0 additions & 13 deletions packages/react/worklet-runtime/vitest.config.ts

This file was deleted.

6 changes: 0 additions & 6 deletions pnpm-lock.yaml

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

1 change: 0 additions & 1 deletion pnpm-workspace.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ packages:
- packages/react/transform/rspack-napi
- packages/react/transform/swc-plugin-reactlynx
- packages/react/transform/swc-plugin-reactlynx-compat
- packages/react/worklet-runtime
- packages/react-umd
- packages/rspeedy/*
- packages/tailwind-preset
Expand Down
Loading