feat: export constants in @lynx-js/react/constants#2451
Conversation
🦋 Changeset detectedLatest commit: 4f000e3 The changes in this PR will be included in the next version bump. This PR includes changesets to release 5 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 |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (23)
💤 Files with no reviewable changes (2)
✅ Files skipped from review due to trivial changes (11)
🚧 Files skipped from review as they are similar to previous changes (8)
📝 WalkthroughWalkthroughAdds a public Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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 |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
packages/rspeedy/plugin-react/test/config.test.ts (1)
81-83: Strengthen non-lazy alias coverage for constants.These checks validate the non-anchored key is absent, but they don’t verify that
@lynx-js/react/constants$is actually wired in non-lazy mode. Adding a positive assertion would make this test stricter and prevent silent regressions.Proposed test hardening
expect(config.resolve.alias).not.toHaveProperty( '@lynx-js/react/constants', ) + expect(config.resolve.alias).toHaveProperty( + '@lynx-js/react/constants$', + expect.stringContaining( + '/packages/react/runtime/lib/constants.js'.replaceAll('/', path.sep), + ), + )expect(config.resolve.alias).not.toHaveProperty( '@lynx-js/react/constants', ) + expect(config.resolve.alias).toHaveProperty( + '@lynx-js/react/constants$', + expect.stringContaining( + '/packages/react/runtime/lib/constants.js'.replaceAll('/', path.sep), + ), + )Also applies to: 291-293
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/rspeedy/plugin-react/test/config.test.ts` around lines 81 - 83, The test currently asserts config.resolve.alias does not have the non-anchored key '@lynx-js/react/constants' but misses a positive check that the anchored non-lazy alias '@lynx-js/react/constants$' is present and points to the expected non-lazy module; update the assertions in the test (near the existing checks referencing config.resolve.alias) to also assert that config.resolve.alias hasOwnProperty('@lynx-js/react/constants$') and that its value equals the expected resolved path/string used for non-lazy constants (repeat the same strengthened positive assertion at the other location around lines where similar negative checks occur, previously referenced as 291-293) so the test guarantees the non-lazy alias is wired correctly.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@packages/rspeedy/plugin-react/test/config.test.ts`:
- Around line 81-83: The test currently asserts config.resolve.alias does not
have the non-anchored key '@lynx-js/react/constants' but misses a positive check
that the anchored non-lazy alias '@lynx-js/react/constants$' is present and
points to the expected non-lazy module; update the assertions in the test (near
the existing checks referencing config.resolve.alias) to also assert that
config.resolve.alias hasOwnProperty('@lynx-js/react/constants$') and that its
value equals the expected resolved path/string used for non-lazy constants
(repeat the same strengthened positive assertion at the other location around
lines where similar negative checks occur, previously referenced as 291-293) so
the test guarantees the non-lazy alias is wired correctly.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: f1be41e4-3691-4701-8404-1758c2b351f9
📒 Files selected for processing (22)
.changeset/tidy-buttons-tie.mdpackages/react-umd/src/index.tspackages/react/package.jsonpackages/react/runtime/__test__/lazy.test.jspackages/react/runtime/lazy/constants.jspackages/react/runtime/lazy/import.jspackages/react/runtime/lazy/internal.jspackages/react/runtime/lazy/target.jspackages/react/runtime/lepus/jsx-runtime/index.jspackages/react/runtime/src/constants.tspackages/react/runtime/src/internal.tspackages/react/runtime/vitest.config.tspackages/rspeedy/lynx-bundle-rslib-config/src/externalBundleRslibConfig.tspackages/rspeedy/plugin-external-bundle/src/index.tspackages/rspeedy/plugin-react-alias/src/index.tspackages/rspeedy/plugin-react-alias/test/index.test.tspackages/rspeedy/plugin-react/package.jsonpackages/rspeedy/plugin-react/test/config.test.tspackages/rspeedy/plugin-react/test/lazy.test.tspackages/webpack/react-webpack-plugin/test/cases/basic/lazy-imports/index.jsxpackages/webpack/react-webpack-plugin/test/cases/code-splitting/lazy-imports/index.jsxpackages/webpack/react-webpack-plugin/test/cases/compat/component-is/index.jsx
💤 Files with no reviewable changes (2)
- packages/react/runtime/lazy/internal.js
- packages/react/runtime/src/internal.ts
Merging this PR will not alter performance
Comparing Footnotes
|
React External#337 Bundle Size — 590.61KiB (+0.08%).4f000e3(current) vs dc3b6e0 main#330(baseline) Bundle metrics
Bundle size by type
Bundle analysis report Branch p/constants Project dashboard Generated by RelativeCI Documentation Report issue |
Web Explorer#8793 Bundle Size — 743.45KiB (0%).4f000e3(current) vs dc3b6e0 main#8786(baseline) Bundle metrics
Bundle size by type
|
| Current #8793 |
Baseline #8786 |
|
|---|---|---|
398.15KiB |
398.15KiB |
|
343.13KiB |
343.13KiB |
|
2.16KiB |
2.16KiB |
Bundle analysis report Branch p/constants Project dashboard
Generated by RelativeCI Documentation Report issue
React Example#7219 Bundle Size — 236.82KiB (0%).4f000e3(current) vs dc3b6e0 main#7212(baseline) Bundle metrics
|
| Current #7219 |
Baseline #7212 |
|
|---|---|---|
0B |
0B |
|
0B |
0B |
|
0% |
0% |
|
0 |
0 |
|
4 |
4 |
|
179 |
179 |
|
70 |
70 |
|
46.1% |
46.1% |
|
2 |
2 |
|
0 |
0 |
Bundle size by type no changes
| Current #7219 |
Baseline #7212 |
|
|---|---|---|
145.76KiB |
145.76KiB |
|
91.06KiB |
91.06KiB |
Bundle analysis report Branch p/constants Project dashboard
Generated by RelativeCI Documentation Report issue
React MTF Example#352 Bundle Size — 206.11KiB (0%).4f000e3(current) vs dc3b6e0 main#345(baseline) Bundle metrics
|
| Current #352 |
Baseline #345 |
|
|---|---|---|
0B |
0B |
|
0B |
0B |
|
0% |
0% |
|
0 |
0 |
|
3 |
3 |
|
173 |
173 |
|
67 |
67 |
|
45.76% |
45.76% |
|
2 |
2 |
|
0 |
0 |
Bundle size by type no changes
| Current #352 |
Baseline #345 |
|
|---|---|---|
111.23KiB |
111.23KiB |
|
94.88KiB |
94.88KiB |
Bundle analysis report Branch p/constants Project dashboard
Generated by RelativeCI Documentation Report issue
Summary by CodeRabbit
New Features
Chores
Checklist