Skip to content

Fix for upcoming FastBoot 1.0 breaking changes#89

Closed
simonihmig wants to merge 1 commit intohtml-next:masterfrom
simonihmig:fix-fastboot-1.0
Closed

Fix for upcoming FastBoot 1.0 breaking changes#89
simonihmig wants to merge 1 commit intohtml-next:masterfrom
simonihmig:fix-fastboot-1.0

Conversation

@simonihmig
Copy link
Contributor

process.env.EMBER_CLI_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 for context.

@eriktrom
Copy link
Member

Super awesome. I'll take a look and get her in. Thanks a bunch.

if (!process.env.EMBER_CLI_FASTBOOT) {
app.import('vendor/hammer.js');
}
app.import('vendor/hammer.js');

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you need app.import if it is merged in the vendor tree?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, you do. You can only import from bower_component and vendor, that's why the file from node_modules needs to be moved to the vendor tree. But you still have to import it.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

aah didn't know about that magic. LGTM!

@simonihmig
Copy link
Contributor Author

@eriktrom anything missing to get this merged?

});
hammerTree = map(hammerTree, (content) => `if (typeof FastBoot === 'undefined') { ${content} }`);

return new MergeTrees([vendorTree, hammerTree]);
Copy link

@timmyomahony timmyomahony Jun 8, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm getting an error with this:

BroccoliMergeTrees: Expected Broccoli node, got undefined for inputNodes[0]

I think it needs something like (edited it a bit):

treeForVendor(vendorTree) {
  let hammerTree = new Funnel(path.dirname(require.resolve('hammerjs')), {
    files: ['hammer.js']
  });
  hammerTree = map(hammerTree, (content) => `if (typeof FastBoot === 'undefined') { ${content} }`);

  var trees = [
    hammerTree
  ];

  if (vendorTrees) {
    trees.push(vendorTrees);
  }

  return new MergeTrees(trees);
}

@RobbieTheWagner
Copy link
Member

Just merged some changes that should implement this 👍

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.

5 participants