feat(web): support main thread invoke ui method#2104
feat(web): support main thread invoke ui method#2104Sherry-hue merged 1 commit intolynx-family:mainfrom
Conversation
🦋 Changeset detectedLatest commit: 21cc3b2 The changes in this PR will be included in the next version bump. This PR includes changesets to release 10 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
📝 WalkthroughWalkthroughA new feature enabling main thread invocation of UI element methods is introduced. Changes include type definitions for the Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In @packages/web-platform/web-mainthread-apis/ts/createMainThreadGlobalThis.ts:
- Around line 820-859: The __InvokeUIMethod handler must validate the element
before using it: at the start of the function (inside __InvokeUIMethod) check
that element is not null/undefined and is an HTMLElement (or at least a non-null
object) and if the check fails immediately call callback with
ErrorCode.PARAM_INVALID and return; only after that safe-check call
getBoundingClientRect or access (element as any)[method]; keep the existing
branching for 'boundingClientRect' and typeof (element as any)[method] ===
"function" but move/guard them behind this element validation to avoid runtime
errors.
🧹 Nitpick comments (4)
packages/web-platform/web-constants/src/types/MainThreadGlobalThis.ts (1)
321-326: Consider using a more specific type for theelementparameter.The
elementparameter is typed asunknown, but the implementation increateMainThreadGlobalThis.tscasts it toHTMLElement. UsingHTMLElementhere would provide better type safety and align with other PAPI types in this file that useHTMLElement.💡 Suggested type improvement
export type InvokeUIMethodPAPI = ( - element: unknown, + element: HTMLElement, method: string, params: object, callback: (result: InvokeCallbackRes) => void, ) => void;packages/web-platform/web-tests/tests/react.spec.ts (1)
451-465: Consider reducing the wait time for test stability.The test uses a 3000ms wait, which is significantly longer than most other tests in this file (typically 100-500ms). While this may be intentional to allow the auto-scroll animation to complete, it could make the test slow and potentially flaky.
Consider either:
- Reducing the wait time if the scroll completes faster
- Using a polling approach with
waitForFunctionto wait untilscrollTop > 100rather than a fixed delay💡 Alternative using waitForFunction
test('basic-ref-main-invoke-ui-method', async ({ page }, { title }) => { await goto(page, title); await wait(100); const scrollView = page.locator('#scroll-view'); const scrollTopBefore = await scrollView.evaluate((node) => node.scrollTop ); expect(scrollTopBefore).toBe(0); await page.locator('#target').click(); - await wait(3000); - const scrollTopAfter = await scrollView.evaluate((node) => - node.scrollTop - ); - expect(scrollTopAfter).toBeGreaterThan(100); + await page.waitForFunction( + () => { + const el = document.querySelector('lynx-view')?.shadowRoot?.querySelector('#scroll-view'); + return el && el.scrollTop > 100; + }, + { timeout: 5000 } + ); });packages/web-platform/web-tests/tests/react/basic-ref-main-invoke-ui-method/index.jsx (1)
61-63: Missingkeyprop on list items.When rendering a list of elements with
.map(), each child should have a uniquekeyprop to help React identify which items have changed, been added, or removed. While this is a test fixture, adding keys is a React best practice.💡 Add key prop
{Array.from({ length: 5 }).map((item, index) => ( - <ScrollItem width='calc(100% - 10px)' height='100px' index={index} /> + <ScrollItem key={index} width='calc(100% - 10px)' height='100px' index={index} /> ))}packages/web-platform/web-mainthread-apis/ts/createMainThreadGlobalThis.ts (1)
822-837: Consider includingxandyproperties from DOMRect.The
boundingClientRectresponse includes most properties fromDOMRectbut omitsxandy. Whileleftandtopare often equivalent, includingxandywould provide complete parity with the nativegetBoundingClientRect()API.💡 Include x and y properties
callback({ code: ErrorCode.SUCCESS, data: { id: (element as HTMLElement).id, + x: rect.x, + y: rect.y, width: rect.width, height: rect.height, left: rect.left, right: rect.right, top: rect.top, bottom: rect.bottom, }, });
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (5)
.changeset/empty-turkeys-strive.mdpackages/web-platform/web-constants/src/types/MainThreadGlobalThis.tspackages/web-platform/web-mainthread-apis/ts/createMainThreadGlobalThis.tspackages/web-platform/web-tests/tests/react.spec.tspackages/web-platform/web-tests/tests/react/basic-ref-main-invoke-ui-method/index.jsx
🧰 Additional context used
📓 Path-based instructions (3)
**/*.{ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
Use TypeScript in strict mode with the configuration specified in tsconfig.json
Files:
packages/web-platform/web-constants/src/types/MainThreadGlobalThis.tspackages/web-platform/web-mainthread-apis/ts/createMainThreadGlobalThis.tspackages/web-platform/web-tests/tests/react.spec.ts
**/*.{js,ts,tsx}
📄 CodeRabbit inference engine (AGENTS.md)
**/*.{js,ts,tsx}: Follow eslint rules as configured in eslint.config.js including React and TypeScript specific rules
Follow code formatting rules specified in .dprint.jsonc and biome.jsonc
Files:
packages/web-platform/web-constants/src/types/MainThreadGlobalThis.tspackages/web-platform/web-mainthread-apis/ts/createMainThreadGlobalThis.tspackages/web-platform/web-tests/tests/react.spec.ts
packages/web-platform/web-tests/**/*.{ts,tsx,js}
📄 CodeRabbit inference engine (AGENTS.md)
Use Playwright for E2E tests in packages/web-platform/web-tests/
Files:
packages/web-platform/web-tests/tests/react.spec.ts
🧠 Learnings (26)
📓 Common learnings
Learnt from: Sherry-hue
Repo: lynx-family/lynx-stack PR: 1770
File: packages/web-platform/web-mainthread-apis/src/utils/processStyleInfo.ts:316-318
Timestamp: 2025-09-18T08:12:56.802Z
Learning: In packages/web-platform/web-mainthread-apis/src/utils/processStyleInfo.ts, the current implementation uses cardStyleElement.textContent += for lazy component styles. While this could theoretically invalidate rule indices by reparsing the stylesheet, Sherry-hue indicated that UIDs don't repeat for the same element, making this approach acceptable for now. A future optimization to use separate style elements per entry was discussed but deferred to a separate PR to keep the current lazy bundle PR focused.
📚 Learning: 2025-10-11T06:16:12.517Z
Learnt from: Sherry-hue
Repo: lynx-family/lynx-stack PR: 1820
File: packages/web-platform/web-tests/tests/react.spec.ts:834-856
Timestamp: 2025-10-11T06:16:12.517Z
Learning: In packages/web-platform/web-tests/tests/react.spec.ts, the tests `basic-bindmouse` and `basic-mts-bindtouchstart` are NOT duplicates despite having similar test structures. They test different event types: `basic-bindmouse` validates mouse events (mousedown, mouseup, mousemove) with mouse-specific properties (button, buttons, x, y, pageX, pageY, clientX, clientY), while `basic-mts-bindtouchstart` validates touch events (touchstart) with touch arrays (touches, targetTouches, changedTouches). The similar test structure is coincidental and follows testing conventions.
Applied to files:
packages/web-platform/web-tests/tests/react/basic-ref-main-invoke-ui-method/index.jsxpackages/web-platform/web-tests/tests/react.spec.ts
📚 Learning: 2025-12-29T11:26:09.502Z
Learnt from: CR
Repo: lynx-family/lynx-stack PR: 0
File: packages/web-platform/web-elements/AGENTS.md:0-0
Timestamp: 2025-12-29T11:26:09.502Z
Learning: Applies to packages/web-platform/web-elements/src/elements/all.ts : Export new components in `src/elements/all.ts` and add export configuration to `package.json` under `exports` for both types and default
Applied to files:
packages/web-platform/web-tests/tests/react/basic-ref-main-invoke-ui-method/index.jsxpackages/web-platform/web-constants/src/types/MainThreadGlobalThis.ts
📚 Learning: 2025-11-11T08:05:14.163Z
Learnt from: Sherry-hue
Repo: lynx-family/lynx-stack PR: 1932
File: packages/web-platform/web-tests/tests/react/basic-element-x-input-ng-bindinput/index.jsx:10-26
Timestamp: 2025-11-11T08:05:14.163Z
Learning: In packages/web-platform/web-tests/tests/react/basic-element-x-input-ng-bindinput/index.jsx, the test intentionally uses selectionStart twice in the result string (instead of selectionStart and selectionEnd) because it prioritizes testing whether x-input-ng works functionally, rather than validating the correctness of selection values.
Applied to files:
packages/web-platform/web-tests/tests/react/basic-ref-main-invoke-ui-method/index.jsxpackages/web-platform/web-tests/tests/react.spec.ts
📚 Learning: 2025-12-29T11:26:09.502Z
Learnt from: CR
Repo: lynx-family/lynx-stack PR: 0
File: packages/web-platform/web-elements/AGENTS.md:0-0
Timestamp: 2025-12-29T11:26:09.502Z
Learning: Applies to packages/web-platform/web-elements/src/elements/**/index.ts : Ensure `index.ts` files and complex logic have clear, descriptive comments matching the implementation
Applied to files:
packages/web-platform/web-tests/tests/react/basic-ref-main-invoke-ui-method/index.jsx
📚 Learning: 2025-12-29T11:26:09.502Z
Learnt from: CR
Repo: lynx-family/lynx-stack PR: 0
File: packages/web-platform/web-elements/AGENTS.md:0-0
Timestamp: 2025-12-29T11:26:09.502Z
Learning: Applies to packages/web-platform/web-elements/src/elements/**/*.ts : When creating new elements, inherit from `Element` via `Component` decorator and use reactive utilities provided by `element-reactive`
Applied to files:
packages/web-platform/web-tests/tests/react/basic-ref-main-invoke-ui-method/index.jsxpackages/web-platform/web-tests/tests/react.spec.ts
📚 Learning: 2025-12-29T11:26:09.502Z
Learnt from: CR
Repo: lynx-family/lynx-stack PR: 0
File: packages/web-platform/web-elements/AGENTS.md:0-0
Timestamp: 2025-12-29T11:26:09.502Z
Learning: Applies to packages/web-platform/web-elements/tests/**/*.spec.ts : Create a separate spec file for new components (e.g., `tests/x-webview.spec.ts`) instead of adding to the monolithic `web-elements.spec.ts`
Applied to files:
packages/web-platform/web-tests/tests/react/basic-ref-main-invoke-ui-method/index.jsxpackages/web-platform/web-tests/tests/react.spec.ts
📚 Learning: 2025-09-12T09:43:04.847Z
Learnt from: gaoachao
Repo: lynx-family/lynx-stack PR: 1736
File: .changeset/spotty-experts-smoke.md:1-3
Timestamp: 2025-09-12T09:43:04.847Z
Learning: In the lynx-family/lynx-stack repository, empty changeset files (containing only `---\n\n---`) are used for internal changes that modify src/** files but don't require meaningful release notes, such as private package changes or testing-only modifications. This satisfies CI requirements without generating user-facing release notes.
Applied to files:
.changeset/empty-turkeys-strive.md
📚 Learning: 2025-09-12T09:43:04.847Z
Learnt from: gaoachao
Repo: lynx-family/lynx-stack PR: 1736
File: .changeset/spotty-experts-smoke.md:1-3
Timestamp: 2025-09-12T09:43:04.847Z
Learning: In the lynx-family/lynx-stack repository, private packages (marked with "private": true in package.json) like lynx-js/react-transform don't require meaningful changeset entries even when their public APIs change, since they are not published externally and only affect internal development.
Applied to files:
.changeset/empty-turkeys-strive.md
📚 Learning: 2025-07-22T09:23:07.797Z
Learnt from: colinaaa
Repo: lynx-family/lynx-stack PR: 1330
File: .changeset/olive-animals-attend.md:1-3
Timestamp: 2025-07-22T09:23:07.797Z
Learning: In the lynx-family/lynx-stack repository, changesets are only required for meaningful changes to end-users such as bugfixes and features. Internal/development changes like chores, refactoring, or removing debug info do not need changeset entries.
Applied to files:
.changeset/empty-turkeys-strive.md
📚 Learning: 2025-07-22T09:26:16.722Z
Learnt from: colinaaa
Repo: lynx-family/lynx-stack PR: 1330
File: .changeset/olive-animals-attend.md:1-3
Timestamp: 2025-07-22T09:26:16.722Z
Learning: In the lynx-family/lynx-stack repository, CI checks require changesets when files matching the pattern "src/**" are modified (as configured in .changeset/config.json). For internal changes that don't need meaningful changesets, an empty changeset file is used to satisfy the CI requirement while not generating any release notes.
Applied to files:
.changeset/empty-turkeys-strive.md
📚 Learning: 2025-12-26T05:10:01.608Z
Learnt from: CR
Repo: lynx-family/lynx-stack PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-12-26T05:10:01.608Z
Learning: Use changeset tool with `pnpm changeset` to document changes before contribution
Applied to files:
.changeset/empty-turkeys-strive.md
📚 Learning: 2025-10-10T08:22:12.051Z
Learnt from: Sherry-hue
Repo: lynx-family/lynx-stack PR: 1837
File: packages/web-platform/web-mainthread-apis/src/prepareMainThreadAPIs.ts:266-266
Timestamp: 2025-10-10T08:22:12.051Z
Learning: In packages/web-platform/web-mainthread-apis, the handleUpdatedData function returned from prepareMainThreadAPIs is internal-only, used to serve web-core. It does not require public documentation, type exports, or SSR support.
Applied to files:
packages/web-platform/web-constants/src/types/MainThreadGlobalThis.tspackages/web-platform/web-mainthread-apis/ts/createMainThreadGlobalThis.ts
📚 Learning: 2025-12-29T11:26:09.502Z
Learnt from: CR
Repo: lynx-family/lynx-stack PR: 0
File: packages/web-platform/web-elements/AGENTS.md:0-0
Timestamp: 2025-12-29T11:26:09.502Z
Learning: Applies to packages/web-platform/web-elements/src/elements/**/*.ts : Minimize heavy computation in `attributeChangedCallback` as these elements run on the main thread
Applied to files:
packages/web-platform/web-constants/src/types/MainThreadGlobalThis.tspackages/web-platform/web-mainthread-apis/ts/createMainThreadGlobalThis.ts
📚 Learning: 2025-09-28T07:52:03.601Z
Learnt from: Sherry-hue
Repo: lynx-family/lynx-stack PR: 1837
File: packages/web-platform/web-worker-runtime/src/backgroundThread/background-apis/createNativeApp.ts:151-154
Timestamp: 2025-09-28T07:52:03.601Z
Learning: There are two different registerUpdateDataHandler functions in the lynx-stack codebase:
1. Main thread version in packages/web-platform/web-worker-runtime/src/mainThread/crossThreadHandlers/registerUpdateDataHandler.ts takes (mainThreadRpc: Rpc, backgroundThreadRpc: Rpc, runtime: MainThreadGlobalThis)
2. Background thread version in packages/web-platform/web-worker-runtime/src/backgroundThread/background-apis/crossThreadHandlers/registerUpdateDataHandler.ts takes only (rpc: Rpc, tt: NativeTTObject)
Applied to files:
packages/web-platform/web-constants/src/types/MainThreadGlobalThis.ts
📚 Learning: 2025-12-30T10:02:35.055Z
Learnt from: upupming
Repo: lynx-family/lynx-stack PR: 2081
File: packages/react/runtime/src/alog/elementPAPICall.ts:109-112
Timestamp: 2025-12-30T10:02:35.055Z
Learning: In packages/react/runtime/src/alog/elementPAPICall.ts, the helper APIs `__GetTag` and `__GetElementUniqueID` should always exist when instrumenting FiberElement PAPIs, so defensive checks for their existence are unnecessary.
Applied to files:
packages/web-platform/web-constants/src/types/MainThreadGlobalThis.ts
📚 Learning: 2025-08-21T08:46:54.494Z
Learnt from: upupming
Repo: lynx-family/lynx-stack PR: 1370
File: packages/webpack/cache-events-webpack-plugin/src/LynxCacheEventsRuntimeModule.ts:23-27
Timestamp: 2025-08-21T08:46:54.494Z
Learning: In Lynx webpack runtime modules, the team prioritizes performance and simplicity over defensive runtime error handling. They prefer relying on compile-time type safety (TypeScript) rather than adding runtime checks like try-catch blocks or type validation, especially for performance-critical code like cache event setup/cleanup functions.
Applied to files:
packages/web-platform/web-mainthread-apis/ts/createMainThreadGlobalThis.ts
📚 Learning: 2025-08-12T16:09:32.413Z
Learnt from: colinaaa
Repo: lynx-family/lynx-stack PR: 1497
File: packages/react/transform/tests/__swc_snapshots__/src/swc_plugin_snapshot/mod.rs/basic_full_static.js:9-10
Timestamp: 2025-08-12T16:09:32.413Z
Learning: In the Lynx stack, functions prefixed with `__` that are called in transformed code may be injected globally by the Lynx Engine at runtime rather than exported from the React runtime package. For example, `__CreateFrame` is injected globally by the Lynx Engine, not exported from lynx-js/react.
Applied to files:
packages/web-platform/web-mainthread-apis/ts/createMainThreadGlobalThis.ts
📚 Learning: 2025-08-27T12:42:01.095Z
Learnt from: upupming
Repo: lynx-family/lynx-stack PR: 1616
File: packages/webpack/cache-events-webpack-plugin/test/cases/not-cache-events/lazy-bundle/index.js:3-3
Timestamp: 2025-08-27T12:42:01.095Z
Learning: In webpack, properties like __webpack_require__.lynx_ce are injected during compilation/build time when webpack processes modules and generates bundles, not at runtime when dynamic imports execute. Tests for such properties don't need to wait for dynamic imports to complete.
Applied to files:
packages/web-platform/web-mainthread-apis/ts/createMainThreadGlobalThis.ts
📚 Learning: 2025-12-29T11:26:09.502Z
Learnt from: CR
Repo: lynx-family/lynx-stack PR: 0
File: packages/web-platform/web-elements/AGENTS.md:0-0
Timestamp: 2025-12-29T11:26:09.502Z
Learning: The `web-elements` package provides a Native UI implementation for the LynxJS Web Platform using Web Components built on the `element-reactive` reactive framework
Applied to files:
packages/web-platform/web-mainthread-apis/ts/createMainThreadGlobalThis.ts
📚 Learning: 2025-09-25T14:03:25.576Z
Learnt from: PupilTong
Repo: lynx-family/lynx-stack PR: 1834
File: packages/web-platform/web-worker-runtime/src/backgroundThread/background-apis/createChunkLoading.ts:162-171
Timestamp: 2025-09-25T14:03:25.576Z
Learning: In the lynx-stack codebase, for loadScriptAsync implementations in createChunkLoading.ts, unhandled promise rejections from readScriptAsync are intentionally not caught - the caller is expected to handle errors rather than the loadScriptAsync method itself invoking the callback with error messages.
Applied to files:
packages/web-platform/web-mainthread-apis/ts/createMainThreadGlobalThis.ts
📚 Learning: 2025-12-29T11:26:09.502Z
Learnt from: CR
Repo: lynx-family/lynx-stack PR: 0
File: packages/web-platform/web-elements/AGENTS.md:0-0
Timestamp: 2025-12-29T11:26:09.502Z
Learning: Applies to packages/web-platform/web-elements/tests/**/*.spec.ts : Use Playwright for all E2E and functional tests with standard assertions like `expect(locator).toBeVisible()`, `expect(locator).toHaveCSS()`, and `diffScreenShot` for screenshot comparisons
Applied to files:
packages/web-platform/web-tests/tests/react.spec.ts
📚 Learning: 2025-12-29T11:26:09.502Z
Learnt from: CR
Repo: lynx-family/lynx-stack PR: 0
File: packages/web-platform/web-elements/AGENTS.md:0-0
Timestamp: 2025-12-29T11:26:09.502Z
Learning: Applies to packages/web-platform/web-elements/tests/**/*.spec.ts : When a component makes external requests (e.g., via `iframe` or `fetch`), mock them using `page.route` in Playwright tests to ensure tests are hermetic and fast
Applied to files:
packages/web-platform/web-tests/tests/react.spec.ts
📚 Learning: 2025-12-29T11:26:09.502Z
Learnt from: CR
Repo: lynx-family/lynx-stack PR: 0
File: packages/web-platform/web-elements/AGENTS.md:0-0
Timestamp: 2025-12-29T11:26:09.502Z
Learning: Applies to packages/web-platform/web-elements/tests/**/*.spec.ts : In Playwright tests, access Shadow DOM explicitly using `.shadowRoot` when using `evaluate` or `waitForFunction`, as document.querySelector fails to directly access shadow DOM elements
Applied to files:
packages/web-platform/web-tests/tests/react.spec.ts
📚 Learning: 2026-01-04T11:17:24.013Z
Learnt from: CR
Repo: lynx-family/lynx-stack PR: 0
File: packages/web-platform/web-core-wasm/AGENTS.md:0-0
Timestamp: 2026-01-04T11:17:24.013Z
Learning: When modifying Rust core logic in src/main_thread, ALWAYS add corresponding tests in tests/element-apis.spec.ts to verify the JS-side behavior
Applied to files:
packages/web-platform/web-tests/tests/react.spec.ts
📚 Learning: 2025-12-29T11:26:09.502Z
Learnt from: CR
Repo: lynx-family/lynx-stack PR: 0
File: packages/web-platform/web-elements/AGENTS.md:0-0
Timestamp: 2025-12-29T11:26:09.502Z
Learning: Applies to packages/web-platform/web-elements/tests/fixtures/**/*.html : Use HTML files for test fixtures and define a helper function `goto(page, fixtureName)` to handle navigation and waiting for resources like `document.fonts.ready`
Applied to files:
packages/web-platform/web-tests/tests/react.spec.ts
🧬 Code graph analysis (1)
packages/web-platform/web-constants/src/types/MainThreadGlobalThis.ts (1)
packages/web-platform/web-constants/src/types/NativeApp.ts (1)
InvokeCallbackRes(100-103)
🔇 Additional comments (4)
.changeset/empty-turkeys-strive.md (1)
1-6: LGTM!The changeset correctly declares patch bumps for both affected packages (
@lynx-js/web-mainthread-apisand@lynx-js/web-constants) with a clear feature description.packages/web-platform/web-constants/src/types/MainThreadGlobalThis.ts (1)
13-13: LGTM!The import of
InvokeCallbackResand the addition of__InvokeUIMethodto theElementPAPIsinterface are correctly implemented and consistent with the existing patterns in this file.Also applies to: 392-392
packages/web-platform/web-tests/tests/react/basic-ref-main-invoke-ui-method/index.jsx (1)
22-31: LGTM!The
Appcomponent correctly demonstrates the new__InvokeUIMethodAPI by usinguseMainThreadRefand invoking theautoScrollmethod on the scroll-view. The'main thread'directive properly marks the handler for main thread execution.packages/web-platform/web-mainthread-apis/ts/createMainThreadGlobalThis.ts (1)
64-64: LGTM!The
ErrorCodeimport is correctly added to the existing import block from@lynx-js/web-constants.
packages/web-platform/web-mainthread-apis/ts/createMainThreadGlobalThis.ts
Show resolved
Hide resolved
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
CodSpeed Performance ReportMerging this PR will degrade performance by 8.02%Comparing Summary
Performance Changes
Footnotes
|
Web Explorer#7154 Bundle Size — 383.59KiB (+0.11%).21cc3b2(current) vs 23403f6 main#7150(baseline) Bundle metrics
Bundle size by type
Bundle analysis report Branch Sherry-hue:feat/main-ref-invoke Project dashboard Generated by RelativeCI Documentation Report issue |
This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated. # Releases ## @lynx-js/react@0.116.0 ### Minor Changes - **BREAKING CHANGE**: Bump Preact from [10.24.0](preactjs/preact@1807173) to [10.28.0](preactjs/preact@f7693b7), see diffs at [hzy/preact#6](hzy/preact#6). ([#2042](#2042)) ### Patch Changes - Add safety checks for compilation macros to prevent runtime errors when they are undefined. ([#2110](#2110)) Replaces direct usage of `__PROFILE__`, `__MAIN_THREAD__`, `__BACKGROUND__` with `typeof` checks. This improves robustness by checking variable existence before access, preventing runtime errors in environments where compilation macros are not defined. ## @lynx-js/lynx-bundle-rslib-config@0.2.0 ### Minor Changes - Use `LAYERS` exposed by DSL plugins ([#2114](#2114)) ## @lynx-js/gesture-runtime@2.1.2 ### Patch Changes - Fix an issue that `NativeGesture` does not get correct types in callback ([#2130](#2130)) ## @lynx-js/rspeedy@0.13.1 ### Patch Changes - Updated dependencies \[]: - @lynx-js/web-rsbuild-server-middleware@0.19.6 ## @lynx-js/react-rsbuild-plugin@0.12.6 ### Patch Changes - Support using `pluginReactLynx` in Rslib. ([#2114](#2114)) - Updated dependencies \[[`4cd7182`](4cd7182)]: - @lynx-js/template-webpack-plugin@0.10.2 - @lynx-js/react-alias-rsbuild-plugin@0.12.6 - @lynx-js/use-sync-external-store@1.5.0 - @lynx-js/react-refresh-webpack-plugin@0.3.4 - @lynx-js/react-webpack-plugin@0.7.3 - @lynx-js/css-extract-webpack-plugin@0.7.0 ## upgrade-rspeedy@0.13.1 ### Patch Changes - Fix the issue `rslib-runtime.js` was not published in dist folder. ([#2122](#2122)) ## @lynx-js/testing-environment@0.1.10 ### Patch Changes - Fix the error "lynxTestingEnv is not defined" ([#2118](#2118)) ## @lynx-js/web-constants@0.19.6 ### Patch Changes - feat: add main-thread API: \_\_QuerySelector ([#2115](#2115)) - fix: when a list-item is deleted from list, the deleted list-item is still showed incorrectly. ([#1092](#1092)) This is because the `enqueueComponent` method does not delete the node from the Element Tree. It is only to maintain the display node on RL, and lynx web needs to delete the dom additionally. - feat: support main thread invoke ui method ([#2104](#2104)) - feat: support lynx.reload() ([#2127](#2127)) - Updated dependencies \[[`f7133c1`](f7133c1)]: - @lynx-js/web-worker-rpc@0.19.6 ## @lynx-js/web-core@0.19.6 ### Patch Changes - fix: avoid crash on CPUs that do not support SIMD ([#2133](#2133)) - feat: support lynx.reload() ([#2127](#2127)) - Updated dependencies \[[`179f984`](179f984), [`f7133c1`](f7133c1), [`6c2b51a`](6c2b51a), [`556fe9f`](556fe9f), [`5b589ab`](5b589ab)]: - @lynx-js/web-constants@0.19.6 - @lynx-js/web-mainthread-apis@0.19.6 - @lynx-js/web-worker-rpc@0.19.6 - @lynx-js/web-worker-runtime@0.19.6 ## @lynx-js/web-core-wasm@0.0.1 ### Patch Changes - Updated dependencies \[[`f7133c1`](f7133c1)]: - @lynx-js/web-worker-rpc@0.19.6 ## @lynx-js/web-mainthread-apis@0.19.6 ### Patch Changes - feat: add main-thread API: \_\_QuerySelector ([#2115](#2115)) - fix: when a list-item is deleted from list, the deleted list-item is still showed incorrectly. ([#1092](#1092)) This is because the `enqueueComponent` method does not delete the node from the Element Tree. It is only to maintain the display node on RL, and lynx web needs to delete the dom additionally. - feat: support main thread invoke ui method ([#2104](#2104)) - fix: mts && bts events can be binded both ([#2121](#2121)) - Updated dependencies \[[`179f984`](179f984), [`f7133c1`](f7133c1), [`6c2b51a`](6c2b51a), [`5b589ab`](5b589ab)]: - @lynx-js/web-constants@0.19.6 ## @lynx-js/web-worker-rpc@0.19.6 ### Patch Changes - fix: when a list-item is deleted from list, the deleted list-item is still showed incorrectly. ([#1092](#1092)) This is because the `enqueueComponent` method does not delete the node from the Element Tree. It is only to maintain the display node on RL, and lynx web needs to delete the dom additionally. ## @lynx-js/web-worker-runtime@0.19.6 ### Patch Changes - feat: support lynx.reload() ([#2127](#2127)) - Updated dependencies \[[`179f984`](179f984), [`f7133c1`](f7133c1), [`6c2b51a`](6c2b51a), [`556fe9f`](556fe9f), [`5b589ab`](5b589ab)]: - @lynx-js/web-constants@0.19.6 - @lynx-js/web-mainthread-apis@0.19.6 - @lynx-js/web-worker-rpc@0.19.6 ## @lynx-js/template-webpack-plugin@0.10.2 ### Patch Changes - Polyfill `lynx.requireModuleAsync` to allow cache same parallel requests. ([#2108](#2108)) ## create-rspeedy@0.13.1 ## @lynx-js/react-alias-rsbuild-plugin@0.12.6 ## @lynx-js/web-core-server@0.19.6 ## @lynx-js/web-rsbuild-server-middleware@0.19.6 Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Summary by CodeRabbit
New Features
Tests
✏️ Tip: You can customize this high-level summary in your review settings.
Checklist