Closed thoov closed 4 years ago
I pushed a new (squashed) commit that incorporates the feedback to become the true v5 schema. This created a couple opportunities for simplification. Here is a summary of the complete new format:
In package.json, the v5 schema supports:
fastboot.schemaVersion: 5
fastboot.moduleWhitelist: []
: unchanged meaning from v4.fastboot.htmlEntrypoint: 'index.html'
: the path to your HTML entrypoint filename
: note that in the new format, we take the appName directly from the package.json top level. This field is used for nothing else by the time we get to fastboot, so there was no reason for redundancy.All other fields that used to be supported in v4 under fastboot
are gone. There is no manifest
(the HTML is really our manifest now), and there is no config
(the HTML already contains the config too, no need for redundancy).
The HTML entrypoint file is any valid HTML, plus these fastboot-specific extensions:
<fastboot-script>
tags work like <script>
tags, but they will only run in fastboot and be stripped out before serving to browsers.<script data-fastboot-ignore></script>
will not run in fastboot, and the data attribute will be stripped out before serving to browsers.<script src="https://some-cdn.com/app.js" data-fastboot-src="assets/app.js"></script>
tells fastboot the local path to an asset that may have a different public URL for browser consumption. The data-fastboot-src attribute is stripped before serving to browsers.We found one issue while testing this against some apps -- we need to account for the configured rootURL. I will add another commit that covers this case.
tags work like Githubissues. Githubissues is a development platform for aggregating issues.
This PR introduces a new
htmlEntrypoint
property on the manifest which allows this entry point to be the source of truth finding assets instead of them being defined as apart of the manifest itself. The primary use case for this is to allow embroider's asset chunking to more naturally work. This is a simplification from an earlier attempt (https://github.com/ember-fastboot/ember-cli-fastboot/pull/753) which can be closed after this is merged.This also introduces a concept of
<fastboot-script src=""></fastboot-script>
which is used to ignore scripts not intended for the browser. Here is how embroider uses these scripts:embroider usage 1 / embroider usage 2
These changes are opt-in and backwards compatible.
cc: @rwjblue / @kratiahuja
This PR is co-authored by @ef4