Today I Learned

hashrocket A Hashrocket project

The pitfalls of `rootURL` and `baseURL`

rootURL

Notice that the rootURL parameter has a trailing /. This is required and will raise an error otherwise. There is also an internal assert in Ember that raises if any URL does not start with the rootURL. For our example, if a user tries to navigate to /app/foo the app will throw an error.

fix

Sadly, the fix for this issue must to be implemented server-side.

baseURL

The problems with baseURL are subtle but have caused the core team many issues with testing, styles, history, etc.

fix

Most of the problems are actually related to the HTML spec and are unrelated to Ember.js such as certain SVG issues. As such, the only real fix for the <base> tag is to kill it and use broccoli-asset-rev to actually change the URLs at build time.

See More #emberjs TILs