embroider-build / embroider

Compiling Ember apps into spec-compliant, modern Javascript.
MIT License
331 stars 137 forks source link

Clarification on splitAtRoutes expectations? #973

Closed NullVoxPopuli closed 2 years ago

NullVoxPopuli commented 2 years ago

For cross-referencing: https://github.com/josemarluedke/docfy/issues/111

Docfy generates routes at build time and instructs users to make their router include addDocfyRoutes:

example router.js ```js import EmberRouter from '@ember/routing/router'; import { addDocfyRoutes } from '@docfy/ember'; import config from 'ember-cheat-sheet/config/environment'; export default class Router extends EmberRouter { location = config.locationType; rootURL = config.rootURL; } Router.map(function () { addDocfyRoutes(this); }); ```

I had tried to configured splitAtRoutes here: https://github.com/NullVoxPopuli/ember-cheat-sheet/blob/main/ember-cli-build.js#L23

splitAtRoutes: ['docs', 'docs.templates'],

which is the "name" of the routes. Confirmable here: https://cheatsheet.glimmer.nullvoxpopuli.com/docs (with the ember-inspector open) image

Is my configuration correct? did I miss something in the splitAtRoutes docs?

Could this be related to: https://github.com/embroider-build/embroider/issues/972 (I did try ember s with that environment variable, and it made no difference)

here is what running with splitAtRoutes uncomment looks like: image

ef4 commented 2 years ago

You need to switch to @embroider/router here:

https://github.com/NullVoxPopuli/ember-cheat-sheet/blob/f44bd9451621998156d8ab1ea0362bef577bbe1d/app/router.ts#L1

NullVoxPopuli commented 2 years ago

ah ok -- only 2 subtle mentions of this: