You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
uses a FastBoot guard to import the vendor file ua-parser-js
moved instance-initializer/browser/ember-useragent to instance-initializer/ember-useragent and added FastBoot guard
instance-initializer/fastboot/ember-useragent remains in place for the time being. Current ember-cli-fastboot will filter this away, upcoming FastBoot 1.0 (see Refactor fastboot build to be more performant ember-fastboot/ember-cli-fastboot#369) will move this to fastboot/instance-initializers/ember-useragent and include that into app-fastboot.js, so in either way this will be only executed in FastBoot. Once support for FastBoot pre 1.0 can be dropped, this can be moved to fastboot/instance-initializers/ember-useragent in the repo itself.
Tested this in a real app, with current and future ember-cli-fastboot.
@kratiahuja Hope I got it right, as per your suggestions on Slack. Mind having another look?
Hm, I think we might have a problem here, unfortunately!
As we removed the tree filtering of instance-initializer/(fastboot|browser)/* (because that required process.env.EMBER_CLI_FASTBOOT to be set, which is gone with FastBoot 1.0), the instance-initializer/fastboot/ember-useragent will only be filtered (pre 1.0) or moved to fastboot/instance-initializer/ember-useragent (post 1.0) when the consuming app is actually using ember-cli-fastboot. An FastBoot-less app will actually run the fastboot initializer in the browser! 😫
So I guess we would have to add a guard to it as well, like if (typeof FastBoot !== 'undefined') { ... }!? cc @kratiahuja
@simonihmig yeah i see the issue. My bad. I didn't think of this usecase and that's also the reason why addons are calling fastboot-filter-initializers or preconcatTree. I guess we will need to add the check to make the addons compatible.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
process.env.EMBER_CLI_FASTBOOTand(instance-)?initializers/(browser|fastboot)will be gone in FastBoot 1.0. This should now work in pre and post 1.0 versions ofember-cli-fastboot. See ember-fastboot/ember-cli-fastboot#360 and https://gist.github.com/kratiahuja/fd073007e10abb9db0a2ec42bc1d7c17 for context.ua-parser-jsinstance-initializer/browser/ember-useragenttoinstance-initializer/ember-useragentand added FastBoot guardinstance-initializer/fastboot/ember-useragentremains in place for the time being. Currentember-cli-fastbootwill filter this away, upcoming FastBoot 1.0 (see Refactor fastboot build to be more performant ember-fastboot/ember-cli-fastboot#369) will move this tofastboot/instance-initializers/ember-useragentand include that intoapp-fastboot.js, so in either way this will be only executed in FastBoot. Once support for FastBoot pre 1.0 can be dropped, this can be moved tofastboot/instance-initializers/ember-useragentin the repo itself.Tested this in a real app, with current and future
ember-cli-fastboot.@kratiahuja Hope I got it right, as per your suggestions on Slack. Mind having another look?