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

Fix index routes inside async pathless routes #4147

Merged
merged 1 commit into from
Nov 7, 2016

Conversation

agundermann
Copy link
Contributor

Fixes #3852. The problem was that getIndexRoute didn't consider async getChildRoutes when looking for pathless child routes.

@timdorr
Copy link
Member

timdorr commented Nov 7, 2016

Thanks!

@timdorr timdorr merged commit cbd1a95 into remix-run:master Nov 7, 2016
@taion
Copy link
Contributor

taion commented Nov 8, 2016

That was intentional, BTW – getChildRoutes blocks the transition without showing any feedback, so we didn't want to unconditionally load all async child routes just because the application didn't define an explicit index route.

@agundermann
Copy link
Contributor Author

Interesting. I had a feeling it was, but went ahead since the issue was labeled a bug and @ryanflorence didn't intervene when commenting.

Anyway, both implementations seem to have their cons considering the use case in #3852. Also, I think this wouldn't even be an issue if #3232 had been implemented, since we could only load pathless routes then.

@taion
Copy link
Contributor

taion commented Nov 8, 2016

Well, let's say "not entirely unintentional". The consequence of doing this code is that, once you hit a route, if it doesn't actually have an index route, the router is just going to eagerly load all the sets of child routes deeply.

You'd want an API like #3326 if you wanted to handle this in a principled way. The implementation here has the risk of being quite foot-gun-prone.

@lock lock bot locked as resolved and limited conversation to collaborators Jan 19, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants