Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat!: Make react-router default #18387

Merged
merged 16 commits into from
Jan 22, 2024
Merged

feat!: Make react-router default #18387

merged 16 commits into from
Jan 22, 2024

Conversation

caalador
Copy link
Contributor

@caalador caalador commented Jan 2, 2024

Enable react router as default with
property to switch back to vaadin router.

Copy link

github-actions bot commented Jan 2, 2024

Test Results

1 055 files  ± 0  1 055 suites  ±0   1h 18m 15s ⏱️ + 3m 1s
6 798 tests ± 0  6 752 ✅  -  1  46 💤 +1  0 ❌ ±0 
7 103 runs  +15  7 046 ✅ +14  57 💤 +1  0 ❌ ±0 

Results for commit 5ca2aae. ± Comparison against base commit 6627445.

This pull request skips 1 test.
com.vaadin.flow.uitest.ui.RouterLinkIT ‑ testRoutingLinks_outsideServletMapping_pageChanges[any_Chrome_]

♻️ This comment has been updated with latest results.

@@ -161,6 +161,9 @@ public class BuildDevBundleMojo extends AbstractMojo
@Parameter(property = "npm.postinstallPackages", defaultValue = "")
private List<String> postinstallPackages;

@Parameter(property = InitParameters.REACT_ROUTER_ENABLED, defaultValue = "true")
private boolean reactRouterEnabled;
Copy link
Contributor

Choose a reason for hiding this comment

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

Are there any public available discussions about the benefits or downsides from this change for flow developers? Increased package size? Additional dependency on production to react? Performance downside or improvements? Customized index.html still applied?

Copy link
Contributor

Choose a reason for hiding this comment

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

It's not a discussion per se, but there is this acceptance criteria: vaadin/platform#4710. I believe the net effects should be neutral in terms of performance and package sizes. The main benefit is enabling mixing Flow and Hilla/React views in the same app. For pure-Flow projects, the change should be neutral.

Copy link
Contributor

Choose a reason for hiding this comment

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

Understandable, I was just wondering because the default is swapped in this PR (opposite as described in the AC) and therefore it would affect all flow apps. This is why I was wondering what the benefits or downsides are for flow only users :) (except to get rid of the "abandoned" vaadin router in favor of the react router)

Copy link
Contributor

Choose a reason for hiding this comment

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

Increased package size? Additional dependency on production to react?

Good point and we're going to estimate the bundle size. I don't expect much extra comparing to previous default, but let's see.

Customized index.html still applied?

Yes, I expect so, haven't tested yet though. Let me add a note about it.

Enable react router as default with
property to switch back to vaadin router.
@mshabarov mshabarov self-requested a review January 8, 2024 12:40
Copy link

sonarcloud bot commented Jan 9, 2024

Quality Gate Passed Quality Gate passed

Kudos, no new issues were introduced!

0 New issues
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@caalador caalador force-pushed the feat/react-router-default branch 7 times, most recently from 32c5b35 to 61010d5 Compare January 10, 2024 11:16
@caalador caalador force-pushed the feat/react-router-default branch 7 times, most recently from d6d864b to 3876bec Compare January 16, 2024 06:16
@caalador caalador marked this pull request as ready for review January 16, 2024 12:59
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should reactRouterEnabled also be an input parameter?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't know. Basically it does change the package.json contents so perhaps?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

added.

mshabarov
mshabarov previously approved these changes Jan 22, 2024
Copy link

sonarcloud bot commented Jan 22, 2024

Quality Gate Passed Quality Gate passed

Kudos, no new issues were introduced!

0 New issues
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@mshabarov mshabarov merged commit 69d3d0d into main Jan 22, 2024
26 checks passed
@mshabarov mshabarov deleted the feat/react-router-default branch January 22, 2024 09:32
rodolforfq pushed a commit that referenced this pull request Feb 8, 2024
* feat!: Make react-router default

Enable react router as default with
property to switch back to vaadin router.

* No react for test modules with explicit vaadin-router import

* Add react state also for dev-server init

* add optional param to not get can not navigate

* Handle hash anchor update

* Handle popstate without router navigation

* pick first popstate

* fix test excpectation

* Add react router flag as input in gradle

* fix typo

* Fix outside navigation

* Fix server webcomponent init

---------

Co-authored-by: Peter Czuczor <61667986+czp13@users.noreply.github.com>
@vaadin-bot
Copy link
Collaborator

This ticket/PR has been released with Vaadin 24.4.0.

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.

7 participants