Skip to content

Commit df145bb

Browse files
fix: move internal frontend sources out of deprecated location (#24851) (CP: 25.2) (#24853)
This PR cherry-picks changes from the original PR #24851 to branch 25.2. --- #### Original PR description > ## What changed > > `flow-react` and `flow-dnd` shipped their `@JsModule` bundle sources (`ReactRouterOutletElement.tsx` and `dndConnector.js`) under the deprecated `META-INF/resources/frontend/` location. With recent builds this triggers a per-jar deprecation warning. > > - Moved `ReactRouterOutletElement.tsx` and `dndConnector.js` to `META-INF/frontend/`, the current location for `@JsModule`/`@CssImport` bundle sources. > - Updated the `ReactRouterOutlet` entry-point detection in `FrontendDependencies` to resolve the resource from the new location, falling back to the legacy `META-INF/resources/frontend/` location for backwards compatibility with older add-on jars. > > ## Why > > Eliminates the per-jar deprecation warning emitted during the build while keeping older add-on jars (which still ship sources in the legacy location) working. > > Fixes #24848 Co-authored-by: totally-not-ai[bot] <290682512+totally-not-ai[bot]@users.noreply.github.com>
1 parent e0e70fb commit df145bb

3 files changed

Lines changed: 4 additions & 2 deletions

File tree

flow-build-tools/src/main/java/com/vaadin/flow/server/frontend/scanner/FrontendDependencies.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@
6666
import com.vaadin.flow.theme.NoTheme;
6767
import com.vaadin.flow.theme.ThemeDefinition;
6868

69+
import static com.vaadin.flow.server.Constants.RESOURCES_FRONTEND_DEFAULT;
6970
import static com.vaadin.flow.server.frontend.scanner.FrontendClassVisitor.ASSETS;
7071
import static com.vaadin.flow.server.frontend.scanner.FrontendClassVisitor.DEV;
7172
import static com.vaadin.flow.server.frontend.scanner.FrontendClassVisitor.VALUE;
@@ -160,8 +161,9 @@ private void computeReactClasses(ClassFinder finder) throws IOException {
160161
// Add ReactRouterOutlet and adapter as internal so it gets added to the
161162
// bundle if available.
162163
try {
163-
if (finder.getResource(
164-
"META-INF/resources/frontend/ReactRouterOutletElement.tsx") != null
164+
if (finder
165+
.getResource(RESOURCES_FRONTEND_DEFAULT
166+
+ "/ReactRouterOutletElement.tsx") != null
165167
&& !visitedClasses.containsKey(
166168
"com.vaadin.flow.component.react.ReactRouterOutlet")) {
167169
Class<Object> entryPointClass = finder.loadClass(

flow-dnd/src/main/resources/META-INF/resources/frontend/dndConnector.js renamed to flow-dnd/src/main/resources/META-INF/frontend/dndConnector.js

File renamed without changes.

flow-react/src/main/resources/META-INF/resources/frontend/ReactRouterOutletElement.tsx renamed to flow-react/src/main/resources/META-INF/frontend/ReactRouterOutletElement.tsx

File renamed without changes.

0 commit comments

Comments
 (0)