feat(react): export use from @lynx-js/react/compat - #3672
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Team Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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. Comment |
3de5ccf to
6ce2cdf
Compare
🦋 Changeset detectedLatest commit: 1412861 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
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 |
background-only
@lynx-js/genui
@lynx-js/react
@lynx-js/react-signals
@lynx-js/react-umd
@lynx-js/use-sync-external-store
@lynx-js/debug-metadata-rsbuild-plugin
@lynx-js/rsbuild-plugin
@lynx-js/react-rsbuild-plugin
@lynx-js/react-alias-rsbuild-plugin
@lynx-js/websocket
@lynx-js/css-serializer
@lynx-js/debug-metadata
@lynx-js/web-core
@lynx-js/web-elements
@lynx-js/web-rsbuild-server-middleware
@lynx-js/web-worker-rpc
@lynx-js/cache-events-webpack-plugin
@lynx-js/chunk-loading-webpack-plugin
@lynx-js/css-extract-webpack-plugin
@lynx-js/react-refresh-webpack-plugin
@lynx-js/react-webpack-plugin
@lynx-js/runtime-wrapper-webpack-plugin
@lynx-js/template-webpack-plugin
@lynx-js/webpack-dev-transport
@lynx-js/webpack-runtime-globals
commit: |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
React MTF Example#4966 Bundle Size — 210.53KiB (0%).1412861(current) vs fdfdfdd feat/preact-v11#4962(baseline) Bundle metrics
|
| Current #4966 |
Baseline #4962 |
|
|---|---|---|
0B |
0B |
|
0B |
0B |
|
0% |
47.04% |
|
0 |
0 |
|
3 |
3 |
|
215 |
215 |
|
82 |
82 |
|
42.99% |
42.99% |
|
2 |
2 |
|
0 |
0 |
Bundle size by type no changes
| Current #4966 |
Baseline #4962 |
|
|---|---|---|
111.23KiB |
111.23KiB |
|
99.3KiB |
99.3KiB |
Bundle analysis report Branch feat/compat-use Project dashboard
Generated by RelativeCI Documentation Report issue
Web Explorer#13435 Bundle Size — 1.29MiB (0%).1412861(current) vs fdfdfdd feat/preact-v11#13431(baseline) Bundle metrics
Bundle size by type
|
| Current #13435 |
Baseline #13431 |
|
|---|---|---|
756.75KiB |
756.75KiB |
|
564.93KiB |
564.93KiB |
|
2.37KiB |
2.37KiB |
Bundle analysis report Branch feat/compat-use Project dashboard
Generated by RelativeCI Documentation Report issue
React Example with Element Template#4106 Bundle Size — 227.23KiB (0%).1412861(current) vs fdfdfdd feat/preact-v11#4102(baseline) Bundle metrics
|
| Current #4106 |
Baseline #4102 |
|
|---|---|---|
0B |
0B |
|
0B |
0B |
|
0% |
35.79% |
|
0 |
0 |
|
4 |
4 |
|
175 |
175 |
|
62 |
62 |
|
36.46% |
36.46% |
|
2 |
2 |
|
0 |
0 |
Bundle size by type no changes
| Current #4106 |
Baseline #4102 |
|
|---|---|---|
145.76KiB |
145.76KiB |
|
81.47KiB |
81.47KiB |
Bundle analysis report Branch feat/compat-use Project dashboard
Generated by RelativeCI Documentation Report issue
React Example#11848 Bundle Size — 239.05KiB (0%).1412861(current) vs fdfdfdd feat/preact-v11#11844(baseline) Bundle metrics
|
| Current #11848 |
Baseline #11844 |
|
|---|---|---|
0B |
0B |
|
0B |
0B |
|
0% |
38.96% |
|
0 |
0 |
|
4 |
4 |
|
220 |
220 |
|
85 |
85 |
|
43.55% |
43.55% |
|
2 |
2 |
|
0 |
0 |
Bundle size by type no changes
| Current #11848 |
Baseline #11844 |
|
|---|---|---|
145.76KiB |
145.76KiB |
|
93.29KiB |
93.29KiB |
Bundle analysis report Branch feat/compat-use Project dashboard
Generated by RelativeCI Documentation Report issue
Merging this PR will improve performance by 6.25%
|
| Mode | Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|---|
| ⚡ | WallTime | 003-hello-list__main-thread-processData |
1.8 µs | 1.6 µs | +6.7% |
| ⚡ | WallTime | 007-four-layer-views__main-thread-processData |
1.6 µs | 1.6 µs | +5.8% |
Tip
Curious why performance improved? Comment @codspeedbot explain why performance improved on this PR, or directly use the CodSpeed MCP with your agent.
Comparing feat/compat-use (1412861) with feat/preact-v11 (fdfdfdd)
Footnotes
-
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. ↩
React External#4947 Bundle Size — 583.86KiB (+0.13%).1412861(current) vs fdfdfdd feat/preact-v11#4943(baseline) Bundle metrics
Bundle size by type
Bundle analysis report Branch feat/compat-use Project dashboard Generated by RelativeCI Documentation Report issue |
6ce2cdf to
1e73a80
Compare
df98d63 to
a329f3b
Compare
Preact ships `use` in compat but ReactLynx did not forward it, so cards could not read a promise or a context during render. Covers both resources: a context read (including the default value and a conditional call) and a promise that suspends to a Suspense boundary and then renders its resolved value.
a329f3b to
1412861
Compare
Stacked on #3450 — review that one first; this branch targets
feat/preact-v11and will retarget tomainonce it lands.What
Forward Preact's
usethrough@lynx-js/react/compat, alongside thestartTransition/useTransitionthat are already there.Why
usereads a resource during render and, unlike the other hooks, may be called conditionally. Given a context it returns the current value; given a promise it returns the resolved value, suspending to the nearestSuspenseboundary while pending. Preact has shipped it in compat all along — ReactLynx just never forwarded it, so cards had no way to reach it.Tests
__test__/snapshot/compat/use.test.jsxcovers both resource kinds against the real ReactLynx background runtime: a context read, the default value outside a provider, a conditional call, and a promise that suspends and then renders its resolved value.The lazy-bundle variant (
lazy/compat.js) and the export-count assertion incompat/export.test.jsxare updated to match.