Skip to content

fix(web): web-explorer needs to actively send an iframeReady message …#2001

Merged
Sherry-hue merged 1 commit intolynx-family:mainfrom
Sherry-hue:fix/web-explorer-load
Dec 17, 2025
Merged

fix(web): web-explorer needs to actively send an iframeReady message …#2001
Sherry-hue merged 1 commit intolynx-family:mainfrom
Sherry-hue:fix/web-explorer-load

Conversation

@Sherry-hue
Copy link
Copy Markdown
Collaborator

@Sherry-hue Sherry-hue commented Dec 17, 2025

…to the parent

Summary by CodeRabbit

  • Bug Fixes
    • Resolved an issue where the iframe readiness signal was not consistently reaching the parent window, improving initialization reliability.

✏️ Tip: You can customize this high-level summary in your review settings.

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).
  • Changeset added, and when a BREAKING CHANGE occurs, it needs to be clearly marked (or not required).

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Dec 17, 2025

🦋 Changeset detected

Latest commit: 7a98269

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@lynx-js/web-explorer Patch

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

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Dec 17, 2025

📝 Walkthrough

Walkthrough

This PR adds a patch release for @lynx-js/web-explorer that implements an iframe-to-parent readiness handshake. The iframe now actively sends an "iframeReady" message with its iframeId to the parent window, ensuring reliable notification of iframe readiness independent of the parent's load event listeners.

Changes

Cohort / File(s) Change Summary
Release metadata
\.changeset/few-rats-doubt\.md
Adds patch release entry documenting the fix for iframe readiness messaging.
Web explorer initialization
packages/web-platform/web-explorer/index\.ts
Extracts iframeId from URL query parameters and sends an "iframeReady" postMessage to parent window to signal iframe readiness.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

  • Focus on verifying that the iframeId extraction from URLSearchParams is correct and defensive against missing query parameters
  • Confirm the postMessage payload structure ({ method: 'iframeReady', iframeId }) aligns with parent window listener expectations
  • Verify that sending to target origin '*' is appropriate for this use case

Possibly related PRs

Suggested reviewers

  • PupilTong

Poem

🐰 A tiny iframe hops up tall,
"I'm ready!" it cries down the hall,
No waiting for parents to guess,
Just sends a message—nothing less!
The handshake complete, all is well.

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'fix(web): web-explorer needs to actively send an iframeReady message' directly and clearly describes the main change in the PR, matching the core objective of adding active iframeReady message sending.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 27dea6e and 7a98269.

📒 Files selected for processing (2)
  • .changeset/few-rats-doubt.md (1 hunks)
  • packages/web-platform/web-explorer/index.ts (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
.changeset/*.md

📄 CodeRabbit inference engine (AGENTS.md)

For contributions, generate and commit a Changeset describing your changes

Files:

  • .changeset/few-rats-doubt.md
🧠 Learnings (5)
📓 Common learnings
Learnt from: colinaaa
Repo: lynx-family/lynx-stack PR: 1454
File: pnpm-workspace.yaml:46-46
Timestamp: 2025-08-07T04:00:59.645Z
Learning: In the lynx-family/lynx-stack repository, the webpack patch (patches/webpack5.101.0.patch) was created to fix issues with webpack5.99.9 but only takes effect on webpack5.100.0 and later versions. The patchedDependencies entry should use "webpack@^5.100.0" to ensure the patch applies to the correct version range.
📚 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/few-rats-doubt.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/few-rats-doubt.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/few-rats-doubt.md
📚 Learning: 2025-08-07T04:00:59.645Z
Learnt from: colinaaa
Repo: lynx-family/lynx-stack PR: 1454
File: pnpm-workspace.yaml:46-46
Timestamp: 2025-08-07T04:00:59.645Z
Learning: In the lynx-family/lynx-stack repository, the webpack patch (patches/webpack5.101.0.patch) was created to fix issues with webpack5.99.9 but only takes effect on webpack5.100.0 and later versions. The patchedDependencies entry should use "webpack@^5.100.0" to ensure the patch applies to the correct version range.

Applied to files:

  • .changeset/few-rats-doubt.md
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: build / Build (Windows)
  • GitHub Check: test-rust / Test (Ubuntu)
🔇 Additional comments (2)
.changeset/few-rats-doubt.md (1)

1-5: Changeset looks good.

The changeset correctly documents this bugfix as a patch release with a clear description of the race condition being addressed.

packages/web-platform/web-explorer/index.ts (1)

44-44: Verify handling of null iframeId in parent window.

When the iframeId query parameter is not present, URLSearchParams.get() returns null. The iframe sends this null value in the iframeReady message to the parent window. Since the parent window code that receives this message is not found in this repository, verify that the parent correctly handles receiving iframeId: null in the message payload and does not break when this value is null.

@codecov
Copy link
Copy Markdown

codecov bot commented Dec 17, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq bot commented Dec 17, 2025

CodSpeed Performance Report

Merging #2001 will improve performance by 8.14%

Comparing Sherry-hue:fix/web-explorer-load (7a98269) with main (27dea6e)

Summary

⚡ 2 improvements
✅ 61 untouched
⏩ 3 skipped1

Benchmarks breakdown

Benchmark BASE HEAD Efficiency
basic-performance-nest-level-100 6.7 ms 6.2 ms +8.14%
transform 1000 view elements 46.9 ms 43.6 ms +7.58%

Footnotes

  1. 3 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@relativeci
Copy link
Copy Markdown

relativeci bot commented Dec 17, 2025

React Example

#6489 Bundle Size — 236.9KiB (0%).

7a98269(current) vs 27dea6e main#6487(baseline)

Bundle metrics  no changes
                 Current
#6489
     Baseline
#6487
No change  Initial JS 0B 0B
No change  Initial CSS 0B 0B
No change  Cache Invalidation 0% 0%
No change  Chunks 0 0
No change  Assets 4 4
No change  Modules 162 162
No change  Duplicate Modules 65 65
No change  Duplicate Code 46.74% 46.74%
No change  Packages 2 2
No change  Duplicate Packages 0 0
Bundle size by type  no changes
                 Current
#6489
     Baseline
#6487
No change  IMG 145.76KiB 145.76KiB
No change  Other 91.14KiB 91.14KiB

Bundle analysis reportBranch Sherry-hue:fix/web-explorer-loadProject dashboard


Generated by RelativeCIDocumentationReport issue

@relativeci
Copy link
Copy Markdown

relativeci bot commented Dec 17, 2025

Web Explorer

#6649 Bundle Size — 372.63KiB (+0.03%).

7a98269(current) vs 27dea6e main#6647(baseline)

Bundle metrics  Change 2 changes Regression 1 regression
                 Current
#6649
     Baseline
#6647
Regression  Initial JS 146.36KiB(+0.09%) 146.23KiB
No change  Initial CSS 32.4KiB 32.4KiB
Change  Cache Invalidation 39.26% 39.25%
No change  Chunks 8 8
No change  Assets 8 8
No change  Modules 230 230
No change  Duplicate Modules 16 16
No change  Duplicate Code 2.97% 2.97%
No change  Packages 4 4
No change  Duplicate Packages 0 0
Bundle size by type  Change 1 change Regression 1 regression
                 Current
#6649
     Baseline
#6647
Regression  JS 243.25KiB (+0.05%) 243.12KiB
No change  Other 96.98KiB 96.98KiB
No change  CSS 32.4KiB 32.4KiB

Bundle analysis reportBranch Sherry-hue:fix/web-explorer-loadProject dashboard


Generated by RelativeCIDocumentationReport issue

@Sherry-hue Sherry-hue merged commit 3a9a730 into lynx-family:main Dec 17, 2025
81 of 85 checks passed
f0rdream pushed a commit to f0rdream/lynx-stack that referenced this pull request Dec 18, 2025
lynx-family#2001)

…to the parent

<!--
  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. -->

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

* **Bug Fixes**
* Resolved an issue where the iframe readiness signal was not
consistently reaching the parent window, improving initialization
reliability.

<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" -->

- [ ] Tests updated (or not required).
- [ ] Documentation updated (or not required).
- [ ] Changeset added, and when a BREAKING CHANGE occurs, it needs to be
clearly marked (or not required).
colinaaa pushed a commit that referenced this pull request Dec 22, 2025
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/gesture-runtime@2.1.0

### Minor Changes

- Initialize `'@lynx-js/gesture-runtime`
([#1984](#1984))

## @lynx-js/rspeedy@0.12.3

### Patch Changes

- Support environment variants to enable multiple configurations for the
same targets.
([#1969](#1969))

-   Updated dependencies \[]:
    -   @lynx-js/web-rsbuild-server-middleware@0.19.2

## @lynx-js/lynx-bundle-rslib-config@0.0.2

### Patch Changes

- Introduce `@lynx-js/externals-loading-webpack-plugin`. It will help
you to load externals built by `@lynx-js/lynx-bundle-rslib-config`.
([#1924](#1924))

    ```js
    // webpack.config.js
import { ExternalsLoadingPlugin } from
"@lynx-js/externals-loading-webpack-plugin";

    export default {
      plugins: [
        new ExternalsLoadingPlugin({
          mainThreadLayer: "main-thread",
          backgroundLayer: "background",
          externals: {
            lodash: {
              url: "http://lodash.lynx.bundle",
              background: { sectionPath: "background" },
              mainThread: { sectionPath: "main-thread" },
            },
          },
        }),
      ],
    };
    ```

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

### Patch Changes

- Support environment variants to enable multiple configurations for the
same targets.
([#1969](#1969))

-   Updated dependencies \[]:
    -   @lynx-js/react-alias-rsbuild-plugin@0.12.2

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

### Patch Changes

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

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

### Patch Changes

- chore: mark the "multi-thread" deprecated
([#2030](#2030))

    **NOTICE This will be a breaking change in the future**

    mark the thread strategy "multi-thread" as deprecated.

Please use "all-on-ui" instead. If you still want to use multi-thread
mode, please try to use a cross-origin isolated iframe.

A console warning will be printed if `thread-strategy` is set to
`multi-thread`.

- fix csp issue for mts realm
([#1998](#1998))

-   Updated dependencies \[]:
    -   @lynx-js/web-constants@0.19.2
    -   @lynx-js/web-mainthread-apis@0.19.2
    -   @lynx-js/web-worker-rpc@0.19.2
    -   @lynx-js/web-worker-runtime@0.19.2

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

### Patch Changes

- fix: web-explorer needs to actively send an iframeReady message to the
parent, the parent uses `iframe load` listener cannot guarantee that the
`message-listener` will complete execution.
([#2001](#2001))

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

### Patch Changes

-   Updated dependencies \[]:
    -   @lynx-js/web-constants@0.19.2

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

### Patch Changes

-   Updated dependencies \[]:
    -   @lynx-js/web-constants@0.19.2
    -   @lynx-js/web-mainthread-apis@0.19.2
    -   @lynx-js/web-worker-rpc@0.19.2

## @lynx-js/externals-loading-webpack-plugin@0.0.1

### Patch Changes

- Introduce `@lynx-js/externals-loading-webpack-plugin`. It will help
you to load externals built by `@lynx-js/lynx-bundle-rslib-config`.
([#1924](#1924))

    ```js
    // webpack.config.js
import { ExternalsLoadingPlugin } from
"@lynx-js/externals-loading-webpack-plugin";

    export default {
      plugins: [
        new ExternalsLoadingPlugin({
          mainThreadLayer: "main-thread",
          backgroundLayer: "background",
          externals: {
            lodash: {
              url: "http://lodash.lynx.bundle",
              background: { sectionPath: "background" },
              mainThread: { sectionPath: "main-thread" },
            },
          },
        }),
      ],
    };
    ```

## create-rspeedy@0.12.3



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



## upgrade-rspeedy@0.12.3



## @lynx-js/web-core-server@0.19.2



## @lynx-js/web-rsbuild-server-middleware@0.19.2



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

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants