Skip to content

fix(web-core): hide XMLHttpRequest from bts chunks#2580

Merged
PupilTong merged 1 commit into
lynx-family:mainfrom
PupilTong:codex/comment-out-bts-xhr
May 11, 2026
Merged

fix(web-core): hide XMLHttpRequest from bts chunks#2580
PupilTong merged 1 commit into
lynx-family:mainfrom
PupilTong:codex/comment-out-bts-xhr

Conversation

@PupilTong
Copy link
Copy Markdown
Collaborator

@PupilTong PupilTong commented May 8, 2026

Summary

  • comment out XMLHttpRequest injection for BTS chunk initialization
  • keep the BTS chunk type signature aligned
  • add an empty changeset

Tests

  • git diff --check
  • pnpm dprint fmt packages/web-platform/web-core/ts/client/background/background-apis/createChunkLoading.ts packages/web-platform/web-core/ts/types/BTSChunk.ts .changeset/comment-out-bts-xhr.md (fails: local dprint binary is unavailable; node_modules/.bin/dprint does not exist)

Summary by CodeRabbit

  • Refactor
    • Removed a legacy global injection from the dynamic module loader so dynamically loaded modules no longer receive that injected global. This simplifies internal module wiring and type signatures but does not change page loading or any user-visible behavior.

@PupilTong PupilTong requested a review from Sherry-hue as a code owner May 8, 2026 09:39
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 8, 2026

🦋 Changeset detected

Latest commit: dd94fd2

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

This PR includes changesets to release 0 packages

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

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 May 8, 2026

Review Change Stack
No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: cfb6165e-a1df-480b-9b54-4703253e8536

📥 Commits

Reviewing files that changed from the base of the PR and between c899f2a and dd94fd2.

📒 Files selected for processing (3)
  • .changeset/comment-out-bts-xhr.md
  • packages/web-platform/web-core/ts/client/background/background-apis/createChunkLoading.ts
  • packages/web-platform/web-core/ts/types/BTSChunk.ts
✅ Files skipped from review due to trivial changes (1)
  • .changeset/comment-out-bts-xhr.md
🚧 Files skipped from review as they are similar to previous changes (2)
  • packages/web-platform/web-core/ts/types/BTSChunk.ts
  • packages/web-platform/web-core/ts/client/background/background-apis/createChunkLoading.ts

📝 Walkthrough

Walkthrough

XMLHttpRequest was removed from the BTS chunk entry API and from the chunk loader's injected globals: the BTSChunkEntry callable signature no longer lists XMLHttpRequest, the new Function(...) parameter list no longer includes it, and the initializer call no longer passes tt.XMLHttpRequest. A changeset file was updated (now empty).

Changes

XMLHttpRequest Removal from Chunk Initialization

Layer / File(s) Summary
Type Contract
packages/web-platform/web-core/ts/types/BTSChunk.ts
BTSChunkEntry callable type removes XMLHttpRequest: unknown from its parameter list.
Chunk Initialization Implementation
packages/web-platform/web-core/ts/client/background/background-apis/createChunkLoading.ts
Chunk loader stops injecting XMLHttpRequest into new Function(...) parameters and stops passing tt.XMLHttpRequest into the chunk initializer call.
Changeset
.changeset/comment-out-bts-xhr.md
Changeset Markdown now contains only two blank lines (no frontmatter/body).

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested reviewers

  • Sherry-hue

Poem

🐰 I nibbled at globals, one by one,
XMLHttpRequest now on the run,
Type trimmed neat, loader light and spry,
Chunks hop onward, catching sky,
A tiny hop — the change is done.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ 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%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately and specifically describes the main change: commenting out XMLHttpRequest from BTS chunk initialization to hide it from chunks.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
.changeset/comment-out-bts-xhr.md (1)

1-3: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Changeset file is missing required metadata and description.

The changeset file contains only empty frontmatter delimiters with no content. This means:

  • No packages will be versioned/bumped
  • No changelog entry will be generated for this change
  • The change won't be properly tracked in release notes

The frontmatter should specify which packages are affected and the bump type (patch/minor/major), and the body should describe the change for end users.

📝 Proposed fix: Add proper changeset content
 ---
+"@lynx/web-core": patch
 ---
-
+
+Remove XMLHttpRequest injection from BTS chunk initialization to improve compatibility.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.changeset/comment-out-bts-xhr.md around lines 1 - 3, The changeset file
.changeset/comment-out-bts-xhr.md contains only empty frontmatter delimiters
('---') and no metadata or description; update this file by adding proper
frontmatter that lists the affected package(s) and the version bump type
(patch/minor/major) and a short body description of the change for end users so
the package will be versioned and a changelog entry generated. Locate the file
by name and replace the empty frontmatter with YAML keys (e.g., the package
name(s) and bump type) and add a concise human-readable summary below the
frontmatter describing what was changed.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In @.changeset/comment-out-bts-xhr.md:
- Around line 1-3: The changeset file .changeset/comment-out-bts-xhr.md contains
only empty frontmatter delimiters ('---') and no metadata or description; update
this file by adding proper frontmatter that lists the affected package(s) and
the version bump type (patch/minor/major) and a short body description of the
change for end users so the package will be versioned and a changelog entry
generated. Locate the file by name and replace the empty frontmatter with YAML
keys (e.g., the package name(s) and bump type) and add a concise human-readable
summary below the frontmatter describing what was changed.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: c032664f-00d5-4922-a8d8-c7ae567fb6ab

📥 Commits

Reviewing files that changed from the base of the PR and between 736ba38 and ec6dfc7.

📒 Files selected for processing (3)
  • .changeset/comment-out-bts-xhr.md
  • packages/web-platform/web-core/ts/client/background/background-apis/createChunkLoading.ts
  • packages/web-platform/web-core/ts/types/BTSChunk.ts

@PupilTong PupilTong force-pushed the codex/comment-out-bts-xhr branch from ec6dfc7 to 6b445fa Compare May 8, 2026 10:33
@codecov
Copy link
Copy Markdown

codecov Bot commented May 8, 2026

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 May 8, 2026

Merging this PR will not alter performance

✅ 81 untouched benchmarks
⏩ 26 skipped benchmarks1


Comparing PupilTong:codex/comment-out-bts-xhr (dd94fd2) with main (5b6a33d)

Open in CodSpeed

Footnotes

  1. 26 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 May 8, 2026

React External

#1104 Bundle Size — 690.27KiB (0%).

dd94fd2(current) vs 4b27356 main#1100(baseline)

Bundle metrics  no changes
                 Current
#1104
     Baseline
#1100
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 3 3
No change  Modules 17 17
No change  Duplicate Modules 5 5
No change  Duplicate Code 8.59% 8.59%
No change  Packages 0 0
No change  Duplicate Packages 0 0
Bundle size by type  no changes
                 Current
#1104
     Baseline
#1100
No change  Other 690.27KiB 690.27KiB

Bundle analysis reportBranch PupilTong:codex/comment-out-bts-...Project dashboard


Generated by RelativeCIDocumentationReport issue

@relativeci
Copy link
Copy Markdown

relativeci Bot commented May 8, 2026

React Example

#7990 Bundle Size — 235.77KiB (0%).

dd94fd2(current) vs 4b27356 main#7986(baseline)

Bundle metrics  no changes
                 Current
#7990
     Baseline
#7986
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 197 197
No change  Duplicate Modules 80 80
No change  Duplicate Code 44.85% 44.85%
No change  Packages 2 2
No change  Duplicate Packages 0 0
Bundle size by type  no changes
                 Current
#7990
     Baseline
#7986
No change  IMG 145.76KiB 145.76KiB
No change  Other 90.01KiB 90.01KiB

Bundle analysis reportBranch PupilTong:codex/comment-out-bts-...Project dashboard


Generated by RelativeCIDocumentationReport issue

@relativeci
Copy link
Copy Markdown

relativeci Bot commented May 8, 2026

Web Explorer

#9562 Bundle Size — 899.99KiB (~-0.01%).

dd94fd2(current) vs 4b27356 main#9558(baseline)

Bundle metrics  Change 1 change
                 Current
#9562
     Baseline
#9558
No change  Initial JS 44.46KiB 44.46KiB
No change  Initial CSS 2.22KiB 2.22KiB
Change  Cache Invalidation 1.53% 0%
No change  Chunks 9 9
No change  Assets 11 11
No change  Modules 227 227
No change  Duplicate Modules 11 11
No change  Duplicate Code 27.29% 27.29%
No change  Packages 10 10
No change  Duplicate Packages 0 0
Bundle size by type  Change 1 change Improvement 1 improvement
                 Current
#9562
     Baseline
#9558
Improvement  JS 495.85KiB (~-0.01%) 495.88KiB
No change  Other 401.92KiB 401.92KiB
No change  CSS 2.22KiB 2.22KiB

Bundle analysis reportBranch PupilTong:codex/comment-out-bts-...Project dashboard


Generated by RelativeCIDocumentationReport issue

@relativeci
Copy link
Copy Markdown

relativeci Bot commented May 8, 2026

React Example with Element Template

#255 Bundle Size — 197.77KiB (-0.01%).

dd94fd2(current) vs 4b27356 main#251(baseline)

Bundle metrics  Change 2 changes
                 Current
#255
     Baseline
#251
No change  Initial JS 0B 0B
No change  Initial CSS 0B 0B
Change  Cache Invalidation 26.31% 0%
No change  Chunks 0 0
No change  Assets 4 4
No change  Modules 79 79
No change  Duplicate Modules 23 23
Change  Duplicate Code 40.43%(+0.25%) 40.33%
No change  Packages 2 2
No change  Duplicate Packages 0 0
Bundle size by type  Change 1 change Improvement 1 improvement
                 Current
#255
     Baseline
#251
No change  IMG 145.76KiB 145.76KiB
Improvement  Other 52.01KiB (-0.04%) 52.03KiB

Bundle analysis reportBranch PupilTong:codex/comment-out-bts-...Project dashboard


Generated by RelativeCIDocumentationReport issue

@relativeci
Copy link
Copy Markdown

relativeci Bot commented May 8, 2026

React MTF Example

#1120 Bundle Size — 206.69KiB (+0.04%).

dd94fd2(current) vs 4b27356 main#1116(baseline)

Bundle metrics  Change 1 change
                 Current
#1120
     Baseline
#1116
No change  Initial JS 0B 0B
No change  Initial CSS 0B 0B
Change  Cache Invalidation 46.16% 0%
No change  Chunks 0 0
No change  Assets 3 3
No change  Modules 192 192
No change  Duplicate Modules 77 77
No change  Duplicate Code 44.36% 44.36%
No change  Packages 2 2
No change  Duplicate Packages 0 0
Bundle size by type  Change 1 change Regression 1 regression
                 Current
#1120
     Baseline
#1116
No change  IMG 111.23KiB 111.23KiB
Regression  Other 95.46KiB (+0.09%) 95.37KiB

Bundle analysis reportBranch PupilTong:codex/comment-out-bts-...Project dashboard


Generated by RelativeCIDocumentationReport issue

@PupilTong PupilTong force-pushed the codex/comment-out-bts-xhr branch from 6b445fa to c899f2a Compare May 8, 2026 12:06
@PupilTong PupilTong force-pushed the codex/comment-out-bts-xhr branch from c899f2a to dd94fd2 Compare May 8, 2026 12:45
@PupilTong PupilTong self-assigned this May 11, 2026
@PupilTong PupilTong merged commit 09b9ef0 into lynx-family:main May 11, 2026
109 of 116 checks passed
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.

2 participants