Pin @a2ui/web_core <0.8.4 to prevent React TextField breakage#829
Conversation
The Lit harness stopped rendering after the merge because: 1. @a2ui/markdown-it was pinned to ^0.0.1 (npm registry) which has a synchronous renderMarkdown(). After commit b904548 made MarkdownRenderer async, the Lit directive calls .then() on the result, causing "markdownRenderer(...).then is not a function". Fix: switch to file:../../markdown/markdown-it to stay in sync with the local source (now async, v0.0.2). 2. The React Vite dev server lazily discovers @a2ui/web_core subpath imports, triggering "optimized dependencies changed. reloading" mid-page-load which causes blank screenshots in Playwright. Fix: add web_core subpath imports to optimizeDeps.include so Vite pre-bundles them upfront.
web_core 0.8.4 renames TextField's `type` to `textFieldType` (google#806). Pin until the React renderer is updated to match (google#810).
There was a problem hiding this comment.
Code Review
This pull request pins the @a2ui/web_core dependency to prevent a breaking change in a patch release, which is a good immediate fix. It also includes updates to the visual parity test setup, switching to a local version of @a2ui/markdown-it and optimizing the Vite configuration. My feedback focuses on making the version pin for @a2ui/web_core more explicit to improve long-term maintainability.
renderers/react/package.json
Outdated
| }, | ||
| "dependencies": { | ||
| "@a2ui/web_core": "^0.8.0", | ||
| "@a2ui/web_core": "<0.8.4", |
There was a problem hiding this comment.
While pinning the version to <0.8.4 correctly prevents the breaking change from being installed, it's a bit loose on the lower bound. The original ^0.8.0 indicated a reliance on at least version 0.8.0. To be more explicit and safe, consider combining both constraints. This ensures you get versions from 0.8.0 up to, but not including, the breaking change.
This is a good temporary fix, and as noted in the PR description, a follow-up to adapt to the breaking change in web_core would be the ideal long-term solution.
| "@a2ui/web_core": "<0.8.4", | |
| "@a2ui/web_core": ">=0.8.0 <0.8.4", |
Summary
@a2ui/web_coreto<0.8.4in the React renderer to prevent breakage when web_core 0.8.4+ is publishedTextField.typetoTextField.textFieldType(Tweak v0.8 Button and TextField schemas to better match the spec. #806), which will break the React renderer'sTextFieldcomponentFixes #810
Test plan
cc @ditman @jacobsimionato