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

chore: Formalize 'route walkers' a little more #3221

Merged
merged 3 commits into from
Dec 9, 2024

Conversation

johncowen
Copy link
Contributor

@johncowen johncowen commented Nov 25, 2024

Back in #3151 we introduced the concept of 'route walkers'. These walk over every single route in your entire routing tree, giving you the opportunity to mutate or otherwise tweak a piece of routing config from The Outside.

When we made #3151, we noted we'd added the 'route walker' concept plus 2 walkers at our 'vue' level (i.e. in our vue module), even though the 2 walkers are specific to our application module.

This PR splits the concept and the application level implementations using a $.routeWalkers dependency injection label.

This means we can dynamically add/remove different routeWalkers at the service container level, which will be very useful moving forwards.


I also added one more walker than automatically adds a 'props.routeName' property to all route components. You will still need to use defineProps{ routeName: string}() in order to access it, but at least you no longer need to manually add repetitive routing configuration to do this.

Copy link

netlify bot commented Nov 25, 2024

Deploy Preview for kuma-gui ready!

Name Link
🔨 Latest commit 56b5af7
🔍 Latest deploy log https://app.netlify.com/sites/kuma-gui/deploys/6756b0a308b31d0008e3dc0b
😎 Deploy Preview https://deploy-preview-3221--kuma-gui.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@johncowen johncowen changed the title Chore/route walkers chore: Formalize 'route walkers' a little more Nov 25, 2024
@johncowen johncowen marked this pull request as ready for review November 25, 2024 16:23
@johncowen johncowen requested a review from a team as a code owner November 25, 2024 16:23
@johncowen johncowen requested review from schogges and removed request for a team November 25, 2024 16:23
@johncowen johncowen force-pushed the chore/route-walkers branch from 5ca88fe to 3ec192c Compare December 5, 2024 15:33
Copy link
Contributor

@schogges schogges left a comment

Choose a reason for hiding this comment

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

👍

@johncowen johncowen force-pushed the chore/route-walkers branch from 3ec192c to 56b5af7 Compare December 9, 2024 08:56
@johncowen johncowen merged commit 8d205b1 into kumahq:master Dec 9, 2024
16 checks passed
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.

2 participants