Skip to content

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

@NullVoxPopuli

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.

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