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

[Router] Add Symfony UX Router package #1234

Closed
wants to merge 2 commits into from

Conversation

Kocal
Copy link
Member

@Kocal Kocal commented Oct 27, 2023

Q A
Bug fix? yes/no
New feature? yes/no
Issues Fix #...
License MIT

As promised in #616 (comment), it's time for a Symfony UX Router implementation. 🎉

@Kocal Kocal force-pushed the feat/router-component branch from 9cfb19b to 5fa9d63 Compare October 27, 2023 09:31
@smnandre
Copy link
Member

Nice!

Do you already have some thought about the security / splits questions or do you prefer we address those later in the process ?

@Kocal
Copy link
Member Author

Kocal commented Oct 27, 2023

The sooner the better I guess :p

@kbond
Copy link
Member

kbond commented Oct 28, 2023

I think, at least by default, only routes flagged with an expose: true option should be dumped. This matches FOSJsRoutingBundle and makes migration easier.

@tacman
Copy link
Contributor

tacman commented Oct 30, 2023

I think FOSJsRoutingBundle may already work, by dumping not the JSON but a JS file.

bin/console fos:js-routing:dump  --target=assets/js/fos_js_routes.js --pretty-print

Ryan had some comments here: FriendsOfSymfony/FOSJsRoutingBundle#466 that would automatically publish the routes (I think during the CompilerPass). That'd be really cool, but as a start a simple working example of FOSJsRoutingBundle with importmap('app') and loading the routes via a module would be great. We could document that here, and perhaps we wouldn't need a UX Router package, at least not right away.

@weaverryan
Copy link
Member

Hi!

Thanks for getting this starts! But... since FOSJsRoutingBundle already exists and has for a long time, I would love to just add AssetMapper support for that. I think it would be fairly easy. Then the community doesn't need to migrate to a new package and we don't kill a community-supported package.

@Kocal
Copy link
Member Author

Kocal commented Oct 31, 2023

Hey,

That's fair enough, I will just push my latest work and close the PR. We could re-open it later if needed :)

@Kocal Kocal closed this Oct 31, 2023
@tacman
Copy link
Contributor

tacman commented Nov 1, 2023

@Kocal would you be able to work on adding the AssetMapCompiler that Ryan described to the FOS bundle? I think that'd be a huge contribution and a nice solution to the problem addressed in this issue title.

I've added a comment to FriendsOfSymfony/FOSJsRoutingBundle#466 that shows a working version in a module, and Ryan added his idea to greatly simplify the DX experience.

@tacman
Copy link
Contributor

tacman commented Nov 1, 2023

If you create your own version, though, I'm happy to test it. I'm pretty much just looking for a Routing.generate() in javascript.

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.

5 participants