Repository navigation
feat: add react-components-pro and publish both React packages - #13034
Conversation
9459141 to
c1a0774
Compare
adf3f82 to
51e9da5
Compare
c1a0774 to
298fb5b
Compare
51e9da5 to
3a187d8
Compare
3a187d8 to
bc54fef
Compare
298fb5b to
36c9a13
Compare
Part of #12855 Fifth slice of the vaadin/react-components port: the pro package with its wrappers, the GridProEditColumn spec and typings, a prepack guard, `yarn build:react` as the last step of `yarn release`, and both packages without `private`, so the next release publishes them. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
36c9a13 to
f8af782
Compare
…page The component is stable, the flag is no longer read. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
vaadin-review-bot
left a comment
There was a problem hiding this comment.
Reviewed the changes — left 1 comment.
| Finding | |
|---|---|
| GridPro wrapper omits the column auto-width workaround that the core Grid wrapper applies |
| props: GridProProps<TItem>, | ||
| ref: ForwardedRef<GridProElement<TItem>>, | ||
| ): ReactElement | null { | ||
| const [portals, rowDetailsRenderer] = useModelRenderer(props.rowDetailsRenderer); |
There was a problem hiding this comment.
The core Grid wrapper patches recalculateColumnWidths to defer into a microtask ("Wait for column content to finish rendering before recalculating widths") and passes renderMode: 'microtask' to its row-details renderer. GridPro does neither, even though it extends Grid and inherits the same auto-width mixin, and GridProEditColumn renders header, footer and body content through microtask portals.
So <GridPro><GridProEditColumn autoWidth header={<b>Name</b>} /></GridPro> measures the cell while the React portal content is still empty, while the same markup under <Grid>/<GridColumn> does not. Grid.spec.tsx has a parameterized should consider custom renderer content with column auto-width test for all five core column types; nothing equivalent exists for GridProEditColumn, so this stays invisible either way.
GridPro.tsx:27 · correctness
There was a problem hiding this comment.
Let's fix this in separate PR after merging this one, and also port to 25.3 an 25.2 branches.
| "release": "yarn release:themes && yarn release:cem && yarn release:web-types && yarn release:react", | ||
| "release:cem": "custom-elements-manifest analyze --config custom-elements-manifest.config.js && node ./scripts/split-cem.js", | ||
| "release:react": "yarn release:cem && yarn release:web-types && yarn workspace @vaadin/react-components build", | ||
| "release:react": "yarn workspace @vaadin/react-components build && yarn workspace @vaadin/react-components-pro build", |
There was a problem hiding this comment.
There may be a stale comment in the react/vite.config.ts that says to run release:react before running tests, which fails if web types have not been generated:
// Specs import core through the package name. In tests, subpath imports resolve to the
// sources so that a change in core is visible without a build. The bare import keeps
// using the built `index.js`, so `yarn release:react` runs once before `yarn test:react`.
// Note: a spec may then load two instances of `utils/*`. No module there holds state.
The comment was overall not clear to me though, it sounds like that would be done automatically which is not the case.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
|
This ticket/PR has been released with Vaadin 25.4.0-alpha3. |



Description
Part of #12855
Depends on #13033
Fifth slice of the
vaadin/react-componentsport, and the one that makes the monorepo the source of both React packages: the pro package lands, and both packages stop beingprivate.@vaadin/react-components-prowith its 15 wrappers,utils/createComponent.ts,LICENSEandREADME.md, with the commercial license headertest/GridPro.spec.tsx(theGridProEditColumnblock that was left out ofGrid.spec.tsxin feat: add react-components Grid wrappers, Vitest setup and dev page #13025) andtest/typings/api.tswith the pro assertions left out of the core typings in feat: add react-components TabSheet and MasterDetailLayout wrappers #13033GridProandDashboardwith its stylesheetprivate: truefrom both packages, so the nextlerna publishreleases themprepackguard to both packages that fails the publish whenindex.jsis missing, so a release that skipped the React build cannot ship an empty tarballyarn release:reactnow builds both packages and is the last step ofyarn release, like the otherrelease:*stepsyarn build:reactis the developer and CI entry point: it builds the CEM and web-types inputs first, then callsrelease:react.yarn releasealready builds those inputs, so nothing runs twiceyarn clean:reactto the pro packageType of change
How to test
yarn build:reactyarn test:reactyarn start:react/dev/lists ten pages, and theGridProandDashboardpages renderDRY_RUN=1 ./scripts/publishFeatureSnapshot.sh react-port@vaadin/react-componentstarballs are listed with their built files, then rungit checkout -- . && git clean -fdX packages/react-components*Note
Verified against the release sequence used in CI (
scripts/updateVersion.js,lerna version --force-publish,yarn releasewithrelease:reactas its last step,lerna publish from-git), simulated locally with a version commit and no tag:lerna versionbumps both packages and the pro dependency on core,yarn releaseleaves the tree clean because the regeneratedexportsmap is byte-identical to the committed one, the bundle carries the bumped version, andnpm packpasses theprepackguard with 569 and 99 files.Warning
Once this merges, the next release from
mainpublishes@vaadin/react-componentsand@vaadin/react-components-profrom this repository. The release build ofvaadin/react-componentsmust no longer run on itsmainbranch before that happens, otherwise both repositories publish the same version. The25.3and earlier branches keep releasing from the old repository.Note
Source commit ported:
vaadin/react-components@4dc4850d1ccec7c45e4394d1c9b79599b9dabd69. Itsmainhas only the25.4.0-alpha2version commit since then. Expected mechanical differences from the source files: license headers, Prettier andeslint --fixformatting, import paths. Vitest: 18 files, 107 tests (94 + 13 GridPro). Generator parity for the 15 pro wrappers: empty diff against the previous generator on the same input. Published artifact parity against25.4.0-alpha2from the old repository: identical file lists (569 and 99 files) and identicalexportsmaps for both packages.🤖 Generated with Claude Code