Skip to content

Rename src/routes to src/app #3021

@Rich-Harris

Description

@Rich-Harris

Describe the problem

Have come to the view that src/routes is suboptimal naming. It downplays the centrality of that folder, and makes you think about 'routing' even if your app has no routes (or e.g. you're brand new to web dev and are tinkering with Svelte for the first time, and don't yet even know what that word means in this context).

By contrast, src/app/index.svelte almost announces itself as the root of your app.

It has appealing aesthetic qualities as well:

  • app and lib have a pleasing symmetry — both three letters, with app coming first, and lib coming later when you need it
  • in the same way that $lib points to the contents of your lib folder, the $app/* imports are essentially a reification of your app. it makes sense that $app -> src/app and $lib -> src/lib
  • 'app root' is nicer to say than 'root route'
  • it's more compact, and we like things that are compact

Describe the proposed solution

We'd need to

  • change the default option here
  • update the templates
  • (optionally) detect the presence of a src/routes directory and invite people to either a) change the default kit.files.app to src/routes or b) preferably move src/routes to src/app

Alternatives considered

Keeping things as they are

Importance

nice to have

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions