Skip to content

feat(react-externals): automate bundle serving and fix typings#2331

Merged
upupming merged 2 commits intomainfrom
fix-react-externals-umd-setup
Mar 12, 2026
Merged

feat(react-externals): automate bundle serving and fix typings#2331
upupming merged 2 commits intomainfrom
fix-react-externals-umd-setup

Conversation

@upupming
Copy link
Copy Markdown
Collaborator

@upupming upupming commented Mar 11, 2026

Description

This PR automates external bundle serving in the react-externals example without requiring an external http-server process, by cleanly utilizing the DevServer's local middleware in lynx.config.ts. Additionally, it adds dedicated README documentation for the @lynx-js/react-umd pre-packaged bundle.

Specifically, this PR:

  1. Adds @lynx-js/react-umd README: Explains the purpose of the UMD pre-packaged build and how to build/serve it.
  2. Fixes Rsbuild Configuration Typings in @lynx-js/rspeedy: Adds setupMiddlewares to the Config.dev interface so it natively aligns with Rsbuild 1.X semantic shapes, fixing downstream typescript resolution.
  3. Fixes lynx.config.ts Typescript Error: Resolves the No overload matches this call TS error by migrating the obsolete Webpack devServer property into Rsbuild's expected server and dev properties.
  4. Fixes Invalid RsbuildPlugin Structure: Resolves a pnpm dev exit 1 crash in react-externals by correctly shaping the middleware URL routing into a named plugin using the api.modifyRsbuildConfig lifecycle hook.

Summary by CodeRabbit

  • New Features

    • Standalone UMD build of the ReactLynx runtime for external/shared runtime use.
    • Dev workflow now auto-serves runtime and component bundles with a simplified start command.
    • Centralized runtime export package exposing React runtimes and dev aliases from a single surface.
    • New dev-serving plugin and package-level build/dev scripts with export mappings.
  • Documentation

    • Added README and updated example usage and startup instructions.
  • Chores

    • Added new package to workspace and TypeScript config for the UMD package.

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 Mar 11, 2026

🦋 Changeset detected

Latest commit: 71c50f0

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/react-umd Minor

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 Mar 11, 2026

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: 7b0c00c5-0d20-4b3b-b0f1-7c72137133ef

📥 Commits

Reviewing files that changed from the base of the PR and between bd41528 and 71c50f0.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (2)
  • packages/react-umd/src/index.ts
  • packages/react-umd/tsconfig.json

📝 Walkthrough

Walkthrough

Adds a new workspace package @lynx-js/react-umd providing dev/prod UMD bundles and a barrel export; updates the react-externals example to serve those bundles via a new Rsbuild dev middleware plugin; adjusts example scripts/tsconfig and adds a changeset documenting the release. (50 words)

Changes

Cohort / File(s) Summary
New React UMD Package
pnpm-workspace.yaml, packages/react-umd/package.json, packages/react-umd/tsconfig.json, packages/react-umd/rslib.config.ts, packages/react-umd/src/index.ts, packages/react-umd/README.md
Adds @lynx-js/react-umd workspace package with export mappings for ./dev and ./prod, build scripts, tsconfig, rslib build config (env-driven id), and a barrel src/index.ts re-exporting React runtime namespaces. README documents artifacts and usage.
React Externals Example Updates
examples/react-externals/lynx.config.ts, examples/react-externals/README.md, examples/react-externals/package.json, examples/react-externals/tsconfig.json
Introduces pluginServeExternals() Rsbuild plugin and dev middleware serving /react.lynx.bundle and /comp-lib.lynx.bundle with CORS, sets fixed dev port, switches example scripts to pnpm dev, and updates tsconfig include to lynx.config.ts.
Changeset
.changeset/react-externals-setup-umd.md
Adds a changeset documenting the minor release for @lynx-js/react-umd and describing the standalone UMD build.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested reviewers

  • colinaaa
  • luhc228

Poem

"I’m a rabbit with a bundling hop,
UMD carrots in my dev-server crop,
I serve with CORS and hum a tune,
Dev and prod beneath the moon,
Nibble, build, and then I hop."

🚥 Pre-merge checks | ✅ 2 | ❌ 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 (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main changes: automating bundle serving in react-externals example and fixing TypeScript typings related to the setup.

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

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix-react-externals-umd-setup

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

codecov bot commented Mar 11, 2026

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
packages/react-umd/src/index.ts 0.00% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@upupming upupming force-pushed the fix-react-externals-umd-setup branch 2 times, most recently from d12464d to f0eecdb Compare March 11, 2026 11:28
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: 3

🧹 Nitpick comments (1)
examples/react-externals/package.json (1)

10-12: Keep a dev-only ReactLynx build path for local iteration.

examples/react-externals/lynx.config.ts only serves packages/react-umd/dist/react-dev.lynx.bundle, but build:reactlynx now runs the full package build and generates the production bundle too. Restoring a build:reactlynx:dev alias, or pointing the local docs/scripts at @lynx-js/react-umd build:development, would avoid the extra production build in the normal dev loop.

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

In `@examples/react-externals/package.json` around lines 10 - 12, Add a dev-only
script so local iteration doesn't trigger the production bundle: keep the
existing "build:reactlynx" but add a new script "build:reactlynx:dev" (or
similar) that runs the package build in development mode for `@lynx-js/react-umd`
(the same mode that produces packages/react-umd/dist/react-dev.lynx.bundle) and
update any local docs/dev tooling that references
packages/react-umd/dist/react-dev.lynx.bundle or lynx.config.ts to use this dev
script instead of the full production build.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@examples/react-externals/lynx.config.ts`:
- Around line 41-71: The current route handlers for /react.lynx.bundle and
/comp-lib.lynx.bundle are registered only inside dev.setupMiddlewares
(dev.setupMiddlewares) so they won't run during rspeedy preview; move the
file-serving logic out of dev.setupMiddlewares and register it at a top-level
server middleware that runs for both dev and preview (or duplicate the same
middleware into the preview server config), ensuring the same checks for
fs.existsSync, Content-Type and Access-Control headers and streaming via
fs.createReadStream are preserved for the routes /react.lynx.bundle and
/comp-lib.lynx.bundle so preview can access the bundles.

In `@packages/react-umd/package.json`:
- Around line 33-35: The "build:development" npm script uses POSIX-only syntax
("NODE_ENV=development rslib build"); update the script named
"build:development" in package.json to use cross-env (e.g., "cross-env
NODE_ENV=development rslib build") so it runs on Windows and POSIX, and ensure
"cross-env" is present in devDependencies so the script can run in CI and
locally.

In `@packages/react-umd/README.md`:
- Line 29: Update the README line that mentions using
`@lynx-js/external-bundle-rsbuild-plugin` to reference the correct config file
extension: replace `lynx.config.js` with `lynx.config.ts` (or change to a
generic phrase like "your Lynx config file") so it matches the TypeScript
examples in this PR and avoids confusion when mapping `@lynx-js/react` and its
internal modules to the UMD bundle URL.

---

Nitpick comments:
In `@examples/react-externals/package.json`:
- Around line 10-12: Add a dev-only script so local iteration doesn't trigger
the production bundle: keep the existing "build:reactlynx" but add a new script
"build:reactlynx:dev" (or similar) that runs the package build in development
mode for `@lynx-js/react-umd` (the same mode that produces
packages/react-umd/dist/react-dev.lynx.bundle) and update any local docs/dev
tooling that references packages/react-umd/dist/react-dev.lynx.bundle or
lynx.config.ts to use this dev script instead of the full production build.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 351f4138-8fdc-4e5a-8686-b4e6d1393120

📥 Commits

Reviewing files that changed from the base of the PR and between ed566f0 and 6ae510e.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (10)
  • .changeset/react-externals-setup-umd.md
  • examples/react-externals/README.md
  • examples/react-externals/lynx.config.ts
  • examples/react-externals/package.json
  • examples/react-externals/tsconfig.json
  • packages/react-umd/README.md
  • packages/react-umd/package.json
  • packages/react-umd/rslib.config.ts
  • packages/react-umd/src/index.ts
  • pnpm-workspace.yaml

Comment thread examples/react-externals/lynx.config.ts
Comment thread packages/react-umd/package.json Outdated
Comment thread packages/react-umd/README.md Outdated
@upupming upupming force-pushed the fix-react-externals-umd-setup branch from f0eecdb to b71fc52 Compare March 11, 2026 11:37
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.

♻️ Duplicate comments (2)
packages/react-umd/package.json (1)

33-41: ⚠️ Potential issue | 🟠 Major

Make build:development cross-platform.

NODE_ENV=development rslib build is still POSIX-only, so pnpm --filter @lynx-js/react-umd build will fail on Windows before the dev bundle is emitted. Switch this script to cross-env and declare it locally.

Proposed fix
   "scripts": {
     "build": "rimraf dist && pnpm build:development && pnpm build:production",
-    "build:development": "NODE_ENV=development rslib build",
+    "build:development": "cross-env NODE_ENV=development rslib build",
     "build:production": "rslib build"
   },
   "devDependencies": {
     "@lynx-js/lynx-bundle-rslib-config": "workspace:*",
     "@lynx-js/react": "workspace:*",
     "@lynx-js/react-rsbuild-plugin": "workspace:*",
+    "cross-env": "^7.0.3",
     "rimraf": "^6.1.3"
   }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/react-umd/package.json` around lines 33 - 41, The build script
"build:development" in package.json uses a POSIX-only env prefix
(NODE_ENV=development rslib build); change it to use cross-env by adding
"cross-env" to devDependencies and update the "build:development" script to run
via cross-env (e.g., cross-env NODE_ENV=development rslib build) so the script
is cross-platform; ensure "cross-env" is declared in devDependencies alongside
existing entries so pnpm --filter `@lynx-js/react-umd` build works on Windows.
examples/react-externals/lynx.config.ts (1)

41-80: ⚠️ Potential issue | 🟠 Major

preview still won't serve these bundles.

These routes are registered only under dev.setupMiddlewares, so rspeedy preview does not expose /react.lynx.bundle or /comp-lib.lynx.bundle. That leaves the new preview flow broken unless the serving logic moves to a hook that also runs in preview, or the script is removed.

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

In `@examples/react-externals/lynx.config.ts` around lines 41 - 80, The middleware
that serves /react.lynx.bundle and /comp-lib.lynx.bundle is only registered in
api.modifyRsbuildConfig under dev.setupMiddlewares, so rspeedy preview won't
expose those routes; move or duplicate this serving logic into the preview
server hook (so preview also registers the same handlers) or remove the script.
Concretely, take the middleware function that checks req.url for
'/react.lynx.bundle' and '/comp-lib.lynx.bundle' (the closure added in
dev.setupMiddlewares via api.modifyRsbuildConfig) and register it with the
preview server hook your framework provides (e.g., the api.modifyPreviewConfig /
preview.setupMiddlewares / onPreviewServer equivalent) so rspeedy preview serves
the same bundles. Ensure headers and fs.createReadStream usage are preserved
when copying the logic.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Duplicate comments:
In `@examples/react-externals/lynx.config.ts`:
- Around line 41-80: The middleware that serves /react.lynx.bundle and
/comp-lib.lynx.bundle is only registered in api.modifyRsbuildConfig under
dev.setupMiddlewares, so rspeedy preview won't expose those routes; move or
duplicate this serving logic into the preview server hook (so preview also
registers the same handlers) or remove the script. Concretely, take the
middleware function that checks req.url for '/react.lynx.bundle' and
'/comp-lib.lynx.bundle' (the closure added in dev.setupMiddlewares via
api.modifyRsbuildConfig) and register it with the preview server hook your
framework provides (e.g., the api.modifyPreviewConfig / preview.setupMiddlewares
/ onPreviewServer equivalent) so rspeedy preview serves the same bundles. Ensure
headers and fs.createReadStream usage are preserved when copying the logic.

In `@packages/react-umd/package.json`:
- Around line 33-41: The build script "build:development" in package.json uses a
POSIX-only env prefix (NODE_ENV=development rslib build); change it to use
cross-env by adding "cross-env" to devDependencies and update the
"build:development" script to run via cross-env (e.g., cross-env
NODE_ENV=development rslib build) so the script is cross-platform; ensure
"cross-env" is declared in devDependencies alongside existing entries so pnpm
--filter `@lynx-js/react-umd` build works on Windows.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 85c640c0-5513-400a-bbe5-4ba8ec000c16

📥 Commits

Reviewing files that changed from the base of the PR and between 6ae510e and f0eecdb.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (10)
  • .changeset/react-externals-setup-umd.md
  • examples/react-externals/README.md
  • examples/react-externals/lynx.config.ts
  • examples/react-externals/package.json
  • examples/react-externals/tsconfig.json
  • packages/react-umd/README.md
  • packages/react-umd/package.json
  • packages/react-umd/rslib.config.ts
  • packages/react-umd/src/index.ts
  • pnpm-workspace.yaml
🚧 Files skipped from review as they are similar to previous changes (4)
  • packages/react-umd/rslib.config.ts
  • examples/react-externals/tsconfig.json
  • packages/react-umd/README.md
  • .changeset/react-externals-setup-umd.md

@upupming upupming force-pushed the fix-react-externals-umd-setup branch 4 times, most recently from 0dfe253 to b52efbf Compare March 11, 2026 11:44
@upupming upupming force-pushed the fix-react-externals-umd-setup branch from b52efbf to bd41528 Compare March 11, 2026 11:45
Comment thread packages/react-umd/package.json
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

🧹 Nitpick comments (1)
examples/react-externals/lynx.config.ts (1)

51-62: Bundle filename is hardcoded to development build.

The path react-dev.lynx.bundle is hardcoded, but the packages/react-umd/rslib.config.ts generates different filenames based on NODE_ENV (react-dev.lynx.bundle for development, react-prod.lynx.bundle for production). If someone runs this example with NODE_ENV=production, the dev server will fail to find the bundle.

Consider making the bundle path environment-aware:

♻️ Proposed fix
 if (req.url === '/react.lynx.bundle') {
+  const bundleName = process.env.NODE_ENV === 'production'
+    ? 'react-prod.lynx.bundle'
+    : 'react-dev.lynx.bundle';
   const bundlePath = path.resolve(
     __dirname,
-    '../../packages/react-umd/dist/react-dev.lynx.bundle',
+    `../../packages/react-umd/dist/${bundleName}`,
   );
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@examples/react-externals/lynx.config.ts` around lines 51 - 62, The dev server
is hardcoded to serve "react-dev.lynx.bundle" which breaks when
NODE_ENV=production; update the bundlePath logic in the request handler (the
block that checks if req.url === '/react.lynx.bundle' and defines bundlePath) to
choose the filename based on process.env.NODE_ENV (e.g., use
"react-prod.lynx.bundle" for production and "react-dev.lynx.bundle" otherwise),
and optionally implement a fallback check (or try both names) before streaming
the file so the server can find the correct bundle regardless of environment.
🤖 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/react-umd/package.json`:
- Around line 32-43: The package.json scripts "build:development" and
"build:production" call rslib (via "rslib build") but rslib is not declared in
devDependencies; add an explicit devDependency entry for "rslib" (or
"@rslib/core" if you prefer that package name) to the "devDependencies" object
so the tool is installed for isolated builds—e.g., add "rslib":
"<appropriate-version>" under devDependencies alongside "rimraf" and
"cross-env".

---

Nitpick comments:
In `@examples/react-externals/lynx.config.ts`:
- Around line 51-62: The dev server is hardcoded to serve
"react-dev.lynx.bundle" which breaks when NODE_ENV=production; update the
bundlePath logic in the request handler (the block that checks if req.url ===
'/react.lynx.bundle' and defines bundlePath) to choose the filename based on
process.env.NODE_ENV (e.g., use "react-prod.lynx.bundle" for production and
"react-dev.lynx.bundle" otherwise), and optionally implement a fallback check
(or try both names) before streaming the file so the server can find the correct
bundle regardless of environment.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: df252c7f-0deb-44cb-a8fe-dd52fa7ba12d

📥 Commits

Reviewing files that changed from the base of the PR and between f0eecdb and bd41528.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (10)
  • .changeset/react-externals-setup-umd.md
  • examples/react-externals/README.md
  • examples/react-externals/lynx.config.ts
  • examples/react-externals/package.json
  • examples/react-externals/tsconfig.json
  • packages/react-umd/README.md
  • packages/react-umd/package.json
  • packages/react-umd/rslib.config.ts
  • packages/react-umd/src/index.ts
  • pnpm-workspace.yaml
🚧 Files skipped from review as they are similar to previous changes (4)
  • pnpm-workspace.yaml
  • examples/react-externals/tsconfig.json
  • examples/react-externals/README.md
  • examples/react-externals/package.json

Comment thread packages/react-umd/package.json
@codspeed-hq
Copy link
Copy Markdown

codspeed-hq bot commented Mar 11, 2026

Merging this PR will not alter performance

✅ 72 untouched benchmarks
⏩ 3 skipped benchmarks1


Comparing fix-react-externals-umd-setup (bd41528) with main (ed566f0)

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.

luhc228
luhc228 previously approved these changes Mar 11, 2026
@relativeci
Copy link
Copy Markdown

relativeci bot commented Mar 11, 2026

Web Explorer

#8127 Bundle Size — 384.5KiB (0%).

71c50f0(current) vs ed566f0 main#8118(baseline)

Bundle metrics  Change 1 change
                 Current
#8127
     Baseline
#8118
No change  Initial JS 155.59KiB 155.59KiB
No change  Initial CSS 35.1KiB 35.1KiB
No change  Cache Invalidation 0% 0%
No change  Chunks 8 8
No change  Assets 8 8
Change  Modules 238(+0.42%) 237
No change  Duplicate Modules 16 16
No change  Duplicate Code 2.98% 2.98%
No change  Packages 4 4
No change  Duplicate Packages 0 0
Bundle size by type  no changes
                 Current
#8127
     Baseline
#8118
No change  JS 253.55KiB 253.55KiB
No change  Other 95.85KiB 95.85KiB
No change  CSS 35.1KiB 35.1KiB

Bundle analysis reportBranch fix-react-externals-umd-setupProject dashboard


Generated by RelativeCIDocumentationReport issue

colinaaa
colinaaa previously approved these changes Mar 12, 2026
@upupming upupming dismissed stale reviews from colinaaa and luhc228 via 71c50f0 March 12, 2026 04:13
@codspeed-hq
Copy link
Copy Markdown

codspeed-hq bot commented Mar 12, 2026

Unable to generate the performance report

There was an internal error while processing the run's data. We're working on fixing the issue. Feel free to contact us on Discord or at support@codspeed.io if the issue persists.

@upupming upupming merged commit 39fdf1a into main Mar 12, 2026
129 of 139 checks passed
@upupming upupming deleted the fix-react-externals-umd-setup branch March 12, 2026 06:55
colinaaa pushed a commit that referenced this pull request Mar 24, 2026
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.117.0

### Minor Changes

- feat: export `GlobalPropsProvider`, `GlobalPropsConsumer`,
`useGlobalProps` and `useGlobalPropsChanged` for `__globalProps`
([#2346](#2346))

- `GlobalPropsProvider`: A Provider component that accepts `children`.
It is used to provide the `lynx.__globalProps` context.
- `GlobalPropsConsumer`: A Consumer component that accepts a function as
a child. It is used to consume the `lynx.__globalProps` context.
- `useGlobalProps`: A hook that returns the `lynx.__globalProps` object.
It triggers a re-render when `lynx.__globalProps` changes.
- `useGlobalPropsChanged`: A hook that accepts a callback function. The
callback is invoked when `lynx.__globalProps` changes.

Note: When `globalPropsMode` is not set to `'event'` (default is
`'reactive'`), these APIs will be ineffective (pass-through) and will
log a warning in development mode, as updates are triggered
automatically by full re-render.

- **BREAKING CHANGE**:
([#2319](#2319))

Change preact package from `@hongzhiyuan/preact` to
`@lynx-js/internal-preact`.

Upgrade preact from
[f7693b72](preactjs/preact@f7693b7)
to
[55254ef7](preactjs/preact@55254ef),
see diffs at
[f7693b72...55254ef7](https://github.com/preactjs/preact/compare/f7693b72ecb4a40c66e6e47f54e2d4edc374c9f0...preactjs:preact:55254ef7021e563cc1a86fb816058964a1b6a29a?expand=1).

- feat: add `globalPropsMode` option to `PluginReactLynxOptions`
([#2346](#2346))

- When configured to `"event"`, `updateGlobalProps` will only trigger a
global event and skip the `runWithForce` flow.
- Defaults to `"reactive"`, which means `updateGlobalProps` will trigger
re-render automatically.

### Patch Changes

- Add `__BACKGROUND__` guard on `onBackgroundSnapshotInstanceUpdateId`
event to prevent bundling to main-thread on dev environment.
([#2332](#2332))

- refactor: extract static string in template literal
([#2334](#2334))

- fix: avoid crash when spread undefined ref
([#2333](#2333))

- Avoid registering lifecycle refs for main-thread functions (MTF) that
have not received an `execId` during `renderPage()` first-screen
binding. ([#2320](#2320))

## @lynx-js/react-umd@0.117.0

### Minor Changes

- Add standalone UMD build of the ReactLynx runtime.
([#2331](#2331))

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

### Minor Changes

- **BREAKING CHANGE**:
([#2319](#2319))

Change preact package from `@hongzhiyuan/preact` to
`@lynx-js/internal-preact`.

Upgrade preact from
[f7693b72](preactjs/preact@f7693b7)
to
[55254ef7](preactjs/preact@55254ef),
see diffs at
[f7693b72...55254ef7](https://github.com/preactjs/preact/compare/f7693b72ecb4a40c66e6e47f54e2d4edc374c9f0...preactjs:preact:55254ef7021e563cc1a86fb816058964a1b6a29a?expand=1).

- feat: add `globalPropsMode` option to `PluginReactLynxOptions`
([#2346](#2346))

- When configured to `"event"`, `updateGlobalProps` will only trigger a
global event and skip the `runWithForce` flow.
- Defaults to `"reactive"`, which means `updateGlobalProps` will trigger
re-render automatically.

### Patch Changes

- Updated dependencies
\[[`f1129ea`](f1129ea),
[`27f1cff`](27f1cff),
[`ed566f0`](ed566f0),
[`402ec2b`](402ec2b)]:
    -   @lynx-js/react-webpack-plugin@0.8.0
    -   @lynx-js/react-refresh-webpack-plugin@0.3.5
    -   @lynx-js/react-alias-rsbuild-plugin@0.13.0
    -   @lynx-js/use-sync-external-store@1.5.0
    -   @lynx-js/template-webpack-plugin@0.10.6
    -   @lynx-js/css-extract-webpack-plugin@0.7.0

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

### Minor Changes

- feat: add `globalPropsMode` option to `PluginReactLynxOptions`
([#2346](#2346))

- When configured to `"event"`, `updateGlobalProps` will only trigger a
global event and skip the `runWithForce` flow.
- Defaults to `"reactive"`, which means `updateGlobalProps` will trigger
re-render automatically.

### Patch Changes

- Fix sourcemap misalignment when wrapping lazy bundle main-thread
chunks. ([#2361](#2361))

The lazy bundle IIFE wrapper is now injected in `processAssets` at
`PROCESS_ASSETS_STAGE_OPTIMIZE_SIZE + 1` by walking chunk groups instead
of patching assets in `beforeEncode`.

- With `experimental_isLazyBundle: true`, the wrapper is applied to
lazy-bundle chunk groups.
- Without lazy bundle mode, the wrapper is applied to async main-thread
chunk groups generated by dynamic import.

Injecting the wrapper in this stage keeps the emitted JS stable after
optimization while still running before `DEV_TOOLING` sourcemap
finalization, so the generated `.js` and `.js.map` stay aligned.

- Set `__DEV__` and `__PROFILE__` to `true` on `NODE_ENV ===
'development'`.
([#2324](#2324))

## @lynx-js/rspeedy@0.13.6

### Patch Changes

- Rename Web Preview label to fix URL alignment
([#2355](#2355))

- Updated dependencies
\[[`799fda8`](799fda8)]:
    -   @lynx-js/cache-events-webpack-plugin@0.0.3
    -   @lynx-js/web-rsbuild-server-middleware@0.19.9

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

### Patch Changes

- Fix snapshot not found error when dev with external bundle
([#2316](#2316))

## @lynx-js/external-bundle-rsbuild-plugin@0.0.4

### Patch Changes

- Updated dependencies
\[[`ed566f0`](ed566f0)]:
    -   @lynx-js/externals-loading-webpack-plugin@0.0.5

## @lynx-js/kitten-lynx-test-infra@0.1.1

### Patch Changes

- feat: support page.screenshot()
([#2364](#2364))

- feat: initial commit
([#2272](#2272))

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

### Patch Changes

- Implement `__ElementAnimate` PAPI for web platform animation lifecycle
([#2329](#2329))

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

### Patch Changes

- Implement `__ElementAnimate` PAPI for web platform animation lifecycle
([#2329](#2329))

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

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

### Patch Changes

- Updated dependencies
\[[`2efecc2`](2efecc2)]:
    -   @lynx-js/web-constants@0.19.9
    -   @lynx-js/web-mainthread-apis@0.19.9
    -   @lynx-js/web-worker-runtime@0.19.9
    -   @lynx-js/web-worker-rpc@0.19.9

## @lynx-js/web-core-wasm@0.0.6

### Patch Changes

- reexports essential utils & types in @lynx-js/web-elements from
@lynx-js/web-core-wasm/client
([#2321](#2321))

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

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

### Patch Changes

- Updated dependencies
\[[`2efecc2`](2efecc2)]:
    -   @lynx-js/web-constants@0.19.9

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

### Patch Changes

- Updated dependencies
\[[`2efecc2`](2efecc2)]:
    -   @lynx-js/web-constants@0.19.9
    -   @lynx-js/web-mainthread-apis@0.19.9
    -   @lynx-js/web-worker-rpc@0.19.9

## @lynx-js/cache-events-webpack-plugin@0.0.3

### Patch Changes

- Cache `globalThis.loadDynamicComponent` in the cache events runtime
and add tests covering tt methods, performance events, and globalThis
replay behavior.
([#2343](#2343))

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

### Patch Changes

- Fix snapshot not found error when dev with external bundle
([#2316](#2316))

## @lynx-js/react-refresh-webpack-plugin@0.3.5

### Patch Changes

- Fix snapshot not found error when dev with external bundle
([#2316](#2316))

## @lynx-js/template-webpack-plugin@0.10.6

### Patch Changes

- Updated dependencies
\[[`d034dae`](d034dae)]:
    -   @lynx-js/web-core-wasm@0.0.6

## create-rspeedy@0.13.6



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



## upgrade-rspeedy@0.13.6



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



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



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

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

None yet

Development

Successfully merging this pull request may close these issues.

3 participants