Skip to content

Comments

Prepare for FastBoot 1.0 breaking changes#1

Merged
willviles merged 1 commit intowillviles:masterfrom
simonihmig:prepare-fastboot-1.0
Apr 25, 2017
Merged

Prepare for FastBoot 1.0 breaking changes#1
willviles merged 1 commit intowillviles:masterfrom
simonihmig:prepare-fastboot-1.0

Conversation

@simonihmig
Copy link
Contributor

process.env.EMBER_CLI_FASTBOOT and (instance-)?initializers/(browser|fastboot) will be gone in FastBoot 1.0. This should now work in pre and post 1.0 versions of ember-cli-fastboot. See ember-fastboot/ember-cli-fastboot#360 and https://gist.github.com/kratiahuja/fd073007e10abb9db0a2ec42bc1d7c17 for context.

  • 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?

@kratiahuja
Copy link

LGTM @simonihmig . Thank you!

@willviles
Copy link
Owner

I've quickly tested w/Ember Fastboot < 1.0 & 1.0 and can confirm everything's in order. Thanks @simonihmig & @kratiahuja!

@willviles willviles merged commit 3300d7b into willviles:master Apr 25, 2017
@simonihmig simonihmig deleted the prepare-fastboot-1.0 branch April 26, 2017 08:52
@simonihmig
Copy link
Contributor Author

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

@kratiahuja
Copy link

kratiahuja commented Apr 26, 2017

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants