Skip to content

chore: drop the React components from the versions file - #9413

Merged
Artur- merged 11 commits into
mainfrom
chore/drop-react-components-exclusions
Sep 29, 2026
Merged

Artur- merged 11 commits into
mainfrom
chore/drop-react-components-exclusions

Conversation

@totally-not-ai

@totally-not-ai totally-not-ai Bot commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor

Summary

The React components (@vaadin/react-components and @vaadin/react-components-pro) are now declared in the base jar of the component integrations. This PR removes them from versions.json and from the generated platform versions files, so they are no longer declared twice. The generator now reads them from the jars.

What changed

Behavior change: The generated vaadin-core-versions.json and vaadin-versions.json no longer have a react section. Applications still get the React components because the base components jar is on their classpath. Anything that reads the react key from these files directly will not find it.

Behavior change: The exclusions lists of the React components are gone. Four packages that the lists left out now use their Lit mode too: @vaadin/a11y-base, @vaadin/field-base, @vaadin/vaadin-lumo-styles and @vaadin/vaadin-themable-mixin. React applications still get them through the React components, at the version the overrides lock.

  • versions.json: the whole react section is removed.
  • Generator (generate.js, jarVersions.js):
    • Reads the full entries from the jars, not only the versions. The exclusions of @vaadin/react-components-pro tell the commercial components from the core ones.
    • Leaves the two React component packages out of the dependencies of the @vaadin/vaadin-core and @vaadin/vaadin npm packages. Those packages depend on the web components, not on the React components.
    • Stops with an error if the commercial React components bring no packages. Without that list, every commercial package would go into the core npm package. If the jars do not pin the commercial React components at all, it only warns and counts every component as core.
    • Skips the jars of the modules this repository builds, such as vaadin-core-internal. It finds their artifact ids in the repo's poms. Before, an old snapshot of a file this script wrote itself could be read back as input.
  • Removed the unused writeNestedSeparateJson / createNestedJson helpers.

Generating with the component jars gives the same npm package files as before, byte for byte.

Test summary

Pinned version split:

  • All packages count as core when no package is marked commercial

Own artifact detection:

  • Collects artifact ids from poms in nested modules
  • Ignores parent ids, commented-out ids and target folders

Jar reading:

  • Skips jars of excluded artifacts
  • Reads a jar whose artifact id only starts like an excluded one
  • Ignores jars of other versions
  • Not covered: the React packages left out of the npm packages, and the error when the pro components bring no packages

Every package the two arrays list is marked for the Lit mode, which
already says a React application does not install it separately and
only locks its version. Listing them again keeps a copy of the whole
component set in this file, which has to follow every component that is
added or removed.

The Lit mode of the four packages the arrays leave out, @vaadin/a11y-base,
@vaadin/field-base, @vaadin/vaadin-lumo-styles and
@vaadin/vaadin-themable-mixin, now applies as well. The React components
depend on all four, so a React application still gets them, at the
version the overrides lock.
@github-actions

github-actions Bot commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor

Dependencies Report

  • 🚫 Vulnerabilities:

  • 🟠 Known Vulnerabilities:

    • Vulnerabilities in: pkg:npm/%40apidevtools/json-schema-ref-parser@11.7.2 [CVE-2026-15195] (oss-bomber)
      👌 The cve carries a git only range with no version mapping. The affected releases are 15.3.0 to 15.3.5, fixed in 15.3.6, while 11.7.2 predates that line by 17 months. It arrives through swagger-parser 10.1.1, which pins it exactly.
      ·
    • Vulnerabilities in: pkg:npm/source-map-js@1.2.1 [CVE-2026-93749] (oss-bomber)
      👌 Build-time only: source-map-js is a dev dependency of postcss used by Vite during build/dev and is not shipped in production bundles. Exploitation requires feeding a crafted indexed source map into the developer's own build (event-loop DoS only). No fixed version is published on npm yet (1.2.1 is latest); upgrade once available.
      ·
    • Vulnerabilities in: pkg:maven/me.friwi/jcef-api@jcef-ca49ada%2Bcef-135.0.20%2Bge7de5c3%2Bchromium-135.0.7049.85 [CVE-2024-21639, CVE-2024-21640, CVE-2024-9410] (owasp)
      👌 Wait for the update from the jcefmaven community. Meanwhile the swing-kit is supposed to be used with fixed websites and not to browse the internet, we have a check for that, so the only possible attacker would be the same person that created the swing application, aka our customer devs. so this vulnerability is not classified by us as critical issue
      · cpe:2.3:a:chromiumembedded:chromium_embedded_framework::::::::
      · cpe:2.3:a:ada:ada::::::::
    • Vulnerabilities in: pkg:maven/io.opentelemetry/opentelemetry-api@1.65.0 [CVE-2026-54285] (owasp)
      👌 False positive: the advisory is for opentelemetry-js (@opentelemetry/core W3CBaggagePropagator.extract(), fixed in JS 2.8.0) and its only CPE targets node.js. io.opentelemetry is opentelemetry-java, an unrelated codebase on its own 1.x line, so the version range matches only by CPE collision; osv-scanner and ossindex report nothing for this coordinate. It reaches the sbom transitively through selenium-remote-driver under vaadin-testbench, a test only dependency.
      · cpe:2.3:a:opentelemetry:opentelemetry::::::node.js::*
    • Vulnerabilities in: pkg:maven/com.vaadin/vaadin-swing-kit-flow@3.0.1 [CVE-2021-33604] (owasp)
      👌 false report: this CVE is targeting Vaadin version prior 20, swing-kit-flow is using vaadin 24+ version, the related issue has been fixed.
      · cpe:2.3:a:vaadin:flow-server::::::::
      · cpe:2.3:a:vaadin:vaadin::::::::
  • 📔 No Core License Issues

  • 📔 No License Issues

  • 🟠 Changes in 25.4-SNAPSHOT since V25.3.0-rc1

    • 6 packages added (6 external, 0 vaadin)
    • 246 packages modified (20 external, 226 vaadin)
    • 402 packages same (386 external, 16 vaadin)

[Click for more Details]

The base module of the component integrations pins them in its jar now,
with the packages they bring, so this file declared the last part of the
component versions that lived outside the repository releasing them.

The generator reads them back out of the jars, the way it already reads
the versions of the components: the two npm packages of the platform
keep the React components as a dependency, and the packages the pro
React components bring keep telling the commercial components from the
core ones.

Generating with the jars of the components produces the same files as
before, byte for byte.
@totally-not-ai totally-not-ai Bot changed the title chore: drop the exclusions of the React components chore: drop the React components from the versions file Sep 12, 2026
The base module of the component integrations is a core one and every
module depends on it, so a package it declares is on the classpath of
an application using only core components. A package a versions file
declares for the mode being built is added to the package.json rather
than only constrained there, so declaring the commercial React
components in that jar would have them installed by applications that
use no commercial component.

Only @vaadin/react-components moves to the jars. The generator takes it
from there and the commercial one from here, which also keeps telling
the commercial components from the core ones.
@totally-not-ai totally-not-ai Bot changed the title chore: drop the React components from the versions file chore: drop the core React components from the versions file Sep 12, 2026
@Artur-

Artur- commented Sep 14, 2026

Copy link
Copy Markdown
Member

Depends on vaadin/flow-components#10113

This reverts commit 795021c.

The base module of the component integrations declares both npm packages
of the React components now, with the packages each of them brings, so
this file declares neither and the whole react section goes.

The generator takes both from the jars, and the packages the commercial
React components bring still tell the commercial components from the
core ones.
@totally-not-ai totally-not-ai Bot changed the title chore: drop the core React components from the versions file chore: drop the React components from the versions file Sep 14, 2026
The jars pin them the same way as the web components, so reading the
versions back put them among the packages handed to @vaadin/vaadin-core
and @vaadin/vaadin. Neither depends on them: an application installs the
web components through the React components, not the other way round,
and the published packages do not list them either.

Both are left out of the split now, and the commercial React components
bringing no package stops the generation rather than writing every
commercial package into the core npm package.
@totally-not-ai

Copy link
Copy Markdown
Contributor Author

@Artur- Right, and now that the base jar declares both npm packages of the React components, this can drop the whole react section rather than keeping the commercial entry. Done in 2b468f3, and the description links the pull request it depends on.

Reading the React components back out of the jars needed one more fix, in 2e3ed1d. The jars pin them the same way as the web components, so they ended up among the packages handed to @vaadin/vaadin-core and @vaadin/vaadin, and @vaadin/vaadin-core came out depending on @vaadin/react-components-pro and the commercial components through it. Neither npm package depends on the React components — an application installs the web components through them, not the other way round — so both are left out of the split. The two generated package.json files now list exactly what the published @vaadin/vaadin-core@25.3.0-beta2 and @vaadin/vaadin@25.3.0-beta2 list.

Commercial React components that bring no package now stop the generation as well, instead of quietly writing every commercial package into the core npm package.

Checked by running the generator against the jars of the components on this branch and on main: the only difference is the two React components that main writes into vaadin-core-package.json. The versions files are identical once both repositories are on the same component version — the version of the React entries now follows the @NpmPackage annotations of the components rather than an entry here, which is in the risks.

@Artur-

Artur- commented Sep 28, 2026

Copy link
Copy Markdown
Member

Does this now produce exactly the same versions info as before this change?

@totally-not-ai

Copy link
Copy Markdown
Contributor Author

@Artur- Yes for the versions files — I just checked it again against current main of both repositories. I ran scripts/generator/generate.js on this branch and on main with the same, freshly built component jars.

  • vaadin-core-versions.json and vaadin-versions.json are identical. @vaadin/react-components ends up in the core file and @vaadin/react-components-pro in the commercial one, with the same versions and exclusions as before. The version skew I mentioned earlier is gone now that both repositories are on 25.4.0-alpha1.
  • The only difference is in vaadin-core-package.json: main now lists @vaadin/react-components and @vaadin/react-components-pro as dependencies, and this branch doesn't. That comes from the component jars pinning the React components since chore: pin the npm version of the React components in the base jar flow-components#10113: main's generator reads every package the jars pin and hands them to the two npm packages. So main is the one that changed here. This branch leaves the React components out of that split, which is what the npm package listed before the jars pinned them, and matches the published @vaadin/vaadin-core.

@Artur-

Artur- commented Sep 29, 2026

Copy link
Copy Markdown
Member

This does not actually drop react from the versions.json and the script in scripts/generator/src/jarVersions.js seems to read the artifacts produced by this project also so it finds pinned versions from the last snapshot of e.g. vaadin-core-internal

totally-not-ai Bot and others added 2 commits September 29, 2026 06:32
Merging main back into the branch restored the react section of
versions.json, so the React components were declared here again.

The generator also read every jar of the platform version below the
local Maven repository, which includes the artifacts this repository
builds. vaadin-core-internal ships a versions file written by the
generator itself, so a stale snapshot of it could pin whatever the
previous build wrote instead of what the component jars declare. The
artifact ids of the modules this repository builds are now collected
from its poms and their jars are not read.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Reads a directory of real jars with one left out, one whose artifact id
only starts like it and one of another version, and checks that only
the second pins anything. The temporary directories of these tests are
now removed after each of them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@totally-not-ai

Copy link
Copy Markdown
Contributor Author

@Artur- You're right on both counts, and my last answer missed the first one. Fixed in 7d28d9a.

The react section was back. Merging main into the branch restored it in versions.json, and I compared the generated output without noticing. The generator on this branch was already taking the React components from the jars and ignoring that section, which is why the versions files still matched, but the pull request no longer removed it. It is removed again now.

The generator read the platform's own jars. It picked up every jar of the platform version below ~/.m2/repository/com/vaadin, including the artifacts this repository builds. vaadin-core-internal ships a versions file that the generator itself wrote, so a stale snapshot of it could pin what the previous build wrote instead of what the component jars declare. The generator now collects the artifact ids of the modules this repository builds from its own poms and skips their jars. With a stale vaadin-core-internal-25.4-SNAPSHOT.jar placed next to the component jars, @vaadin/react-components came out at the stale version before this change and at 25.4.0-alpha1 after it. A test covers the artifact id collection.

Checked again against main with the same freshly built component jars: vaadin-core-versions.json and vaadin-versions.json are identical. The only difference is still that main now adds the two React components to vaadin-core-package.json and this branch doesn't. The published @vaadin/vaadin-core doesn't list them either.

@Artur-

Artur- commented Sep 29, 2026

Copy link
Copy Markdown
Member

Isn't most of the code unnecessary here? We should drop "react" from versions.json as it's now defined in a flow-components jar. We should not be reading it from that jar and still including it here

totally-not-ai Bot and others added 2 commits September 29, 2026 06:48
…s files

The base jar of the components declares them, and applications have it on
their classpath, so writing them into vaadin-core-versions.json and
vaadin-versions.json only declared them a second time. The generator now
reads the jars for nothing but the packages the commercial React
components bring, to tell the commercial components from the core ones,
and the writer for nested sections it no longer needs is removed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Leaving out every package a jar pins for the React mode would also drop
any other React package a jar might pin that way. Only
@vaadin/react-components and @vaadin/react-components-pro are left out
now, by name.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@totally-not-ai

Copy link
Copy Markdown
Contributor Author

@Artur- Agreed. In 53fd8a1 the generator stops writing the React components into vaadin-core-versions.json and vaadin-versions.json: the base jar of the components declares them, and applications have that jar on their classpath, so the platform files would only have declared them a second time. The nested writer that was only there for them is removed too. versions.json has no react section.

What is left does two things, both needed because the component versions have come from the jars since #9392:

  • Splitting the components between the two npm packages. The only thing the generator still reads from a React entry is the list of packages @vaadin/react-components-pro brings. That is what tells the commercial components (for @vaadin/vaadin) from the core ones (for @vaadin/vaadin-core). Without it every commercial component would land in the core npm package, so it stops the generation if that list is missing. The two React components themselves are left out of the npm packages, since the jars pin them like any other package and neither npm package depends on them.
  • Skipping the jars this repository builds. They are of the same version, and a stale vaadin-core-internal or vaadin-internal snapshot from before this change still carries a react section, which could otherwise win over the component jar. A test covers it with real jars.

One side effect worth knowing: Flow recognises the platform's own versions file by it declaring @vaadin/vaadin-core or @vaadin/react-components. The core file declared only the latter, so it is no longer recognised as the platform file, and Flow takes the Vaadin version from the vaadin-core pom properties on the classpath instead. That is the same version for a normal application. The commercial file still declares @vaadin/vaadin-core.

The generated package.json files are unchanged by this commit, and the generator tests pass apart from the five failures main has as well. The failing SBOM check is the same CVE report the other branches get.

@Artur-
Artur- marked this pull request as ready for review September 29, 2026 07:05
@Artur-
Artur- merged commit 2cb53ca into main Sep 29, 2026
3 of 4 checks passed
@Artur-
Artur- deleted the chore/drop-react-components-exclusions branch September 29, 2026 07:55
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.

1 participant