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: add flat routes convention #4716

Closed
wants to merge 4 commits into from

Conversation

kiliman
Copy link
Collaborator

@kiliman kiliman commented Nov 30, 2022

Closes: #4483

  • Docs
  • Tests

This is the initial PR to add flat routes convention

Testing Strategy:

@changeset-bot
Copy link

changeset-bot bot commented Nov 30, 2022

🦋 Changeset detected

Latest commit: 5811b13

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 16 packages
Name Type
@remix-run/dev Patch
create-remix Patch
remix Patch
@remix-run/architect Patch
@remix-run/cloudflare Patch
@remix-run/cloudflare-pages Patch
@remix-run/cloudflare-workers Patch
@remix-run/deno Patch
@remix-run/eslint-config Patch
@remix-run/express Patch
@remix-run/netlify Patch
@remix-run/node Patch
@remix-run/react Patch
@remix-run/serve Patch
@remix-run/server-runtime Patch
@remix-run/vercel Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@kiliman
Copy link
Collaborator Author

kiliman commented Nov 30, 2022

Ok, here's my initial PR. I simply copied over my flatRoutes function. I will work on integrating with existing config and updating the tests.

@kiliman kiliman mentioned this pull request Nov 30, 2022
3 tasks
@ryanflorence
Copy link
Member

We'll want it behind a future flag, too. Let's go with:

// remix.config.js
{
  future: {
    v2_routeConvention: true
  }
}

Future flags were merged here: #4566

If you run into questions about future flags, reach out to @chaance :)

@machour
Copy link
Collaborator

machour commented Nov 30, 2022

@ryanflorence regarding the flag name, did you reach a conclusion regarding keeping or removing the current convention in V2? (Question raised in the RFC)

We may want to change the flag name to v2_flatRoutesConvention if we keep both.

@kiliman
Copy link
Collaborator Author

kiliman commented Nov 30, 2022

@ryanflorence ok so the plan is if the feature flag is true for flat routes, then this will automatically use the flat routes convention instead of the default (i.e., no need to specify the routes config option). Correct?

@ryanflorence
Copy link
Member

Let's move forward as if this is the only built-in convention for v2, so let's use v2_routeConvention.

As folks start updating we can revisit if it maybe shouldn't be the only convention, or even the default. I suspect people will prefer it, though.

Integrates flat routes function into config
@kiliman
Copy link
Collaborator Author

kiliman commented Dec 13, 2022

Ok, I've pushed the latest version. This also includes the hybrid routes.

I think this gives you the best of both worlds. You can still organize with nested folders, but you also get colocation.

@machour
Copy link
Collaborator

machour commented Dec 14, 2022

@kiliman Tested hybrid routes on 0.5.0, works like a charm 👌🏼 Thank you so much for this.

@mcansh
Copy link
Collaborator

mcansh commented Jan 6, 2023

closed in favor of #4880 (which includes these commits)

@mcansh mcansh closed this Jan 6, 2023
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.

5 participants