Skip to content

chore(react): drop build config left over from CSS modules - #2639

Merged
ditman merged 2 commits into
a2ui-project:mainfrom
retz8:fix/react-basic-catalog-styles
Nov 3, 2026
Merged

ditman merged 2 commits into
a2ui-project:mainfrom
retz8:fix/react-basic-catalog-styles

Conversation

@retz8

@retz8 retz8 commented Sep 12, 2026 •

Copy link
Copy Markdown
Contributor

Description

With the React basic catalog removed in #2630, nothing in @a2ui/react uses CSS modules or emits .css files. Clean up the leftover build configuration:

  1. Delete src/global.d.ts (*.module.css ambient type declaration).
  2. Remove "vite/client" from compilerOptions.types in tsconfig.json.
  3. Set "sideEffects": false in package.json.
  4. Remove the "./styles/structural.css" export from package.json, which pointed to ./dist/structural.css (never generated by the build).

Pre-launch Checklist

One time:

For this PR:

  • I have updated the relevant CHANGELOG.md file.
  • I updated/added relevant documentation.
  • My code changes (if any) have tests.
  • If my branch is on a fork, I have verified that scripts/e2e_test.sh passes.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request migrates the basic catalog components (Button, ChoicePicker, Text, and TextField) from CSS modules to literal, stable 'a2ui-*' class names to resolve issues with unstyled rendering in the published package. The styles are now injected at runtime using constructable stylesheets (adoptedStyleSheets). The feedback suggests adding a fallback mechanism, such as injecting a <style> tag, for environments like JSDOM that do not support constructable stylesheets.

@github-actions github-actions Bot added the status: needs-triage auto-managed: https://github.com/a2ui-project/a2ui/blob/main/scripts/triage.mjs label Sep 12, 2026
@josemontespg

Copy link
Copy Markdown
Collaborator

@ditman this is the PR you invited in #1307 on 2026-09-12; requesting your review. One thing to weigh: the universal-components stack (#2630) deletes these four React components, so this fix is interim, which the description already acknowledges.

@github-actions github-actions Bot removed the status: needs-triage auto-managed: https://github.com/a2ui-project/a2ui/blob/main/scripts/triage.mjs label Sep 22, 2026
@jerelvelarde

Copy link
Copy Markdown
Contributor

A note for whoever closes this out: A2UI Composer currently works around this in its React sample renderer, in a2ui-project/composer#119. That's a Yarn patch on @a2ui/react, plus an explicit import of the package stylesheet, documented in .yarn/patches/README.md. Once a release with the fix is published, both should be removed and the sample moved to that version. Please leave a comment on composer#119 (or its follow-up) when that happens so it doesn't get missed.

@github-actions github-actions Bot added the status: needs-triage auto-managed: https://github.com/a2ui-project/a2ui/blob/main/scripts/triage.mjs label Sep 24, 2026
@nan-yu

nan-yu commented Sep 25, 2026

Copy link
Copy Markdown
Collaborator

@ditman Gental ping for review. Thanks!

@nan-yu nan-yu added status: needs review and removed status: needs-triage auto-managed: https://github.com/a2ui-project/a2ui/blob/main/scripts/triage.mjs labels Sep 25, 2026

@ditman ditman left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the fix!

A few requests inline. The main one is keeping page-author overrides working (see the comment on BASIC_CATALOG_CSS).

Since this removes the last CSS modules in the package, could you also fold in some small build cleanup (these files aren't in the diff, so noting them here):

  • renderers/react/tsconfig.json ~L3: drop "vite/client" from types. It only supplied *.module.css / import.meta.env typings, and neither is used in src/ or tests/ anymore.
  • renderers/react/package.json L73L75: "sideEffects": ["*.css"] can become "sideEffects": false, since no CSS ships and injection happens inside hooks.
  • renderers/react/package.json ~L68: as you pointed out, the "./styles/structural.css": "./dist/structural.css" export points at a file nothing generates. Happy for it to be removed here, or in a follow-up if you'd rather keep this PR focused.

@retz8
retz8 force-pushed the fix/react-basic-catalog-styles branch from 036af42 to cc426e2 Compare September 29, 2026 10:37
@retz8

retz8 commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor Author

Thanks for the thorough review, @ditman! I looked up your review comments and resolved them in recent commits. Also build cleanup is in separate commit cc426e2 in this PR:

  • tsconfig.json: dropped "vite/client".
  • package.json: "sideEffects": false. DateTimeInput.tsx does inject a <style> at module load, but that is only dropped when the component is unused, so it's still safe.
  • package.json: removed the ./styles/structural.css export; nothing generates that file.

@github-actions github-actions Bot added the status: needs-triage auto-managed: https://github.com/a2ui-project/a2ui/blob/main/scripts/triage.mjs label Sep 29, 2026
@nan-yu

nan-yu commented Sep 29, 2026

Copy link
Copy Markdown
Collaborator

Thanks for the update. Awaiting for another round of review from @ditman .

@nan-yu nan-yu removed the status: needs-triage auto-managed: https://github.com/a2ui-project/a2ui/blob/main/scripts/triage.mjs label Sep 29, 2026
@retz8

retz8 commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor Author

#2630 has landed and removed the React basic catalog, including the four components this PR fixed, so the styling fix no longer applies. I rebased onto main and repurposed this PR to the build cleanup @ditman asked for in review, squashed into a single commit:

  • delete src/global.d.ts (only declared *.module.css)
  • drop "vite/client" from tsconfig.json types
  • "sideEffects": false in package.json
  • remove the ./styles/structural.css export, which points at a file the build never generates

#1307 still shows as open, but its bug went away with those components, since the basic catalog now comes from @a2ui/web_core's web components. I suggest closing it along with this build cleanup.

@jerelvelarde re your note on the Composer workaround (a2ui-project/composer#119): the fix now lands through #2630 rather than this PR, so the comment on composer#119 should follow the first release that includes #2630.

@retz8
retz8 force-pushed the fix/react-basic-catalog-styles branch from cc426e2 to c03cda4 Compare October 8, 2026 09:27
@github-actions github-actions Bot added the status: needs-triage auto-managed: https://github.com/a2ui-project/a2ui/blob/main/scripts/triage.mjs label Oct 8, 2026
@josemontespg
josemontespg removed their request for review October 13, 2026 21:19
With the React basic catalog removed in a2ui-project#2630, nothing in the package
uses CSS modules or ships CSS. Remove the *.module.css declaration in
src/global.d.ts, drop "vite/client" from the tsconfig types, declare
"sideEffects": false, and remove the ./styles/structural.css export,
which points at a file the build never generates.
@retz8
retz8 force-pushed the fix/react-basic-catalog-styles branch from c03cda4 to 38fec99 Compare October 17, 2026 02:40
@ditman

ditman commented Nov 3, 2026 •

Copy link
Copy Markdown
Collaborator

Thanks for keeping up with this @retz8! For now I'm going to land this cleanup and close #1307!

Apologies this dragged too long and took a while to merge (to the point that it changed completely). Thanks again for your contribution! I hope you feel like contributing more!

@github-actions github-actions Bot removed the status: needs-triage auto-managed: https://github.com/a2ui-project/a2ui/blob/main/scripts/triage.mjs label Nov 3, 2026

@ditman ditman left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good cleanup!

@ditman ditman changed the title fix(react): ship working basic catalog styles from the published package chore(react): drop build config left over from CSS modules Nov 3, 2026
@ditman
ditman merged commit 04d4298 into a2ui-project:main Nov 3, 2026
46 checks passed
@github-project-automation github-project-automation Bot moved this from Todo to Done in A2UI Nov 3, 2026
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.

5 participants