Skip to content

Conversation

@pull
Copy link

@pull pull bot commented May 9, 2025

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.1)

Can you help keep this open source service alive? 💖 Please sponsor : )

colinaaa and others added 6 commits May 9, 2025 11:51
## Summary

The `options[DIFF]` may be overridden during the unmount process:


https://github.com/lynx-family/lynx-stack/blob/0a616c9d22613666455e9e6e8660a8f5b481adcf/packages/react/runtime/src/lifecycle/delayUnmount.ts#L40-L45

This would conflict with the overwriting of `options[DIFF]` within
`runWithForce()`:


https://github.com/lynx-family/lynx-stack/blob/0a616c9d22613666455e9e6e8660a8f5b481adcf/packages/react/runtime/src/lynx/runWithForce.ts#L11

In a real-world scenario, consider simultaneously updating GlobalProps
and states.

- First tick:
  - We have `options[DIFF] === oldDiff` at the beginning.
  - `updateGlobalProps`
    - We still have `options[DIFF] === diffUnmount` ✅
- A `Promise.resolve().then()` is called to enqueue a `runWithForce`
update.
  - `renderComponent`
    - We set `options[DIFF]` to `diffUnmount` ✅
- when there is a state update that causes a JSX being removed
(`options.unmount` will be called)
- Second tick:
  - `runWithForce` is called
    - We set `options[DIFF]` to `diffRunWithForce` ✅
  - `render()`
- `options[DIFF]` would be called in the order of `diffRunWithForce` ->
`diffUnmount` -> `oldDiff`
- In `diffUnmount`, the `options[DIFF]` would be reset to `oldDiff` ❌
- But the `options[DIFFED]` is still overwritten. And the
`vnode[COMPONENT]` would be set to `undefined` for every following
`vnode`. **👈 This is what we are fixing in the patch**

https://github.com/lynx-family/lynx-stack/blob/0a616c9d22613666455e9e6e8660a8f5b481adcf/packages/react/runtime/src/lynx/runWithForce.ts#L35-L44
  - `runWithForce` ended
    - We set `options[DIFF]` to `diffUnmount` ❌

We are not addressing the value of `options[DIFF]` in this patch, as it
does not currently cause incorrect behavior. However, we are resolving
the `vnode[COMPONENT]` issue, as it leads to incorrect functionality in
hooks and diff operations.

<!-- It would be helpful if you could provide any relevant context, such
as GitHub issues or related discussions. -->

## Checklist

<!--- Check and mark with an "x" -->

- [ ] Tests updated (or not required).
- [ ] Documentation updated (or not required).
<!--
  Thank you for submitting a pull request!

We appreciate the time and effort you have invested in making these
changes. Please ensure that you provide enough information to allow
others to review your pull request.

Upon submission, your pull request will be automatically assigned with
reviewers.

If you want to learn more about contributing to this project, please
visit:
https://github.com/lynx-family/lynx-stack/blob/main/CONTRIBUTING.md.
-->

## Summary

<!-- Can you explain the reasoning behind implementing this change? What
problem or issue does this pull request resolve? -->

<!-- It would be helpful if you could provide any relevant context, such
as GitHub issues or related discussions. -->

add api docs of testing-environment and profile

## Checklist

<!--- Check and mark with an "x" -->

- [x] Tests updated (or not required).
- [x] Documentation updated (or not required).

---------

Signed-off-by: BitterGourd <91231822+gaoachao@users.noreply.github.com>
<!--
  Thank you for submitting a pull request!

We appreciate the time and effort you have invested in making these
changes. Please ensure that you provide enough information to allow
others to review your pull request.

Upon submission, your pull request will be automatically assigned with
reviewers.

If you want to learn more about contributing to this project, please
visit:
https://github.com/lynx-family/lynx-stack/blob/main/CONTRIBUTING.md.
-->

## Summary

<!-- Can you explain the reasoning behind implementing this change? What
problem or issue does this pull request resolve? -->

<!-- It would be helpful if you could provide any relevant context, such
as GitHub issues or related discussions. -->

Fix `https://lynxjs.org/react/react-lynx-testing-library.html` ->
`https://lynxjs.org/react/reactlynx-testing-library.html`

See also: lynx-family/lynx-website#154

## Checklist

<!--- Check and mark with an "x" -->

- [ ] Tests updated (or **not required**).
- [ ] Documentation updated (or **not required**).
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.108.0

### Minor Changes

- Reverts #239: "batch multiple patches for main thread communication"
([#649](#649))

This reverts the change that batched updates sent to the main thread in
a single render pass.

### Patch Changes

- Add support for batch rendering in `<list>` with async resolution of
sub-tree properties and element trees.
([#624](#624))

    Use the `experimental-batch-render-strategy` attribute of `<list>`:

    ```tsx
    <list
      /**
       * Batch render strategy:
       * 0: (Default) Disabled - No batch rendering
       * 1: Basic - Only batch rendering enabled
* 2: Property Resolution - Batch render with async property resolution
for list item subtree
* 3: Full Resolution - Batch render with async property and element tree
resolution for list item subtree
       */
      experimental-batch-render-strategy={3}
    ></list>
    ```

- rename @lynx-js/test-environment to @lynx-js/testing-environment
([#704](#704))

- Auto import `@lynx-js/react/experimental/lazy/import` when using
`import(url)`
([#667](#667))

- Auto import `@lynx-js/react/experimental/lazy/import` when using
`<component is={url} />`
([#666](#666))

- Fixed a race condition when updating states and GlobalProps
simultaneously.
([#707](#707))

This fix prevents the "Attempt to render more than one `<page />`" error
from occurring during normal application usage.

- Fix error like `Unterminated string constant` when using multi-line
JSX StringLiteral.
([#654](#654))

## @lynx-js/testing-environment@0.1.0

### Minor Changes

- Switch to ESM package format by setting `"type": "module"`.
([#703](#703))

### Patch Changes

- rename @lynx-js/test-environment to @lynx-js/testing-environment
([#704](#704))

## @lynx-js/web-platform-rsbuild-plugin@0.1.0

### Minor Changes

- feat: add new parameter `nativeModulesPath` to
`pluginWebPlatform({})`.
([#668](#668))

After this commit, you can use `nativeModulesPath` to package custom
nativeModules directly into the worker, and no longer need to pass
`nativeModulesMap` to lynx-view.

    Here is an example:

    -   `native-modules.ts`:

    ```ts
    // index.native-modules.ts
    export default {
      CustomModule: function (NativeModules, NativeModulesCall) {
        return {
          async getColor(data, callback) {
            const color = await NativeModulesCall("getColor", data);
            callback(color);
          },
        };
      },
    };
    ```

    -   plugin config:

    ```ts
    // rsbuild.config.ts
import { pluginWebPlatform } from
"@lynx-js/web-platform-rsbuild-plugin";
    import { defineConfig } from "@rsbuild/core";

    export default defineConfig({
      plugins: [
        pluginWebPlatform({
          // replace with your actual native-modules file path
nativeModulesPath: path.resolve(__dirname, "./index.native-modules.ts"),
        }),
      ],
    });
    ```

- feat: Provides Rsbuild plugin for Web projects in Lynx Web Platform,
currently supports polyfill about lynx.
([#606](#606))

## @lynx-js/rspeedy@0.9.4

### Patch Changes

- Bump Rsbuild v1.3.17 with Rspack v1.3.9.
([#708](#708))

- Support `performance.profile`.
([#691](#691))

- Support CLI flag `--mode` to specify the build mode.
([#723](#723))

- Enable native Rsdoctor plugin by default.
([#688](#688))

Set `tools.rsdoctor.experiments.enableNativePlugin` to `false` to use
the old JS plugin.

    ```js
    import { defineConfig } from "@lynx-js/rspeedy";

    export default defineConfig({
      tools: {
        rsdoctor: {
          experiments: {
            enableNativePlugin: false,
          },
        },
      },
    });
    ```

See [Rsdoctor -
1.0](https://rsdoctor.dev/blog/release/release-note-1_0#-faster-analysis)
for more details.

- Bump Rsbuild v1.3.14 with Rspack v1.3.8.
([#630](#630))

## @lynx-js/react-rsbuild-plugin@0.9.9

### Patch Changes

- Fix runtime error: "SyntaxError: Identifier 'i' has already been
declared". ([#651](#651))

- Enable runtime profiling when `performance.profile` is set to true.
([#722](#722))

- fix: resolve page crash on development mode when enabling
`experimental_isLazyBundle: true`
([#653](#653))

- Support `@lynx-js/react` v0.108.0.
([#649](#649))

- Updated dependencies
\[[`ea4da1a`](ea4da1a),
[`ca15dda`](ca15dda),
[`f8d369d`](f8d369d),
[`ea4da1a`](ea4da1a)]:
    -   @lynx-js/react-webpack-plugin@0.6.13
    -   @lynx-js/runtime-wrapper-webpack-plugin@0.0.10
    -   @lynx-js/react-alias-rsbuild-plugin@0.9.9
    -   @lynx-js/react-refresh-webpack-plugin@0.3.2

## @lynx-js/tailwind-preset@0.0.3

### Patch Changes

- Support `hidden`, `no-underline` and `line-through` utilities.
([#745](#745))

## @lynx-js/offscreen-document@0.0.2

### Patch Changes

- feat: support touch events
([#641](#641))

## @lynx-js/web-constants@0.13.1

### Patch Changes

- feat: support touch events for MTS
([#641](#641))

    now we support

    -   main-thread:bindtouchstart
    -   main-thread:bindtouchend
    -   main-thread:bindtouchmove
    -   main-thread:bindtouchcancel

-   Updated dependencies \[]:
    -   @lynx-js/web-worker-rpc@0.13.1

## @lynx-js/web-core@0.13.1

### Patch Changes

- fix: some inline style properties cause crash
([#647](#647))

    add support for the following css properties

    -   mask
    -   mask-repeat
    -   mask-position
    -   mask-clip
    -   mask-origin
    -   mask-size
    -   gap
    -   column-gap
    -   row-gap
    -   image-rendering
    -   hyphens
    -   offset-path
    -   offset-distance

- feat: support touch events for MTS
([#641](#641))

    now we support

    -   main-thread:bindtouchstart
    -   main-thread:bindtouchend
    -   main-thread:bindtouchmove
    -   main-thread:bindtouchcancel

- feat: add SystemInfo.screenWidth and SystemInfo.screenHeight
([#641](#641))

- Updated dependencies
\[[`c9ccad6`](c9ccad6),
[`9ad394e`](9ad394e),
[`f4cfb70`](f4cfb70),
[`c9ccad6`](c9ccad6),
[`839d61c`](839d61c)]:
    -   @lynx-js/offscreen-document@0.0.2
    -   @lynx-js/web-mainthread-apis@0.13.1
    -   @lynx-js/web-worker-runtime@0.13.1
    -   @lynx-js/web-constants@0.13.1
    -   @lynx-js/web-worker-rpc@0.13.1

## @lynx-js/web-elements@0.7.1

### Patch Changes

- fix(web): x-swiper-item threshold updated to 20
([#639](#639))

- fix: In React19, setter and getter functions are treated as
properties, making it impossible to retrieve the current value via
attributes. ([#639](#639))

## @lynx-js/web-explorer@0.0.7

### Patch Changes

- feat: use nativeModulesPath instead of nativeModulesMap to lynx-view.
([#668](#668))

- fix: fork @vant/touch-emulator and make it work with shadowroot
([#662](#662))

- fix: loading errors caused by script import order
([#665](#665))

- chore: update homepage
([#645](#645))

## @lynx-js/web-mainthread-apis@0.13.1

### Patch Changes

- fix: some inline style properties cause crash
([#647](#647))

    add support for the following css properties

    -   mask
    -   mask-repeat
    -   mask-position
    -   mask-clip
    -   mask-origin
    -   mask-size
    -   gap
    -   column-gap
    -   row-gap
    -   image-rendering
    -   hyphens
    -   offset-path
    -   offset-distance

- feat: support touch events for MTS
([#641](#641))

    now we support

    -   main-thread:bindtouchstart
    -   main-thread:bindtouchend
    -   main-thread:bindtouchmove
    -   main-thread:bindtouchcancel

- Updated dependencies
\[[`c9ccad6`](c9ccad6)]:
    -   @lynx-js/web-constants@0.13.1

## @lynx-js/web-worker-runtime@0.13.1

### Patch Changes

- feat: support for using `lynx.queueMicrotask`.
([#702](#702))

- feat: support touch events for MTS
([#641](#641))

    now we support

    -   main-thread:bindtouchstart
    -   main-thread:bindtouchend
    -   main-thread:bindtouchmove
    -   main-thread:bindtouchcancel

- feat: provide comments for `@lynx-js/web-platform-rsbuild-plugin`.
([#668](#668))

- Updated dependencies
\[[`c9ccad6`](c9ccad6),
[`9ad394e`](9ad394e),
[`c9ccad6`](c9ccad6)]:
    -   @lynx-js/offscreen-document@0.0.2
    -   @lynx-js/web-mainthread-apis@0.13.1
    -   @lynx-js/web-constants@0.13.1
    -   @lynx-js/web-worker-rpc@0.13.1

## @lynx-js/react-webpack-plugin@0.6.13

### Patch Changes

- feat: add `experimental_isLazyBundle` option, it will disable snapshot
HMR for standalone lazy bundle
([#653](#653))

- Add the `profile` option to control whether `__PROFILE__` is enabled.
([#722](#722))

- Support `@lynx-js/react` v0.108.0.
([#649](#649))

## @lynx-js/runtime-wrapper-webpack-plugin@0.0.10

### Patch Changes

- feat: add `experimental_isLazyBundle` option, it will disable
lynxChunkEntries for standalone lazy bundle
([#653](#653))

## create-rspeedy@0.9.4



## @lynx-js/react-alias-rsbuild-plugin@0.9.9



## upgrade-rspeedy@0.9.4



## @lynx-js/web-worker-rpc@0.13.1

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
<!--
  Thank you for submitting a pull request!

We appreciate the time and effort you have invested in making these
changes. Please ensure that you provide enough information to allow
others to review your pull request.

Upon submission, your pull request will be automatically assigned with
reviewers.

If you want to learn more about contributing to this project, please
visit:
https://github.com/lynx-family/lynx-stack/blob/main/CONTRIBUTING.md.
-->

## Summary

<!-- Can you explain the reasoning behind implementing this change? What
problem or issue does this pull request resolve? -->

<!-- It would be helpful if you could provide any relevant context, such
as GitHub issues or related discussions. -->

## Checklist

<!--- Check and mark with an "x" -->

- [ ] Tests updated (or not required).
- [ ] Documentation updated (or not required).

Signed-off-by: Qingyu Wang <40660121+colinaaa@users.noreply.github.com>
@pull pull bot requested a review from PupilTong as a code owner May 9, 2025 14:53
@pull pull bot added the ⤵️ pull label May 9, 2025
@pull pull bot merged commit a68d104 into PupilTong:main May 9, 2025
pull bot pushed a commit that referenced this pull request Jan 4, 2026
<!--
  Thank you for submitting a pull request!

We appreciate the time and effort you have invested in making these
changes. Please ensure that you provide enough information to allow
others to review your pull request.

Upon submission, your pull request will be automatically assigned with
reviewers.

If you want to learn more about contributing to this project, please
visit:
https://github.com/lynx-family/lynx-stack/blob/main/CONTRIBUTING.md.
-->

<!-- The AI summary below will be auto-generated - feel free to replace
it with your own. -->

Solves lynx-family#2045

An example log from our examples/react package is as below.

First screen:

<details>

```log
[BackgroundThread Component Render] name: Fragment, uniqID: undefined, __id: undefined
main-thread.js:3421 [ReactLynxDebug] FiberElement API call #1: __CreatePage("0", 0) => page#10
main-thread.js:3421 [ReactLynxDebug] FiberElement API call #2: __GetElementUniqueID(page#10) => 10
main-thread.js:3421 [ReactLynxDebug] FiberElement API call #3: __SetCSSId([page#10], 0)
main-thread.js:3460 [MainThread Component Render] name: App
main-thread.js:3421 [ReactLynxDebug] FiberElement API call #4: __CreateView(10) => view#11
main-thread.js:3421 [ReactLynxDebug] FiberElement API call #5: __CreateView(10) => view#12
main-thread.js:3421 [ReactLynxDebug] FiberElement API call #6: __SetClasses(view#12, "Background")
main-thread.js:3421 [ReactLynxDebug] FiberElement API call #7: __AppendElement(view#11, view#12) => view#12
main-thread.js:3421 [ReactLynxDebug] FiberElement API call #8: __CreateView(10) => view#13
main-thread.js:3421 [ReactLynxDebug] FiberElement API call #9: __SetClasses(view#13, "App")
main-thread.js:3421 [ReactLynxDebug] FiberElement API call #10: __AppendElement(view#11, view#13) => view#13
main-thread.js:3421 [ReactLynxDebug] FiberElement API call #11: __CreateView(10) => view#14
main-thread.js:3421 [ReactLynxDebug] FiberElement API call #12: __SetClasses(view#14, "Banner")
main-thread.js:3421 [ReactLynxDebug] FiberElement API call #13: __AppendElement(view#13, view#14) => view#14
main-thread.js:3421 [ReactLynxDebug] FiberElement API call #14: __CreateWrapperElement(10) => wrapper#15
main-thread.js:3421 [ReactLynxDebug] FiberElement API call #15: __AppendElement(view#14, wrapper#15) => wrapper#15
main-thread.js:3421 [ReactLynxDebug] FiberElement API call #16: __CreateText(10) => text#16
main-thread.js:3421 [ReactLynxDebug] FiberElement API call #17: __SetClasses(text#16, "Title")
main-thread.js:3421 [ReactLynxDebug] FiberElement API call #18: __SetAttribute(text#16, "text", "React")
main-thread.js:3421 [ReactLynxDebug] FiberElement API call #19: __AppendElement(view#14, text#16) => text#16
main-thread.js:3421 [ReactLynxDebug] FiberElement API call #20: __CreateText(10) => text#17
main-thread.js:3421 [ReactLynxDebug] FiberElement API call #21: __SetClasses(text#17, "Subtitle")
main-thread.js:3421 [ReactLynxDebug] FiberElement API call #22: __SetAttribute(text#17, "text", "on Lynx")
main-thread.js:3421 [ReactLynxDebug] FiberElement API call #23: __AppendElement(view#14, text#17) => text#17
main-thread.js:3421 [ReactLynxDebug] FiberElement API call #24: __CreateView(10) => view#18
main-thread.js:3421 [ReactLynxDebug] FiberElement API call #25: __SetClasses(view#18, "Content")
main-thread.js:3421 [ReactLynxDebug] FiberElement API call #26: __AppendElement(view#13, view#18) => view#18
main-thread.js:3421 [ReactLynxDebug] FiberElement API call #27: __CreateImage(10) => image#19
main-thread.js:3421 [ReactLynxDebug] FiberElement API call #28: __SetClasses(image#19, "Arrow")
main-thread.js:3421 [ReactLynxDebug] FiberElement API call #29: __AppendElement(view#18, image#19) => image#19
main-thread.js:3421 [ReactLynxDebug] FiberElement API call #30: __CreateText(10) => text#20
main-thread.js:3421 [ReactLynxDebug] FiberElement API call #31: __SetClasses(text#20, "Description")
main-thread.js:3421 [ReactLynxDebug] FiberElement API call #32: __SetAttribute(text#20, "text", "Tap the logo and have fun!")
main-thread.js:3421 [ReactLynxDebug] FiberElement API call #33: __AppendElement(view#18, text#20) => text#20
main-thread.js:3421 [ReactLynxDebug] FiberElement API call #34: __CreateText(10) => text#21
main-thread.js:3421 [ReactLynxDebug] FiberElement API call #35: __SetClasses(text#21, "Hint")
main-thread.js:3421 [ReactLynxDebug] FiberElement API call #36: __AppendElement(view#18, text#21) => text#21
main-thread.js:3421 [ReactLynxDebug] FiberElement API call #37: __CreateRawText("Edit") => raw-text#22
main-thread.js:3421 [ReactLynxDebug] FiberElement API call #38: __AppendElement(text#21, raw-text#22) => raw-text#22
main-thread.js:3421 [ReactLynxDebug] FiberElement API call #39: __CreateWrapperElement(10) => wrapper#23
main-thread.js:3421 [ReactLynxDebug] FiberElement API call #40: __AppendElement(text#21, wrapper#23) => wrapper#23
main-thread.js:3421 [ReactLynxDebug] FiberElement API call #41: __CreateRawText("to see updates!") => raw-text#24
main-thread.js:3421 [ReactLynxDebug] FiberElement API call #42: __AppendElement(text#21, raw-text#24) => raw-text#24
main-thread.js:3421 [ReactLynxDebug] FiberElement API call #43: __CreateView(10) => view#25
main-thread.js:3421 [ReactLynxDebug] FiberElement API call #44: __SetInlineStyles(view#25, "flex:1")
main-thread.js:3421 [ReactLynxDebug] FiberElement API call #45: __AppendElement(view#13, view#25) => view#25
main-thread.js:3421 [ReactLynxDebug] FiberElement API call #46: __AppendElement(page#10, view#11) => view#11
main-thread.js:3421 [ReactLynxDebug] FiberElement API call #47: __SetAttribute(image#19, "src", "http://1.1.1.1:3000/static/image/arrow.aee54ba7.png")
main-thread.js:3421 [ReactLynxDebug] FiberElement API call #48: __CreateView(10) => view#26
main-thread.js:3421 [ReactLynxDebug] FiberElement API call #49: __SetClasses(view#26, "Logo")
main-thread.js:3421 [ReactLynxDebug] FiberElement API call #50: __ReplaceElement(view#26, wrapper#15)
main-thread.js:3421 [ReactLynxDebug] FiberElement API call #51: __AddEvent(view#26, "bindEvent", "tap", "-3:0:")
main-thread.js:3421 [ReactLynxDebug] FiberElement API call #52: __CreateImage(10) => image#27
main-thread.js:3421 [ReactLynxDebug] FiberElement API call #53: __SetClasses(image#27, "Logo--lynx")
main-thread.js:3421 [ReactLynxDebug] FiberElement API call #54: __AppendElement(view#26, image#27) => image#27
main-thread.js:3421 [ReactLynxDebug] FiberElement API call #55: __SetAttribute(image#27, "src", "http://1.1.1.1:3000/static/image/lynx-logo.620eb8d1.png")
main-thread.js:3421 [ReactLynxDebug] FiberElement API call #56: __CreateText(10) => text#28
main-thread.js:3421 [ReactLynxDebug] FiberElement API call #57: __SetInlineStyles(text#28, "font-style:italic;color:rgba(255, 255, 255, 0.85)")
main-thread.js:3421 [ReactLynxDebug] FiberElement API call #58: __ReplaceElement(text#28, wrapper#23)
main-thread.js:3421 [ReactLynxDebug] FiberElement API call #59: __CreateRawText("") => raw-text#29
main-thread.js:3421 [ReactLynxDebug] FiberElement API call #60: __SetAttribute(raw-text#29, "text", " src/App.tsx ")
main-thread.js:3421 [ReactLynxDebug] FiberElement API call #61: __AppendElement(text#28, raw-text#29) => raw-text#29
main-thread.js:3421 [ReactLynxDebug] FiberElement API call #62: __OnLifecycleEvent(["rLynxFirstScreen", {"root":"{\"id\":-1,\"type\":\"root\",\"children\":[{\"id\":-5,\"type\":\"__snapshot_835da_b8ae7_1\",\"values\":[\"http://1.1.1.1:3000/static/image/arrow.aee54ba7.png\"],\"children\":[{\"id\":-3,\"type\":\"__snapshot_835da_b8ae7_2\",\"values\":[\"-3:0:\"],\"children\":[{\"id\":-2,\"type\":\"__snapshot_835da_b8ae7_4\",\"values\":[\"http://1.1.1.1:3000/static/image/lynx-logo.620eb8d1.png\"]}]},{\"id\":-4,\"type\":\"__snapshot_835da_b8ae7_5\",\"children\":[{\"id\":-6,\"type\":null,\"values\":[\" src/App.tsx \"]}]}]}]}","jsReadyEventIdSwap":{}}])
background.js:11351 [rspeedy-dev-server] Server started: Hot Module Replacement enabled, Live Reloading enabled, Progress disabled, Overlay disabled.
background.js:3564 [HMR] Waiting for update signal from WDS...
background.js:4476 [BackgroundThread Component Render] name: App, uniqID: __snapshot_835da_b8ae7_1, __id: 2
background.js:4476 [BackgroundThread Component Render] name: Fragment, uniqID: __snapshot_835da_b8ae7_1, __id: 2
background.js:214 Hello, ReactLynx
background.js:8011 [ReactLynxDebug] MTS -> BTS OnLifecycleEvent:
{
  "root": {
    "id": -1,
    "type": "root",
    "children": [
      {
        "id": -5,
        "type": "__snapshot_835da_b8ae7_1",
        "values": [
          "http://1.1.1.1:3000/static/image/arrow.aee54ba7.png"
        ],
        "children": [
          {
            "id": -3,
            "type": "__snapshot_835da_b8ae7_2",
            "values": [
              "-3:0:"
            ],
            "children": [
              {
                "id": -2,
                "type": "__snapshot_835da_b8ae7_4",
                "values": [
                  "http://1.1.1.1:3000/static/image/lynx-logo.620eb8d1.png"
                ]
              }
            ]
          },
          {
            "id": -4,
            "type": "__snapshot_835da_b8ae7_5",
            "children": [
              {
                "id": -6,
                "type": null,
                "values": [
                  " src/App.tsx "
                ]
              }
            ]
          }
        ]
      }
    ]
  },
  "jsReadyEventIdSwap": {}
}
main-thread.js:5801 [ReactLynxDebug] BTS -> MTS updateMainThread:
{
  "data": {
    "patchList": [
      {
        "snapshotPatch": [],
        "id": 2
      }
    ]
  },
  "patchOptions": {
    "isHydration": true,
    "reloadVersion": 0,
    "pipelineOptions": {
      "pipelineID": "0x16c567000_29",
      "needTimestamps": true,
      "pipelineOrigin": "reactLynxHydrate",
      "dsl": "reactLynx",
      "stage": "hydrate"
    }
  }
}
main-thread.js:3421 [ReactLynxDebug] FiberElement API call #63: __FlushElementTree(page#10, {"pipelineOptions":{"pipelineID":"0x16c567000_29","needTimestamps":true,"pipelineOrigin":"reactLynxHydrate","dsl":"reactLynx","stage":"hydrate"}})

```

</details>

Next update:

<details>

```log
[BackgroundThread Component Render] name: App, uniqID: __snapshot_835da_b8ae7_1, __id: -5
main-thread.js:5801 [ReactLynxDebug] BTS -> MTS updateMainThread:
{
  "data": {
    "patchList": [
      {
        "id": 3,
        "snapshotPatch": [
          {
            "op": "RemoveChild",
            "parentId": -3,
            "childId": -2
          },
          {
            "op": "CreateElement",
            "type": "__snapshot_835da_b8ae7_3",
            "id": 7
          },
          {
            "op": "SetAttributes",
            "id": 7,
            "values": [
              "http://1.1.1.1:3000/static/image/react-logo.75eb3837.png"
            ]
          },
          {
            "op": "InsertBefore",
            "parentId": -3,
            "childId": 7,
            "beforeId": null
          }
        ]
      }
    ]
  },
  "patchOptions": {
    "reloadVersion": 0,
    "pipelineOptions": {
      "pipelineID": "0x16c567000_30",
      "needTimestamps": false,
      "pipelineOrigin": "updateTriggeredByBts",
      "dsl": "reactLynx",
      "stage": "update"
    }
  }
}
main-thread.js:3421 [ReactLynxDebug] FiberElement API call #64: __RemoveElement(view#26, image#27) => image#27
main-thread.js:3421 [ReactLynxDebug] FiberElement API call #65: __CreateImage(10) => image#30
main-thread.js:3421 [ReactLynxDebug] FiberElement API call #66: __SetClasses(image#30, "Logo--react")
main-thread.js:3421 [ReactLynxDebug] FiberElement API call #67: __SetAttribute(image#30, "src", "http://1.1.1.1:3000/static/image/react-logo.75eb3837.png")
main-thread.js:3421 [ReactLynxDebug] FiberElement API call #68: __AppendElement(view#26, image#30) => image#30
main-thread.js:3421 [ReactLynxDebug] FiberElement API call #69: __FlushElementTree(page#10, {"pipelineOptions":{"pipelineID":"0x16c567000_30","needTimestamps":false,"pipelineOrigin":"updateTriggeredByBts","dsl":"reactLynx","stage":"update"}})
```

</details>

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **New Features**
* Enhanced debug logging: structured, dual-thread API-call, lifecycle
and hydration traces when debug mode is enabled.
* **Tests**
* Added and expanded tests and snapshots to validate richer logging,
API-call sequences, and hydration traces.
* **Chores**
* Development-only error messages now include a troubleshooting hint
recommending the debug-mode option for easier diagnosis.

<sub>✏️ Tip: You can customize this high-level summary in your review
settings.</sub>
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

## Checklist

<!--- Check and mark with an "x" -->

- [x] Tests updated (or not required).
- [ ] Documentation updated (or not required).
- [x] Changeset added, and when a BREAKING CHANGE occurs, it needs to be
clearly marked (or not required).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants