Skip to content

Intent to RFC: make the default router dynamic segments camelCase. #556

Closed

Description

@NullVoxPopuli

Today, the default dynamic route segments are :snake_case. This is a ruby/rails-ism.
In JS, we use camelCase and today, using :camelCase works.

Additionally, there are conflicting lint rules:

model({ post_id }) will error because post_id is not camelCase. eslint: camelcase
but
this.route('show', { path: ':postId' }) will error because the param is not snake_case. ember/routes-segments-snake-case

Also, this should be deprecated (maybe as a separate RFC), because it adds additional behaviour based on a convention of snake_case:
lib/system/route#model (comment / id parse regex)

We don't really need implicit model finding (lib/system/route#findModel), as we haven't been teaching that for a while.
It implies we have a store service, which not all ember-apps do.

Activity

  1. HeroicEric commented on Nov 26, 2019

    @HeroicEric
    SponsorMember
  2. NullVoxPopuli commented on Nov 27, 2019

    @NullVoxPopuli
    SponsorContributorAuthor

    Deprecation of Implicit Record Loading: #557

  3. wagenet commented on Jul 23, 2022

    @wagenet
    Member

    I'm closing this due to inactivity. This doesn't mean that the idea presented here is invalid, but that, unfortunately, nobody has taken the effort to spearhead it and bring it to completion. Please feel free to advocate for it if you believe that this is still worth pursuing. Thanks!

  4. Repository owner moved this from Routing to Done in Ember Ecosystemon Jul 23, 2022
  5. NullVoxPopuli commented on Jul 23, 2022

    @NullVoxPopuli
    SponsorContributorAuthor

    I think we should still do this -- and ember-cli/eslint-plugin-ember#410 still open.

    snake_case is just weird in JS

  6. wagenet commented on Jul 23, 2022

    @wagenet
    Member

    Closing the ticket doesn’t mean we shouldn’t do it, just that, as it is, there’s no path forward for it. In other words, no one has or is putting in the work to make it happen. In practice, that means it’s not going to happen and, unfortunately, the tickets just end up adding more clutter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions