Skip to content

Enhance SPA routing logic - #715

Merged
stijnpotters1 merged 6 commits into
masterfrom
fix/improve-spa-router-rules
Aug 18, 2026
Merged

Enhance SPA routing logic #715
stijnpotters1 merged 6 commits into
masterfrom
fix/improve-spa-router-rules

Conversation

@stijnpotters1

Copy link
Copy Markdown
Contributor

@stijnpotters1 stijnpotters1 self-assigned this Aug 13, 2026
@MatthijsSmets

Copy link
Copy Markdown
Contributor

WHY 16 FILES FOR ROUTING?????????????????????????

@stijnpotters1

stijnpotters1 commented Aug 13, 2026

Copy link
Copy Markdown
Contributor Author

@MatthijsSmets I have added spa test resources, which allowed me to test the improved router method.
I could have done it with one file change and no tests but i really wanted to make tests for it.
The only real change in the code is in the InsightsApplication class, the rest is for testing

@stijnpotters1 stijnpotters1 linked an issue Aug 13, 2026 that may be closed by this pull request
@stijnpotters1
stijnpotters1 marked this pull request as ready for review August 13, 2026 11:04
@MatthijsSmets

Copy link
Copy Markdown
Contributor

But I see generated build artifacts?

@MatthijsSmets

Copy link
Copy Markdown
Contributor

What if some day another artifact is generated during building, will you add that as well?
Maybe its better to have maven build the frontend and move those build artifacts to where the tests need them instead?

@stijnpotters1

stijnpotters1 commented Aug 13, 2026

Copy link
Copy Markdown
Contributor Author

These are not generated build artifacts, they function as test stubs.
It is just to test if the spa router forwards work right since they are now existent based instead of quesing by extension which caused the issue.

So when generating a new build, they will not be overwritten with new artifacts.

@stijnpotters1
stijnpotters1 force-pushed the fix/improve-spa-router-rules branch from 381b28c to 3cc97ff Compare August 17, 2026 10:10

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR adjusts the Spring WebMVC functional routing so Angular SPA deep links (including version/tag paths containing dots and non-numeric suffixes) resolve to index.html instead of 404, and adds a dedicated router test suite plus a small SPA build fixture to validate routing behavior.

Changes:

  • Reworked the SPA router to serve classpath static resources and fall back to index.html for client-side routes.
  • Added comprehensive unit tests covering deep links, query strings, asset resolution, and excluded API/error paths.
  • Added SPA fixture files under test resources and introduced additional Maven dependencies.

Reviewed changes

Copilot reviewed 14 out of 16 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
pom.xml Adds jspecify and bucket4j-core dependencies at the parent level.
insights-webapp/src/main/java/org/frankframework/insights/InsightsWebappApplication.java Updates SPA router logic to serve static resources and fall back to index.html; introduces @NullMarked.
insights-webapp/src/test/java/org/frankframework/insights/InsightsApplicationSpaRouterTest.java New tests validating SPA routing behavior across many routes and asset paths.
insights-webapp/src/test/resources/spa-fixture/3rdpartylicenses.txt Adds SPA fixture asset used by routing tests.
insights-webapp/src/test/resources/spa-fixture/assets/favicon.svg Adds SPA fixture asset used by routing tests.
insights-webapp/src/test/resources/spa-fixture/assets/icons/grab-gesture.png Adds SPA fixture asset used by routing tests.
insights-webapp/src/test/resources/spa-fixture/chunk-EWTVZH6O.mjs Adds SPA fixture asset used by routing tests.
insights-webapp/src/test/resources/spa-fixture/favicon.ico Adds SPA fixture asset used by routing tests.
insights-webapp/src/test/resources/spa-fixture/index.html Adds SPA fixture index.html used by routing tests.
insights-webapp/src/test/resources/spa-fixture/main-B7QM4KUC.js Adds SPA fixture asset used by routing tests.
insights-webapp/src/test/resources/spa-fixture/main-B7QM4KUC.js.map Adds SPA fixture asset used by routing tests.
insights-webapp/src/test/resources/spa-fixture/manifest.webmanifest Adds SPA fixture asset used by routing tests.
insights-webapp/src/test/resources/spa-fixture/media/inter-latin.woff2 Adds SPA fixture asset used by routing tests.
insights-webapp/src/test/resources/spa-fixture/polyfills-B6TNHZQ6.js Adds SPA fixture asset used by routing tests.
insights-webapp/src/test/resources/spa-fixture/robots Adds SPA fixture asset used by routing tests.
insights-webapp/src/test/resources/spa-fixture/styles-5INURTSO.css Adds SPA fixture asset used by routing tests.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread pom.xml Outdated
@Matthbo

Matthbo commented Aug 18, 2026

Copy link
Copy Markdown
Member

Does it have to mimic all the files though?
A generic html and js bundle file should be fine as a test right?
Maybe with an extra asset too for good measure, but even testing for the icon file, js map file and polyfills? Bit excessive imo

@stijnpotters1

Copy link
Copy Markdown
Contributor Author

Does it have to mimic all the files though? A generic html and js bundle file should be fine as a test right? Maybe with an extra asset too for good measure, but even testing for the icon file, js map file and polyfills? Bit excessive imo

Okay i have changed it. Now its using the generated frontend artifacts from the ci build to test against.

@sonarqubecloud

Copy link
Copy Markdown

@stijnpotters1
stijnpotters1 merged commit 847ded7 into master Aug 18, 2026
5 checks passed
@stijnpotters1
stijnpotters1 deleted the fix/improve-spa-router-rules branch August 18, 2026 15:20
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.

Url in release is not working

4 participants