Skip to content

refactor: align Lynx terminology with official specification#2276

Open
Huxpro wants to merge 15 commits intomainfrom
Huxpro/fetch-lynx-docs-v1
Open

refactor: align Lynx terminology with official specification#2276
Huxpro wants to merge 15 commits intomainfrom
Huxpro/fetch-lynx-docs-v1

Conversation

@Huxpro
Copy link
Collaborator

@Huxpro Huxpro commented Feb 28, 2026

Summary

Add official API aliases (LynxBundle, BundleLoader, LynxBundlePlugin, BundleHooks, LynxBundlePluginOptions, DecodedBundle, BundleSectionLabel) for legacy internal names to align with the official lynxjs.org specification. Mark deprecated names with @deprecated JSDoc tags to guide users to official terminology while maintaining full backward compatibility.

Add comprehensive JSDoc clarifications explaining the mapping between internal field names and official spec terms, plus wire format constraints. Remove redundant call-site comments since IDEs will automatically show @deprecated warnings.

Affected npm packages

  • @lynx-js/web-constants: Exports LynxBundle (alias), BundleLoader (alias)
  • @lynx-js/template-webpack-plugin: Exports LynxBundlePlugin (alias), BundleHooks (alias), LynxBundlePluginOptions (alias)
  • @lynx-js/web-core: Re-exports LynxBundle
  • @lynx-js/rspeedy-plugin-react: Re-exports LynxBundlePlugin, BundleHooks
  • @lynx-js/web-core-wasm: Internal aliases (not public API)

Summary by CodeRabbit

  • Refactor

    • Renamed public "Template" terminology to "Bundle" across the public API, adding deprecated aliases to preserve compatibility
    • Adjusted legacy naming to prefer "Main Thread Script (MTS)" and "Background Thread Script (BTS)"
  • New Features

    • Added new public bundle-related types and re-exports (Bundle, BundleHooks, BundleLoader, DecodedBundle, LynxBundlePlugin)
    • Introduced a new RPC endpoint to invoke runtime methods
  • Documentation

    • Expanded and clarified JSDoc for MTS/BTS, deprecated aliases, and plugin options
  • Tests

    • Updated tests to include a stub API during plugin initialization

Checklist

  • Tests not required (JSDoc and type aliases only)
  • Documentation updated (JSDoc comments added)
  • Changeset added (check if required for aliases)

Copilot AI review requested due to automatic review settings February 28, 2026 10:42
@changeset-bot
Copy link

changeset-bot bot commented Feb 28, 2026

🦋 Changeset detected

Latest commit: 9e46237

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

This PR includes changesets to release 15 packages
Name Type
@lynx-js/web-constants Patch
@lynx-js/web-core Patch
@lynx-js/react-webpack-plugin Patch
@lynx-js/template-webpack-plugin Patch
@lynx-js/react-rsbuild-plugin Patch
@lynx-js/web-core-server Patch
@lynx-js/web-mainthread-apis Patch
@lynx-js/web-worker-runtime Patch
upgrade-rspeedy Patch
@lynx-js/web-rsbuild-server-middleware Patch
@lynx-js/react-alias-rsbuild-plugin Patch
create-rspeedy Patch
@lynx-js/web-worker-rpc Patch
@lynx-js/rspeedy Patch
@lynx-js/web-core-wasm 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
Contributor

coderabbitai bot commented Feb 28, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

This PR renames template-centered public types and interfaces to bundle-centered names across multiple packages (e.g., LynxTemplate → LynxBundle, TemplateHooks → BundleHooks, LynxTemplatePlugin → LynxBundlePlugin), adds deprecated aliases, and updates documentation to use Main Thread Script (MTS) / Background Thread Script (BTS) terminology.

Changes

Cohort / File(s) Summary
rspeedy Plugin React
packages/rspeedy/plugin-react/src/index.ts, packages/rspeedy/plugin-react/src/pluginReactLynx.ts, packages/rspeedy/plugin-react/etc/react-rsbuild-plugin.api.md, packages/rspeedy/plugin-react/test/config.test.ts
Re-exported renamed plugin types: LynxBundlePlugin and BundleHooks (with deprecated aliases to legacy names); updated doc comments to MTS/BTS; tests add pluginStubRspeedyAPI() before pluginReactLynx in two cases.
Web Constants & Types
packages/web-platform/web-constants/src/types/LynxModule.ts, packages/web-platform/web-constants/src/types/TemplateLoader.ts, packages/web-platform/web-constants/src/endpoints.ts, packages/web-platform/web-core/src/index.ts
Renamed LynxTemplateLynxBundle (deprecated alias preserved); TemplateLoaderBundleLoader alias; added callLepusMethodEndpoint; re-exported LynxBundle.
Web Core WASM & Types
packages/web-platform/web-core-wasm/ts/constants.ts, packages/web-platform/web-core-wasm/ts/types/DecodedTemplate.ts, packages/web-platform/web-core-wasm/ts/encode/webEncoder.ts
Introduced BundleSectionLabel (mapping legacy fields with deprecation notes); renamed DecodedTemplateDecodedBundle with deprecated alias; added inline JSDoc clarifications.
Web Mainthread APIs
packages/web-platform/web-mainthread-apis/ts/createMainThreadGlobalThis.ts, packages/web-platform/web-mainthread-apis/ts/crossThreadHandlers/registerCallLepusMethodHandler.ts
Added lynxTemplate to MainThreadRuntimeConfig and added/clarified JSDoc for __LoadLepusChunk / legacy Lepus naming; handler JSDoc added (no signature changes).
Webpack React Plugin
packages/webpack/react-webpack-plugin/src/ReactWebpackPlugin.ts, packages/webpack/react-webpack-plugin/src/loaders/options.ts
Documentation updates replacing “Lepus” with “Main Thread Script (MTS)” and clarifying MAIN_THREAD legacy path segment.
Webpack Template Plugin
packages/webpack/template-webpack-plugin/src/LynxTemplatePlugin.ts, packages/webpack/template-webpack-plugin/src/LynxEncodePlugin.ts, packages/webpack/template-webpack-plugin/src/WebEncodePlugin.ts, packages/webpack/template-webpack-plugin/src/index.ts, packages/webpack/template-webpack-plugin/etc/template-webpack-plugin.api.md
Wide public API rename: TemplateHooksBundleHooks, LynxTemplatePluginOptionsLynxBundlePluginOptions, introduced LynxBundlePlugin alias and OriginManifest (deprecated); hook types and JSDoc updated; runtime behavior unchanged; deprecated aliases added across API docs.
Repository Changeset / Docs
.changeset/align-lynx-terminology.md
Adds deprecation-guidance and documents new preferred bundle-centered public type names and aliases across packages.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Suggested reviewers

  • PupilTong
  • upupming
  • Sherry-hue
  • colinaaa
  • luhc228

Poem

🐇 I hopped through types and changed the name,
Bundles now wear templates’ former fame.
Old aliases linger, polite and slow,
MTS and BTS in doclights glow.
A tiny rabbit stamps — the refactor’s done. 🎉

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ 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 clearly and accurately describes the main change: aligning Lynx terminology with the official specification. The changeset systematically renames types and exports across multiple packages to use new canonical names (e.g., LynxBundle, BundleHooks) while maintaining backward compatibility through deprecated aliases.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch Huxpro/fetch-lynx-docs-v1

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.

@codecov
Copy link

codecov bot commented Feb 28, 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!

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds official API aliases (e.g., LynxBundle, BundleLoader, LynxBundlePlugin, BundleHooks) for legacy internal names to align with the official lynxjs.org specification, while preserving full backward compatibility. Legacy names are marked with @deprecated JSDoc tags. Additionally, inline documentation is improved to clarify the mapping between internal field names (e.g., lepusCode, manifest) and their official spec equivalents (MTS/BTS).

Changes:

  • New type/value aliases added for spec-aligned naming across multiple packages (web-constants, template-webpack-plugin, web-core, web-core-wasm)
  • @deprecated JSDoc tags added to legacy types/classes; documentation updated to reference official Lynx terminology
  • Unrelated changes to pnpm-workspace.yaml (adds non-existent packages/repl) and pnpm-lock.yaml (bumps several packages to @rsbuild/core@2.0.0-beta.3)

Reviewed changes

Copilot reviewed 18 out of 19 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
pnpm-workspace.yaml Adds packages/repl entry (directory does not exist)
pnpm-lock.yaml Several packages now resolve against @rsbuild/core@2.0.0-beta.3; unrelated to stated PR purpose
packages/webpack/template-webpack-plugin/src/index.ts Exports new LynxBundlePlugin, LynxBundlePluginOptions, BundleHooks aliases
packages/webpack/template-webpack-plugin/src/LynxTemplatePlugin.ts Adds @deprecated to legacy types; introduces LynxBundlePlugin, BundleHooks, LynxBundlePluginOptions aliases; improves JSDoc
packages/webpack/template-webpack-plugin/src/LynxEncodePlugin.ts Updates inline comment for app-service.js BTS entry point name
packages/webpack/template-webpack-plugin/src/WebEncodePlugin.ts Updates inline comment for app-service.js BTS entry point name
packages/webpack/react-webpack-plugin/src/loaders/options.ts Adds clarifying comment for lepus path segment
packages/webpack/react-webpack-plugin/src/ReactWebpackPlugin.ts Updates doc to use MTS/BTS terminology instead of Lepus/JS
packages/web-platform/web-mainthread-apis/ts/crossThreadHandlers/registerCallLepusMethodHandler.ts Adds JSDoc explaining legacy "Lepus" term
packages/web-platform/web-mainthread-apis/ts/createMainThreadGlobalThis.ts Adds field and function JSDoc for MTS terminology
packages/web-platform/web-core/src/index.ts Re-exports LynxBundle from web-constants
packages/web-platform/web-core-wasm/ts/types/DecodedTemplate.ts Marks DecodedTemplate deprecated; adds DecodedBundle alias
packages/web-platform/web-core-wasm/ts/encode/webEncoder.ts Adds JSDoc for manifest/lepusCode fields
packages/web-platform/web-core-wasm/ts/constants.ts Adds BundleSectionLabel constant with spec-aligned names
packages/web-platform/web-constants/src/types/TemplateLoader.ts Marks TemplateLoader deprecated; adds BundleLoader alias
packages/web-platform/web-constants/src/types/LynxModule.ts Marks LynxTemplate deprecated; adds LynxBundle alias; improves field JSDoc
packages/web-platform/web-constants/src/endpoints.ts Adds JSDoc to callLepusMethodEndpoint
packages/rspeedy/plugin-react/src/pluginReactLynx.ts Updates option JSDoc to use MTS/BTS terminology
packages/rspeedy/plugin-react/src/index.ts Exports LynxBundlePlugin and BundleHooks aliases alongside deprecated legacy exports
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported
Comments suppressed due to low confidence (1)

packages/webpack/template-webpack-plugin/src/LynxTemplatePlugin.ts:381

  • The @deprecated annotation on the LynxTemplatePlugin class is misleading in this refactoring. Since LynxBundlePlugin is defined as const LynxBundlePlugin = LynxTemplatePlugin, TypeScript will infer its type as typeof LynxTemplatePlugin. Because LynxTemplatePlugin is marked @deprecated, IDEs (e.g. VS Code) will still display a strikethrough or deprecation warning when code hovers over LynxBundlePlugin, because the inferred type references the deprecated symbol. This undermines the purpose of providing a clean non-deprecated alias.

The standard pattern for this kind of rename-with-backward-compat is:

  • Keep the canonical (new) name as the primary declaration (no @deprecated)
  • Create the old name as a deprecated type alias that references the new canonical name

Since renaming the actual class is a larger refactor, an intermediate approach would be to avoid placing the @deprecated tag on LynxTemplatePlugin itself and instead only note in its JSDoc that it's a legacy name, pointing to LynxBundlePlugin as the preferred name — but without the @deprecated tag triggering IDE warnings for the new alias.

 * @deprecated Use {@link LynxBundlePlugin} instead. This alias is retained for
 * backward compatibility.
 *
 * @public
 */
export class LynxTemplatePlugin {

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

/**
* @deprecated The name `OriginManifest` is a legacy artifact. "Manifest" here
* refers to Background Thread Script (BTS) chunks in the official Lynx
* specification.
Copy link

Copilot AI Feb 28, 2026

Choose a reason for hiding this comment

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

The @deprecated annotation on OriginManifest does not provide a {@link} reference to a replacement type. Unlike the other deprecated types in this PR (which all have @deprecated Use {@link NewName} instead), this one leaves users without a clear alternative to migrate to. Either add a {@link} to a replacement type alias (e.g. if one should be introduced), or include explicit guidance in the deprecation text (e.g. Use the inline record type directly or see {@link EncodeOptions.manifest}).

Suggested change
* specification.
* specification. Use the inline record type directly or see
* {@link EncodeOptions.manifest}.

Copilot uses AI. Check for mistakes.
pnpm-lock.yaml Outdated
Comment on lines +926 to +944
@@ -941,7 +941,7 @@ importers:
version: 1.1.1
rsbuild-plugin-tailwindcss:
specifier: 0.2.4
version: 0.2.4(@rsbuild/core@1.7.3)(tailwindcss@3.4.19)
version: 0.2.4(@rsbuild/core@2.0.0-beta.3(core-js@3.48.0))(tailwindcss@3.4.19)
Copy link

Copilot AI Feb 28, 2026

Choose a reason for hiding this comment

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

The pnpm-lock.yaml changes include several packages now resolving with @rsbuild/core@2.0.0-beta.3 (a beta release) instead of the catalog-pinned stable version 1.7.3 for importers like packages/rspeedy/upgrade-rspeedy and website. This is a significant unintended side-effect that is completely unrelated to the API alias/terminology changes described in this PR, and it may introduce instability. These lock file changes should be investigated and separated from this PR.

Copilot uses AI. Check for mistakes.
- packages/background-only
- packages/lynx/*
- packages/mcp-servers/*
- packages/repl
Copy link

Copilot AI Feb 28, 2026

Choose a reason for hiding this comment

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

The pnpm-workspace.yaml diff adds packages/repl to the workspace, but this directory does not exist in the repository. This will cause pnpm install to fail (or at least produce a warning) because there is no package.json to resolve under packages/repl. This change appears completely unrelated to the stated purpose of this PR (adding API aliases for the Lynx specification terminology) and should be removed or addressed in a separate PR.

Suggested change
- packages/repl

Copilot uses AI. Check for mistakes.
Copy link
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

🧹 Nitpick comments (1)
packages/webpack/template-webpack-plugin/src/WebEncodePlugin.ts (1)

71-71: Documentation clarity: consider expanding "BTS" abbreviation.

The comment update aligns well with the PR's terminology standardization goals. The abbreviation "BTS" (Background Thread Script) is concise but might benefit from being expanded on first use for improved clarity, especially for developers unfamiliar with the official specification.

📝 Optional expansion for clarity
-              // `/app-service.js` is the conventional BTS entry point in a Lynx Bundle.
+              // `/app-service.js` is the conventional BTS (Background Thread Script) entry point in a Lynx Bundle.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/webpack/template-webpack-plugin/src/WebEncodePlugin.ts` at line 71,
The inline comment in WebEncodePlugin referencing "`/app-service.js` is the
conventional BTS entry point in a Lynx Bundle." should expand the abbreviation
on first use for clarity; update that comment in WebEncodePlugin.ts to read
something like "BTS (Background Thread Script)" on first mention (e.g.,
"`/app-service.js` is the conventional BTS (Background Thread Script) entry
point in a Lynx Bundle") so unfamiliar readers immediately see the full term
while keeping subsequent mentions as "BTS".
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@packages/webpack/template-webpack-plugin/src/LynxTemplatePlugin.ts`:
- Line 1119: The exported alias LynxBundlePlugin lacks an explicit type
annotation which breaks declaration generation under --isolatedDeclarations;
update the export so LynxBundlePlugin is declared with an explicit type (e.g.,
annotate it as the same type as LynxTemplatePlugin using a typeof or the
plugin's exported type/interface) so the compiler can emit declarations without
analyzing other modules — locate the export "export const LynxBundlePlugin =
LynxTemplatePlugin;" and change it to include the explicit type annotation for
LynxBundlePlugin.

---

Nitpick comments:
In `@packages/webpack/template-webpack-plugin/src/WebEncodePlugin.ts`:
- Line 71: The inline comment in WebEncodePlugin referencing "`/app-service.js`
is the conventional BTS entry point in a Lynx Bundle." should expand the
abbreviation on first use for clarity; update that comment in WebEncodePlugin.ts
to read something like "BTS (Background Thread Script)" on first mention (e.g.,
"`/app-service.js` is the conventional BTS (Background Thread Script) entry
point in a Lynx Bundle") so unfamiliar readers immediately see the full term
while keeping subsequent mentions as "BTS".

ℹ️ Review info

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 94e5779 and 3644d42.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (18)
  • packages/rspeedy/plugin-react/src/index.ts
  • packages/rspeedy/plugin-react/src/pluginReactLynx.ts
  • packages/web-platform/web-constants/src/endpoints.ts
  • packages/web-platform/web-constants/src/types/LynxModule.ts
  • packages/web-platform/web-constants/src/types/TemplateLoader.ts
  • packages/web-platform/web-core-wasm/ts/constants.ts
  • packages/web-platform/web-core-wasm/ts/encode/webEncoder.ts
  • packages/web-platform/web-core-wasm/ts/types/DecodedTemplate.ts
  • packages/web-platform/web-core/src/index.ts
  • packages/web-platform/web-mainthread-apis/ts/createMainThreadGlobalThis.ts
  • packages/web-platform/web-mainthread-apis/ts/crossThreadHandlers/registerCallLepusMethodHandler.ts
  • packages/webpack/react-webpack-plugin/src/ReactWebpackPlugin.ts
  • packages/webpack/react-webpack-plugin/src/loaders/options.ts
  • packages/webpack/template-webpack-plugin/src/LynxEncodePlugin.ts
  • packages/webpack/template-webpack-plugin/src/LynxTemplatePlugin.ts
  • packages/webpack/template-webpack-plugin/src/WebEncodePlugin.ts
  • packages/webpack/template-webpack-plugin/src/index.ts
  • pnpm-workspace.yaml

Copy link
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

♻️ Duplicate comments (1)
packages/webpack/template-webpack-plugin/src/LynxTemplatePlugin.ts (1)

1113-1113: ⚠️ Potential issue | 🔴 Critical

Add explicit type annotation for exported alias (build blocker).

Line 1113 currently fails declaration emit with --isolatedDeclarations because the exported const alias has no explicit type.

Suggested fix
-export const LynxBundlePlugin = LynxTemplatePlugin;
+export const LynxBundlePlugin: typeof LynxTemplatePlugin =
+  LynxTemplatePlugin;

As per coding guidelines **/*.{ts,tsx}: Use TypeScript with the strictest mode configuration as defined in tsconfig.json.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/webpack/template-webpack-plugin/src/LynxTemplatePlugin.ts` at line
1113, The exported alias LynxBundlePlugin lacks an explicit type which breaks
declaration emit under --isolatedDeclarations; fix by adding an explicit type
annotation to the exported const (make LynxBundlePlugin have the same type as
LynxTemplatePlugin, e.g. annotate it with typeof LynxTemplatePlugin) so the
declaration file can be emitted correctly.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@packages/webpack/template-webpack-plugin/src/LynxTemplatePlugin.ts`:
- Around line 1109-1113: The export for LynxBundlePlugin currently carries a
contradictory `@deprecated` JSDoc; remove the deprecation annotation/comment from
the declaration of export const LynxBundlePlugin = LynxTemplatePlugin so that
LynxBundlePlugin remains the canonical alias, leaving the deprecation on
LynxTemplatePlugin intact; update or simplify the JSDoc above LynxBundlePlugin
to a short non-deprecated note (or remove it entirely) to avoid inverted
migration warnings in IDEs.

---

Duplicate comments:
In `@packages/webpack/template-webpack-plugin/src/LynxTemplatePlugin.ts`:
- Line 1113: The exported alias LynxBundlePlugin lacks an explicit type which
breaks declaration emit under --isolatedDeclarations; fix by adding an explicit
type annotation to the exported const (make LynxBundlePlugin have the same type
as LynxTemplatePlugin, e.g. annotate it with typeof LynxTemplatePlugin) so the
declaration file can be emitted correctly.

ℹ️ Review info

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3644d42 and 88b04f2.

📒 Files selected for processing (6)
  • packages/rspeedy/plugin-react/src/index.ts
  • packages/web-platform/web-constants/src/types/LynxModule.ts
  • packages/web-platform/web-constants/src/types/TemplateLoader.ts
  • packages/web-platform/web-core-wasm/ts/constants.ts
  • packages/web-platform/web-core-wasm/ts/types/DecodedTemplate.ts
  • packages/webpack/template-webpack-plugin/src/LynxTemplatePlugin.ts
🚧 Files skipped from review as they are similar to previous changes (2)
  • packages/web-platform/web-core-wasm/ts/constants.ts
  • packages/rspeedy/plugin-react/src/index.ts

@codspeed-hq
Copy link

codspeed-hq bot commented Feb 28, 2026

Merging this PR will improve performance by 36.97%

⚡ 2 improved benchmarks
✅ 70 untouched benchmarks
⏩ 3 skipped benchmarks1

Performance Changes

Benchmark BASE HEAD Efficiency
basic-performance-large-css 22.1 ms 16.1 ms +36.97%
transform 1000 view elements 47.2 ms 42.2 ms +12.07%

Comparing Huxpro/fetch-lynx-docs-v1 (9e46237) with main (7518b72)

Open in CodSpeed

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

relativeci bot commented Feb 28, 2026

Web Explorer

#8003 Bundle Size — 384.21KiB (0%).

9e46237(current) vs 7518b72 main#7993(baseline)

Bundle metrics  Change 2 changes
                 Current
#8003
     Baseline
#7993
No change  Initial JS 155.31KiB 155.31KiB
No change  Initial CSS 35.1KiB 35.1KiB
Change  Cache Invalidation 0% 40.39%
No change  Chunks 8 8
No change  Assets 8 8
Change  Modules 239(+0.42%) 238
No change  Duplicate Modules 16 16
Change  Duplicate Code 3%(+0.67%) 2.98%
No change  Packages 4 4
No change  Duplicate Packages 0 0
Bundle size by type  no changes
                 Current
#8003
     Baseline
#7993
No change  JS 253.26KiB 253.26KiB
No change  Other 95.85KiB 95.85KiB
No change  CSS 35.1KiB 35.1KiB

Bundle analysis reportBranch Huxpro/fetch-lynx-docs-v1Project dashboard


Generated by RelativeCIDocumentationReport issue

Copy link
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: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@packages/rspeedy/plugin-react/etc/react-rsbuild-plugin.api.md`:
- Around line 54-56: The exported interface LynxBundlePlugin is missing JSDoc
with a release tag; add a JSDoc block immediately above the LynxBundlePlugin
declaration (matching the style used for PluginReactLynxOptions) that includes a
short one-line description and the `@public` release tag so API Extractor no
longer marks it as undocumented.

In `@packages/webpack/template-webpack-plugin/etc/template-webpack-plugin.api.md`:
- Around line 79-82: Edit the JSDoc for the exported constant LynxBundlePlugin
in LynxTemplatePlugin.ts: remove the `@deprecated` tag and ensure it is annotated
`@public` (leave no deprecation text), while keeping the LynxTemplatePlugin class
marked `@deprecated` and pointing to LynxBundlePlugin; after updating the JSDoc,
rebuild/regenerate the API report by running pnpm turbo api-extractor -- --local
so the packages/webpack/template-webpack-plugin API file reflects the change.

ℹ️ Review info

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c291fd0 and ae4c7af.

📒 Files selected for processing (3)
  • packages/rspeedy/plugin-react/etc/react-rsbuild-plugin.api.md
  • packages/rspeedy/plugin-react/src/index.ts
  • packages/webpack/template-webpack-plugin/etc/template-webpack-plugin.api.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/rspeedy/plugin-react/src/index.ts

Huxpro added 6 commits March 2, 2026 16:40
Add official API aliases (LynxBundle, BundleLoader, LynxBundlePlugin,
BundleHooks, LynxBundlePluginOptions, DecodedBundle, BundleSectionLabel)
for legacy internal names (LynxTemplate, TemplateLoader, LynxTemplatePlugin,
TemplateHooks, LynxTemplatePluginOptions, DecodedTemplate, TemplateSectionLabel).

Mark legacy names with @deprecated to guide users to official terminology
while maintaining full backward compatibility.

Add comprehensive JSDoc clarifications on definition sites explaining the
mapping between internal field names and official spec terms, plus wire
format constraints on hardcoded field names.

Remove redundant call-site comments since IDE will show @deprecated warnings.
The new canonical names (LynxBundle, BundleLoader, DecodedBundle,
BundleSectionLabel, BundleHooks, LynxBundlePluginOptions, LynxBundlePlugin)
are now the actual interface/const definitions, and the old names
(LynxTemplate, TemplateLoader, DecodedTemplate, TemplateSectionLabel,
TemplateHooks, LynxTemplatePluginOptions, LynxTemplatePlugin) are
@deprecated aliases pointing to them.
… lockfile drift

- Add `typeof LynxTemplatePlugin` annotation on LynxBundlePlugin export
  to satisfy --isolatedDeclarations (TS9010).
- Revert accidental pnpm-lock.yaml and pnpm-workspace.yaml changes that
  were not part of the terminology refactoring.
- Fix sort-imports ESLint error in plugin-react/src/index.ts
- Update api-extractor report for @lynx-js/react-rsbuild-plugin
- Update api-extractor report for @lynx-js/template-webpack-plugin
@Huxpro Huxpro force-pushed the Huxpro/fetch-lynx-docs-v1 branch from adada26 to 2f7528a Compare March 3, 2026 00:41
PupilTong
PupilTong previously approved these changes Mar 4, 2026
Co-authored-by: Haoyang Wang <12288479+PupilTong@users.noreply.github.com>
Signed-off-by: Xuan Huang (黄玄) <5563315+Huxpro@users.noreply.github.com>
Huxpro added 4 commits March 4, 2026 23:23
- Remove contradictory @deprecated on LynxBundlePlugin export (CodeRabbit)
- Add @public JSDoc to LynxBundlePlugin interface in plugin-react (CodeRabbit)
- Add {@link EncodeOptions.manifest} guidance to OriginManifest @deprecated (Copilot)
- Replace TemplateSectionLabel with BundleSectionLabel directly in web-core-wasm (PupilTong)
- Add LynxBundlePlugin symbol expose alongside LynxTemplatePlugin (colinaaa)
- Regenerate API reports
…ugin

Update the exposed plugin API object key and all consumers
(pluginLynxConfig, tests) to use LynxBundlePlugin consistently.
Copy link
Collaborator

@colinaaa colinaaa left a comment

Choose a reason for hiding this comment

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

It's fine to make the change in packages/rspeedy/plugin-config in the next PR :)

Comment on lines +116 to 119
{ LynxBundlePlugin: typeof LynxTemplatePlugin }
>(
Symbol.for('LynxTemplatePlugin'),
Symbol.for('LynxBundlePlugin'),
)
Copy link
Collaborator

Choose a reason for hiding this comment

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

We should be compatible with the legacy @lynx-js/react-rsbuild-plugin.

const exposed = api.useExposed<
          { LynxBundlePlugin: typeof LynxTemplatePlugin }
        >(
          Symbol.for('LynxBundlePlugin'),
        ) ?? api.useExposed<
          { LynxTemplatePlugin: typeof LynxTemplatePlugin }
        >(
          Symbol.for('LynxTemplatePlugin'),
        )

}

const { LynxTemplatePlugin: LynxTemplatePluginClass } = exposed
const { LynxBundlePlugin: LynxTemplatePluginClass } = exposed
Copy link
Collaborator

Choose a reason for hiding this comment

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

ditto here

{ LynxBundlePlugin: typeof LynxTemplatePlugin }
>(
Symbol.for('LynxTemplatePlugin'),
Symbol.for('LynxBundlePlugin'),
Copy link
Collaborator

Choose a reason for hiding this comment

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

There should also be a changeset for @lynx-js/config-rsbuild-plugin.

"@lynx-js/web-constants": patch
"@lynx-js/web-core": patch
"@lynx-js/react-webpack-plugin": patch
"@lynx-js/template-webpack-plugin": patch
Copy link
Collaborator

Choose a reason for hiding this comment

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

Shall we also rename @lynx-js/template-webpack-plugin to @lynx-js/bundle-webpack-plugin? (Might be a breaking change)

Copy link
Collaborator

Choose a reason for hiding this comment

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

+1. @lynx-js/template-webpack-plugin should only be used by us.

api.modifyBundlerChain(chain => {
const exposed = api.useExposed<
{ LynxTemplatePlugin: typeof LynxTemplatePlugin }
{ LynxBundlePlugin: typeof LynxTemplatePlugin }
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we need to migrate LynxTemplatePlugin export in @lynx-js/bundle-webpack-plugin to LynxBundlePlugin too? (Or use a fallback LynxBundlePlugin ?? LynxTemplatePlugin now and migrate to LynxBundlePlugin future)

*
* @public
*/
export class LynxTemplatePlugin {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I prefer to rename it to LynxBundlePlugin at this point, and then add export const LynxTemplatePlugin: typeof LynxBundlePlugin = LynxBundlePlugin; below.

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.

7 participants