Skip to content

feat: add react-components-pro and publish both React packages - #13034

Merged
web-padawan merged 4 commits into
mainfrom
feat/react-components-pro
Oct 9, 2026
Merged

web-padawan merged 4 commits into
mainfrom
feat/react-components-pro

Conversation

@web-padawan

@web-padawan web-padawan commented Oct 8, 2026 •

Copy link
Copy Markdown
Member

Description

Part of #12855
Depends on #13033

Fifth slice of the vaadin/react-components port, and the one that makes the monorepo the source of both React packages: the pro package lands, and both packages stop being private.

  • Added @vaadin/react-components-pro with its 15 wrappers, utils/createComponent.ts, LICENSE and README.md, with the commercial license header
  • Added test/GridPro.spec.tsx (the GridProEditColumn block that was left out of Grid.spec.tsx in feat: add react-components Grid wrappers, Vitest setup and dev page #13025) and test/typings/api.ts with the pro assertions left out of the core typings in feat: add react-components TabSheet and MasterDetailLayout wrappers #13033
  • Added the dev pages GridPro and Dashboard with its stylesheet
  • Removed private: true from both packages, so the next lerna publish releases them
  • Added a prepack guard to both packages that fails the publish when index.js is missing, so a release that skipped the React build cannot ship an empty tarball
  • yarn release:react now builds both packages and is the last step of yarn release, like the other release:* steps
    • yarn build:react is the developer and CI entry point: it builds the CEM and web-types inputs first, then calls release:react. yarn release already builds those inputs, so nothing runs twice
  • Extended yarn clean:react to the pro package

Type of change

  • Feature

How to test

  1. Run yarn build:react
  2. Run yarn test:react
  3. All 18 spec files pass in Chromium, and the generator prints no "has no src wrapper" warning
  4. Run yarn start:react
  5. /dev/ lists ten pages, and the GridPro and Dashboard pages render
  6. Run DRY_RUN=1 ./scripts/publishFeatureSnapshot.sh react-port
  7. Both @vaadin/react-components tarballs are listed with their built files, then run git checkout -- . && git clean -fdX packages/react-components*

Note

Verified against the release sequence used in CI (scripts/updateVersion.js, lerna version --force-publish, yarn release with release:react as its last step, lerna publish from-git), simulated locally with a version commit and no tag: lerna version bumps both packages and the pro dependency on core, yarn release leaves the tree clean because the regenerated exports map is byte-identical to the committed one, the bundle carries the bumped version, and npm pack passes the prepack guard with 569 and 99 files.

Warning

Once this merges, the next release from main publishes @vaadin/react-components and @vaadin/react-components-pro from this repository. The release build of vaadin/react-components must no longer run on its main branch before that happens, otherwise both repositories publish the same version. The 25.3 and earlier branches keep releasing from the old repository.

Note

Source commit ported: vaadin/react-components@4dc4850d1ccec7c45e4394d1c9b79599b9dabd69. Its main has only the 25.4.0-alpha2 version commit since then. Expected mechanical differences from the source files: license headers, Prettier and eslint --fix formatting, 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 against 25.4.0-alpha2 from the old repository: identical file lists (569 and 99 files) and identical exports maps for both packages.

🤖 Generated with Claude Code

@web-padawan
web-padawan force-pushed the feat/react-components-pro branch from 9459141 to c1a0774 Compare October 8, 2026 10:31
@web-padawan
web-padawan force-pushed the feat/react-components-layout-wrappers branch from adf3f82 to 51e9da5 Compare October 8, 2026 10:50
@web-padawan
web-padawan force-pushed the feat/react-components-pro branch from c1a0774 to 298fb5b Compare October 8, 2026 10:50
@web-padawan
web-padawan force-pushed the feat/react-components-layout-wrappers branch from 51e9da5 to 3a187d8 Compare October 8, 2026 12:18
@web-padawan
web-padawan force-pushed the feat/react-components-layout-wrappers branch from 3a187d8 to bc54fef Compare October 8, 2026 12:28
@web-padawan
web-padawan force-pushed the feat/react-components-pro branch from 298fb5b to 36c9a13 Compare October 8, 2026 12:29
Base automatically changed from feat/react-components-layout-wrappers to main October 8, 2026 13:27
web-padawan and others added 2 commits October 8, 2026 16:28
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>
@web-padawan
web-padawan force-pushed the feat/react-components-pro branch from 36c9a13 to f8af782 Compare October 8, 2026 13:29
@web-padawan
web-padawan marked this pull request as ready for review October 8, 2026 13:33
…page

The component is stable, the flag is no longer read.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

@vaadin-review-bot vaadin-review-bot 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.

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);

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.

⚠️ GridPro wrapper omits the column auto-width workaround that the core Grid wrapper applies

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

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Let's fix this in separate PR after merging this one, and also port to 25.3 an 25.2 branches.

Comment thread package.json
"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",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Updated the comment.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@sonarqubecloud

sonarqubecloud Bot commented Oct 9, 2026

Copy link
Copy Markdown

@web-padawan
web-padawan merged commit 1ce9d4d into main Oct 9, 2026
13 checks passed
@web-padawan
web-padawan deleted the feat/react-components-pro branch October 9, 2026 07:30
@vaadin-bot

Copy link
Copy Markdown
Collaborator

This ticket/PR has been released with Vaadin 25.4.0-alpha3.

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.

4 participants