Skip to content

fix(react/runtime): disable MTS hmr#512

Merged
Yradex merged 1 commit intolynx-family:mainfrom
Yradex:mts/disable-hmr
Apr 11, 2025
Merged

fix(react/runtime): disable MTS hmr#512
Yradex merged 1 commit intolynx-family:mainfrom
Yradex:mts/disable-hmr

Conversation

@Yradex
Copy link
Copy Markdown
Collaborator

@Yradex Yradex commented Apr 9, 2025

Summary

This PR disables the MTS (Main Thread Script) HMR (Hot Module Replacement) functionality in the React runtime. The change was made to address stability issues with the current HMR implementation.

This is a temporary fix to prevent potential issues while a more robust solution is being developed.

Checklist

  • Tests updated (or not required)
  • Documentation updated (or not required)

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Apr 9, 2025

🦋 Changeset detected

Latest commit: 7cb3819

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

@Yradex Yradex requested a review from Copilot April 9, 2025 03:10
Copy link
Copy Markdown
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.

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

@Yradex Yradex force-pushed the mts/disable-hmr branch from 1cd8c3b to 41763de Compare April 9, 2025 03:17
@codspeed-hq
Copy link
Copy Markdown

codspeed-hq bot commented Apr 9, 2025

CodSpeed Performance Report

Merging #512 will not alter performance

Comparing Yradex:mts/disable-hmr (7cb3819) with main (d3b561b)

Summary

✅ 1 untouched benchmarks

@Yradex Yradex force-pushed the mts/disable-hmr branch 2 times, most recently from 259e899 to 563033f Compare April 9, 2025 03:29
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 9, 2025

Codecov Report

Attention: 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/runtime/src/worklet/hmr.ts 0.00% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@Yradex Yradex force-pushed the mts/disable-hmr branch from 563033f to 4d57c45 Compare April 9, 2025 03:45
@Yradex Yradex force-pushed the mts/disable-hmr branch from 4d57c45 to 7cb3819 Compare April 9, 2025 03:51
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 9, 2025

Bundle Report

Changes will decrease total bundle size by 47 bytes (-0.01%) ⬇️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
@lynx-js/example-react-lynx-cjs 316.79kB -47 bytes (-0.01%) ⬇️

Affected Assets, Files, and Routes:

view changes for bundle: @lynx-js/example-react-lynx-cjs

Assets Changed:

Asset Name Size Change Total Size Change (%)
main.lynx.bundle -15 bytes 87.49kB -0.02%
.rspeedy/main/main-thread.js -32 bytes 39.64kB -0.08%

@Yradex Yradex requested review from colinaaa and hzy April 10, 2025 03:05
@Yradex Yradex enabled auto-merge April 10, 2025 03:10
@Yradex Yradex added this pull request to the merge queue Apr 11, 2025
Merged via the queue into lynx-family:main with commit 7169fa1 Apr 11, 2025
22 checks passed
@Yradex Yradex deleted the mts/disable-hmr branch April 11, 2025 07:03
colinaaa pushed a commit that referenced this pull request Apr 11, 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/web-core@0.11.0

### Minor Changes

- feat: upgrade @lynx-js/lynx-core to 0.1.2
([#465](#465))

    refactor some internal logic

    -   \_\_OnLifeCycleEvent
    -   \_\_OnNativeAppReady

### Patch Changes

- feat: support mts event handler (1/n)
([#495](#495))

now the main-thread:bind handler could be invoked. The params of the
handler will be implemented later.

- feat: allow multi lynx-view to share bts worker
([#520](#520))

Now we allow users to enable so-called "shared-context" feature on the
Web Platform.

Similar to the same feature for Lynx iOS/Android, this feature let multi
lynx cards to share one js context.

The `lynx.getSharedData` and `lynx.setSharedData` are also supported in
this commit.

To enable this feature, set property `lynxGroupId` or attribute
`lynx-group-id` before a lynx-view starts rendering. Those card with
same context id will share one web worker for the bts scripts.

- perf: dispatchLynxViewEventEndpoint is a void call
([#506](#506))

- Updated dependencies
\[[`ea42e62`](ea42e62),
[`a0f5ca4`](a0f5ca4)]:
    -   @lynx-js/web-worker-runtime@0.11.0
    -   @lynx-js/web-constants@0.11.0
    -   @lynx-js/web-worker-rpc@0.11.0

## @lynx-js/react@0.106.4

### Patch Changes

- Disable MTS HMR functionality temporarily to address stability issues.
This is a temporary fix while we work on a more robust solution.
([#512](#512))

## @lynx-js/rspeedy@0.9.1

### Patch Changes

- Bump Rsbuild v1.3.5 with Rspack v1.3.3.
([#467](#467))

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

### Patch Changes

- Updated dependencies
\[[`ea42e62`](ea42e62),
[`12e3afe`](12e3afe)]:
    -   @lynx-js/web-webpack-plugin@0.6.4
    -   @lynx-js/template-webpack-plugin@0.6.9
    -   @lynx-js/react-alias-rsbuild-plugin@0.9.6
    -   @lynx-js/react-refresh-webpack-plugin@0.3.2
    -   @lynx-js/react-webpack-plugin@0.6.10
    -   @lynx-js/css-extract-webpack-plugin@0.5.3

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

### Patch Changes

- feat: support mts event handler (1/n)
([#495](#495))

now the main-thread:bind handler could be invoked. The params of the
handler will be implemented later.

- feat: allow multi lynx-view to share bts worker
([#520](#520))

Now we allow users to enable so-called "shared-context" feature on the
Web Platform.

Similar to the same feature for Lynx iOS/Android, this feature let multi
lynx cards to share one js context.

The `lynx.getSharedData` and `lynx.setSharedData` are also supported in
this commit.

To enable this feature, set property `lynxGroupId` or attribute
`lynx-group-id` before a lynx-view starts rendering. Those card with
same context id will share one web worker for the bts scripts.

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

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

### Patch Changes

- chore: bump the output target to es2024
([#518](#518))

- fix: the `\n` character should create a new line
([#522](#522))

    add `white-space-collapse: preserve-breaks` to raw-text

- fix: the `input` event of x-input with number type should have raw
value ([#517](#517))

    For `type:=number` x-input with typed value "2."

    Before this commit: the value is "2"

    After this commit the value is "2."

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

### Patch Changes

- feat: add a touch emulator that allows the explorer to respond to
touch events triggered by mouse events
([#516](#516))

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

### Patch Changes

- feat: support mts event handler (1/n)
([#495](#495))

now the main-thread:bind handler could be invoked. The params of the
handler will be implemented later.

- Updated dependencies
\[[`ea42e62`](ea42e62),
[`a0f5ca4`](a0f5ca4)]:
    -   @lynx-js/web-constants@0.11.0

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

### Patch Changes

- feat: support mts event handler (1/n)
([#495](#495))

now the main-thread:bind handler could be invoked. The params of the
handler will be implemented later.

- feat: allow multi lynx-view to share bts worker
([#520](#520))

Now we allow users to enable so-called "shared-context" feature on the
Web Platform.

Similar to the same feature for Lynx iOS/Android, this feature let multi
lynx cards to share one js context.

The `lynx.getSharedData` and `lynx.setSharedData` are also supported in
this commit.

To enable this feature, set property `lynxGroupId` or attribute
`lynx-group-id` before a lynx-view starts rendering. Those card with
same context id will share one web worker for the bts scripts.

- Updated dependencies
\[[`ea42e62`](ea42e62),
[`a0f5ca4`](a0f5ca4)]:
    -   @lynx-js/web-mainthread-apis@0.11.0
    -   @lynx-js/web-constants@0.11.0
    -   @lynx-js/web-worker-rpc@0.11.0

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

### Patch Changes

- Fix incorrect hash of `background.[contenthash].js` in `.lynx.bundle`
files. ([#498](#498))

## @lynx-js/web-webpack-plugin@0.6.4

### Patch Changes

- feat: support mts event handler (1/n)
([#495](#495))

now the main-thread:bind handler could be invoked. The params of the
handler will be implemented later.

## create-rspeedy@0.9.1



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



## upgrade-rspeedy@0.9.1



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

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants