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(server-routes): group routes by type #256

Merged
merged 3 commits into from
Jun 23, 2023

Conversation

arashsheyda
Copy link
Member

@arashsheyda arashsheyda commented Jun 2, 2023

showing server-rotues from other modules in external group
related to #252

With routes from other modules

image

without

image

]).then(r => r.flat())
return files
return [
...nitro.scannedHandlers.map(item => ({
Copy link
Member Author

Choose a reason for hiding this comment

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

not sure if this was the best way to do it, sorry

@antfu
Copy link
Member

antfu commented Jun 5, 2023

Can you help to set up a new playground for routes with an example of external routes under /playgrounds? It looks good but I am not sure I understand the concept of "external" routes, and if they are worth to put in a separate group. Thanks

Copy link
Member Author

@antfu sure! thank you

@antfu
Copy link
Member

antfu commented Jun 5, 2023

I see. I guess external might be a bit confusing. Ideally, they are more like "contributed by module", or "added dynamically". I think we need a better term.

Also, why do you think they should be separated by group? I feel the groups are taking a bit too much space. Maybe using checkboxes like we did for components graph?

@arashsheyda
Copy link
Member Author

arashsheyda commented Jun 5, 2023

@antfu yes it's taking a lot of space 😄 what about something like this? Maybe we could add the ability of seperation by group to user, so they can drag and create custom groups for themselves?
image

and also having the checkbox option too, looks very good thank you

@antfu
Copy link
Member

antfu commented Jun 5, 2023

Oh yeah, that looks much better indeed. Feel free to push it :)

@arashsheyda
Copy link
Member Author

@antfu sure! Thanks

@arashsheyda
Copy link
Member Author

arashsheyda commented Jun 8, 2023

@antfu here is a demo with latest push
the code may want refactoring, sorry and thank you

storage-options.mp4

@antfu
Copy link
Member

antfu commented Jun 9, 2023

No need to sorry at all! Thanks a lot for your efforts on pushing many features of DevTools!

It's really impressive you implemented the grouping and dragging system! But I am not very sure if it can be very useful as it requires manually managing them (and also the configure is save locally that are not shared across the team).

I thought we could the grouping automatically based on the directories (like a tree view) so they can manage the groups by simply managing the file structure. Users may toggle between plain list or tree views as well.

@arashsheyda
Copy link
Member Author

arashsheyda commented Jun 9, 2023

@antfu yes that make sense thanks :D, can you do the grouping automatically based on the directories whenever you have the time?(Sorry I don'thave access to computer for a couple of weeks) :)

and do you think is it too much to have a nuxt-cloud(an space for caching & stuff) for teams to sync their configs and etc. ?

@arashsheyda
Copy link
Member Author

arashsheyda commented Jun 17, 2023

here is a demo with grouping automatically based on the directories, @antfu what do you think :D thank you

2023-06-17.18-57-44-331.mp4

@arashsheyda arashsheyda changed the title feat(server-routes): filter by group feat(server-routes): filter by collection Jun 17, 2023
@arashsheyda
Copy link
Member Author

also is it a good idea to have color for collections?

image

@antfu
Copy link
Member

antfu commented Jun 22, 2023

I love the UI and the grouping you made! But I am a bit hesitant about the breaking changes made to the UI options. I extracted nitro part #286 and merged it first so we are not blocked by this.

About the grouping and dragging, do you find a use case that you will need to manually organize the groups? I think we could auto-infer based on the routes structure. So user only needs to organize the routes by the file structure, which becomes the single source of trust. We could put the runtime in a separate group.

As for coloring, for DevTools I am thinking of not making it too colorful unless it has some meaning. But maybe changing the icon based on the type of API might be interesting.

@arashsheyda
Copy link
Member Author

arashsheyda commented Jun 22, 2023

@antfu oh thank you, no I removed the dragging and used auto-grouping based on the routes name, in the last video, it is auto-grouping by the route's name

@antfu
Copy link
Member

antfu commented Jun 22, 2023

Is it possible to keep the UI options as-is? If we absolutely need that, we could discuss it in another PR.

@arashsheyda
Copy link
Member Author

@antfu awww sorry I misunderstood, I got it now. Sure, thank you

@antfu antfu changed the title feat(server-routes): filter by collection feat(server-routes): group routes by type Jun 23, 2023
@antfu antfu merged commit 6899cbb into nuxt:main Jun 23, 2023
1 of 3 checks passed
@arashsheyda arashsheyda deleted the server-route-group branch June 23, 2023 15:10
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.

None yet

2 participants