Skip to content

fix: export catalog jsx components#2734

Merged
HuJean merged 1 commit into
mainfrom
p/fix-catalog
May 28, 2026
Merged

fix: export catalog jsx components#2734
HuJean merged 1 commit into
mainfrom
p/fix-catalog

Conversation

@HuJean
Copy link
Copy Markdown
Collaborator

@HuJean HuJean commented May 28, 2026

Summary by CodeRabbit

  • Bug Fixes
    • Fixed export of catalog JSX components to ensure proper module resolution and component availability.

Review Change Stack

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 May 28, 2026

🦋 Changeset detected

Latest commit: 857aa37

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/genui 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
Copy Markdown
Contributor

coderabbitai Bot commented May 28, 2026

📝 Walkthrough

Walkthrough

This PR refactors the GenUI A2UI package to properly export JSX components using explicit .jsx file extensions. The TypeScript build configuration is updated from automatic JSX transformation to JSX preservation, and all imports and public exports throughout the React and catalog modules are updated to reference .jsx entry points.

Changes

Catalog JSX Component Export Refactor

Layer / File(s) Summary
TypeScript build configuration for JSX preservation
packages/genui/a2ui/tsconfig.build.json
The compilerOptions.jsx is changed from "react-jsx" to "preserve" to emit JSX syntax as-is, supporting the use of explicit .jsx file extensions.
React core module exports and imports
packages/genui/a2ui/src/react/A2UI.tsx, packages/genui/a2ui/src/react/useA2UIContext.ts, packages/genui/a2ui/src/react/index.ts
Local imports in A2UI.tsx and useA2UIContext.ts are updated to reference .jsx extensions, and public re-exports in react/index.ts are updated to export A2UI, A2UIProps, and NodeRenderer from .jsx entry points.
Catalog component imports and re-exports
packages/genui/a2ui/src/catalog/Button/index.tsx, packages/genui/a2ui/src/catalog/Card/index.tsx, packages/genui/a2ui/src/catalog/Column/index.tsx, packages/genui/a2ui/src/catalog/List/index.tsx, packages/genui/a2ui/src/catalog/Modal/index.tsx, packages/genui/a2ui/src/catalog/Row/index.tsx, packages/genui/a2ui/src/catalog/Tabs/index.tsx, packages/genui/a2ui/src/catalog/index.ts
All catalog components update their imports of A2UIRenderer/NodeRenderer to use .jsx paths; catalog/index.ts re-exports all 19 catalog components from their respective .jsx index entry points.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

  • lynx-family/lynx-stack#2712: Both PRs modify the same GenUI A2UI React and catalog modules by changing A2UIRenderer/NodeRenderer import specifiers between .js and .jsx extensions.

Suggested reviewers

  • gaoachao
  • PupilTong
  • Sherry-hue

Poem

🐰 From dot-js to dot-jsx we go,
Preserving JSX, watch it flow,
Catalog components, shiny and new,
Explicit extensions, crystal clear true! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically summarizes the main change: updating export paths from .js to .jsx for catalog components throughout the codebase.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch p/fix-catalog

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.

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.

🧹 Nitpick comments (1)
packages/genui/a2ui/src/react/A2UI.tsx (1)

16-18: ⚡ Quick win

Align A2UIRenderer type import extension with the .jsx refactor.

A2UI.tsx now imports A2UIRenderer/UnsupportedInfo from ./A2UIRenderer.jsx, but the type annotation still uses import('./A2UIRenderer.js').A2UIRendererProps (around line 261). Keep the specifier consistent (e.g., switch to ./A2UIRenderer.jsx) to avoid resolution/drift issues.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/genui/a2ui/src/react/A2UI.tsx` around lines 16 - 18, Update the type
import specifier to match the refactorded JSX module: change any type reference
using import('./A2UIRenderer.js').A2UIRendererProps to
import('./A2UIRenderer.jsx').A2UIRendererProps so it aligns with the runtime
imports of A2UIRenderer and UnsupportedInfo in A2UI.tsx; search for symbols
A2UIRenderer, UnsupportedInfo, and A2UIRendererProps in the file and update the
import specifier accordingly to avoid resolution drift.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@packages/genui/a2ui/src/react/A2UI.tsx`:
- Around line 16-18: Update the type import specifier to match the refactorded
JSX module: change any type reference using
import('./A2UIRenderer.js').A2UIRendererProps to
import('./A2UIRenderer.jsx').A2UIRendererProps so it aligns with the runtime
imports of A2UIRenderer and UnsupportedInfo in A2UI.tsx; search for symbols
A2UIRenderer, UnsupportedInfo, and A2UIRendererProps in the file and update the
import specifier accordingly to avoid resolution drift.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: afcd8d7a-0cf4-427a-adb2-055688498d0d

📥 Commits

Reviewing files that changed from the base of the PR and between ec73c30 and 857aa37.

📒 Files selected for processing (13)
  • .changeset/sad-knives-return.md
  • packages/genui/a2ui/src/catalog/Button/index.tsx
  • packages/genui/a2ui/src/catalog/Card/index.tsx
  • packages/genui/a2ui/src/catalog/Column/index.tsx
  • packages/genui/a2ui/src/catalog/List/index.tsx
  • packages/genui/a2ui/src/catalog/Modal/index.tsx
  • packages/genui/a2ui/src/catalog/Row/index.tsx
  • packages/genui/a2ui/src/catalog/Tabs/index.tsx
  • packages/genui/a2ui/src/catalog/index.ts
  • packages/genui/a2ui/src/react/A2UI.tsx
  • packages/genui/a2ui/src/react/index.ts
  • packages/genui/a2ui/src/react/useA2UIContext.ts
  • packages/genui/a2ui/tsconfig.build.json

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented May 28, 2026

Open in StackBlitz

npm i https://pkg.pr.new/@lynx-js/genui@2734

commit: 857aa37

@codecov
Copy link
Copy Markdown

codecov Bot commented May 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!

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented May 28, 2026

Merging this PR will improve performance by 5.06%

⚠️ Different runtime environments detected

Some benchmarks with significant performance changes were compared across different runtime environments,
which may affect the accuracy of the results.

Open the report in CodSpeed to investigate

⚡ 1 improved benchmark
✅ 80 untouched benchmarks
⏩ 26 skipped benchmarks1

Performance Changes

Benchmark BASE HEAD Efficiency
002-hello-reactLynx-destroyBackground 943.9 µs 898.4 µs +5.06%

Tip

Curious why this is faster? Comment @codspeedbot explain why this is faster on this PR, or directly use the CodSpeed MCP with your agent.


Comparing p/fix-catalog (857aa37) with main (f38e285)2

Open in CodSpeed

Footnotes

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

  2. No successful run was found on main (ec73c30) during the generation of this report, so f38e285 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@github-actions
Copy link
Copy Markdown
Contributor

UI Judge

GEQI weighted score: 61 / 100 across 8 examples.
Average visual-correctness score: 3.3 / 5.

Dimension Weight Average Results Status
Usability & Interaction 30% 2.9 / 5 8 OK
Visual & Aesthetics 25% 3.1 / 5 8 OK
Consistency & Standards 15% 3.3 / 5 8 OK
Architecture & UX Writing 15% 3.1 / 5 8 OK
Accessibility & Performance 15% 3 / 5 8 OK
# Example Visual Correctness Usability & Interaction (30%) Visual & Aesthetics (25%) Consistency & Standards (15%) Architecture & UX Writing (15%) Accessibility & Performance (15%) GEQI Page Status
1 recs 2 / 5 2 / 5 3 / 5 2 / 5 2 / 5 2 / 5 45 / 100 preview OK
2 cast-grid 5 / 5 3 / 5 4 / 5 4 / 5 5 / 5 3 / 5 74 / 100 preview OK
3 citywalk-list 2 / 5 3 / 5 3 / 5 3 / 5 2 / 5 3 / 5 57 / 100 preview OK
4 fridge-search 3 / 5 3 / 5 3 / 5 4 / 5 3 / 5 4 / 5 66 / 100 preview OK
5 trip-planner 2 / 5 2 / 5 2 / 5 2 / 5 2 / 5 3 / 5 43 / 100 preview OK
6 weather-current 5 / 5 4 / 5 4 / 5 5 / 5 5 / 5 3 / 5 83 / 100 preview OK
7 product-card 5 / 5 4 / 5 4 / 5 4 / 5 4 / 5 4 / 5 80 / 100 preview OK
8 workout-plan 2 / 5 2 / 5 2 / 5 2 / 5 2 / 5 2 / 5 40 / 100 preview OK
Details

Result 1

  • Example: recs
  • Dimension: visual-correctness
  • Visual correctness: 2 / 5
  • GEQI dimensions:
    • Usability & Interaction: 2 / 5 (30%)
    • Visual & Aesthetics: 3 / 5 (25%)
    • Consistency & Standards: 2 / 5 (15%)
    • Architecture & UX Writing: 2 / 5 (15%)
    • Accessibility & Performance: 2 / 5 (15%)
  • Task: The A2UI playground preview should show date-night dining recommendations for Moonlight Terrace, Pinewood Bistro, and Sea Breeze Kitchen.

Result 2

  • Example: cast-grid
  • Dimension: visual-correctness
  • Visual correctness: 5 / 5
  • GEQI dimensions:
    • Usability & Interaction: 3 / 5 (30%)
    • Visual & Aesthetics: 4 / 5 (25%)
    • Consistency & Standards: 4 / 5 (15%)
    • Architecture & UX Writing: 5 / 5 (15%)
    • Accessibility & Performance: 3 / 5 (15%)
  • Task: The A2UI playground preview should show a cast grid for the short film Night Notes, including Lin Xia and Zhou Ning cast cards.

Result 3

  • Example: citywalk-list
  • Dimension: visual-correctness
  • Visual correctness: 2 / 5
  • GEQI dimensions:
    • Usability & Interaction: 3 / 5 (30%)
    • Visual & Aesthetics: 3 / 5 (25%)
    • Consistency & Standards: 3 / 5 (15%)
    • Architecture & UX Writing: 2 / 5 (15%)
    • Accessibility & Performance: 3 / 5 (15%)
  • Task: The A2UI playground preview should show weekend citywalk coffee picks with Rooftop Brew Room, Corner Canvas Lab, and Late Sun Roastery.

Result 4

  • Example: fridge-search
  • Dimension: visual-correctness
  • Visual correctness: 3 / 5
  • GEQI dimensions:
    • Usability & Interaction: 3 / 5 (30%)
    • Visual & Aesthetics: 3 / 5 (25%)
    • Consistency & Standards: 4 / 5 (15%)
    • Architecture & UX Writing: 3 / 5 (15%)
    • Accessibility & Performance: 4 / 5 (15%)
  • Task: The A2UI playground preview should show refrigerator search results with Siemens, Hualing, Haier, and Midea product cards.

Result 5

  • Example: trip-planner
  • Dimension: visual-correctness
  • Visual correctness: 2 / 5
  • GEQI dimensions:
    • Usability & Interaction: 2 / 5 (30%)
    • Visual & Aesthetics: 2 / 5 (25%)
    • Consistency & Standards: 2 / 5 (15%)
    • Architecture & UX Writing: 2 / 5 (15%)
    • Accessibility & Performance: 3 / 5 (15%)
  • Task: The A2UI playground preview should show a Kyoto 48-hour trip planner with Day 1 and Day 2 itinerary sections, including Monkey Park Viewpoint.

Result 6

  • Example: weather-current
  • Dimension: visual-correctness
  • Visual correctness: 5 / 5
  • GEQI dimensions:
    • Usability & Interaction: 4 / 5 (30%)
    • Visual & Aesthetics: 4 / 5 (25%)
    • Consistency & Standards: 5 / 5 (15%)
    • Architecture & UX Writing: 5 / 5 (15%)
    • Accessibility & Performance: 3 / 5 (15%)
  • Task: The A2UI playground preview should show the current weather for Austin, TX, including clear skies with light breeze.

Result 7

  • Example: product-card
  • Dimension: visual-correctness
  • Visual correctness: 5 / 5
  • GEQI dimensions:
    • Usability & Interaction: 4 / 5 (30%)
    • Visual & Aesthetics: 4 / 5 (25%)
    • Consistency & Standards: 4 / 5 (15%)
    • Architecture & UX Writing: 4 / 5 (15%)
    • Accessibility & Performance: 4 / 5 (15%)
  • Task: The A2UI playground preview should show a Wireless Headphones Pro product card with a visible Add to Cart action.

Result 8

  • Example: workout-plan
  • Dimension: visual-correctness
  • Visual correctness: 2 / 5
  • GEQI dimensions:
    • Usability & Interaction: 2 / 5 (30%)
    • Visual & Aesthetics: 2 / 5 (25%)
    • Consistency & Standards: 2 / 5 (15%)
    • Architecture & UX Writing: 2 / 5 (15%)
    • Accessibility & Performance: 2 / 5 (15%)
  • Task: The A2UI playground preview should show a weekly workout plan with five days from Monday Ramp-Up through Friday Conditioning.

Workflow run

@HuJean HuJean enabled auto-merge (squash) May 28, 2026 03:18
@HuJean HuJean merged commit 6f06293 into main May 28, 2026
77 of 79 checks passed
@HuJean HuJean deleted the p/fix-catalog branch May 28, 2026 03:25
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