Repository navigation
chore: drop the React components from the versions file - #9413
Conversation
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.
Dependencies Report
|
…onents-exclusions
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.
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.
|
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.
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.
|
@Artur- Right, and now that the base jar declares both npm packages of the React components, this can drop the whole 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 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 |
|
Does this now produce exactly the same versions info as before this change? |
|
@Artur- Yes for the versions files — I just checked it again against current
|
|
This does not actually drop react from the versions.json and the script in |
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>
|
@Artur- You're right on both counts, and my last answer missed the first one. Fixed in 7d28d9a. The react section was back. Merging The generator read the platform's own jars. It picked up every jar of the platform version below Checked again against |
|
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 |
…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>
|
@Artur- Agreed. In 53fd8a1 the generator stops writing the React components into What is left does two things, both needed because the component versions have come from the jars since #9392:
One side effect worth knowing: Flow recognises the platform's own versions file by it declaring The generated |
Summary
The React components (
@vaadin/react-componentsand@vaadin/react-components-pro) are now declared in the base jar of the component integrations. This PR removes them fromversions.jsonand 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.jsonandvaadin-versions.jsonno longer have areactsection. Applications still get the React components because the base components jar is on their classpath. Anything that reads thereactkey from these files directly will not find it.Behavior change: The
exclusionslists 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-stylesand@vaadin/vaadin-themable-mixin. React applications still get them through the React components, at the version the overrides lock.versions.json: the wholereactsection is removed.generate.js,jarVersions.js):exclusionsof@vaadin/react-components-protell the commercial components from the core ones.@vaadin/vaadin-coreand@vaadin/vaadinnpm packages. Those packages depend on the web components, not on the React components.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.writeNestedSeparateJson/createNestedJsonhelpers.Generating with the component jars gives the same npm package files as before, byte for byte.
Test summary
Pinned version split:
Own artifact detection:
targetfoldersJar reading: