Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR restores FastBoot compatibility.
It is heavily inspired by https://github.com/adopted-ember-addons/ember-cli-ifa/pull/57/files.
There are basically two main issues that need to be worked around for FastBoot:
document.querySelector(...)
, asdocument
is not available in Nodeen.json
) via XMLHttpRequest, as that is not available in NodeFor 1.), I used the same approach as the one in the references PR to ember-cli-ifa, to build a custom module for Node which can be requested in FastBoot environment (this is encapsulated in the new
utils/get-locale-asset-map.js
file).For 2.), we embed the actual locale file content in the asset map, instead of the path to the asset map, for the FastBoot module. This way, we avoid needing to make any Ajax requests in FastBoot environment.
FastBoot will also generate a
package.json
file in the output, which needs to be excluded from fingerprinting. This PR will automatically adjust the fingerprinting options to work with ember-l10n now, including addingjson
tofingerprint.extensions
for you. The user is informed about any changes made to the configuration in the console, e.g.:Note that it does not actually add FastBoot as a dev dependency, and does not add any FastBoot tests for now. I did install FastBoot locally and tried it, to ensure it works as expected (which it did for me).
Fixes #59