ember-engines / ember-engines

Composable Ember applications for ambitious user experiences
http://ember-engines.com/
MIT License
490 stars 140 forks source link

Fastboot assets being exported to web-only engine build #490

Open arjansingh opened 7 years ago

arjansingh commented 7 years ago

Summary

The asset-manifest.json generated by Ember Engines is asking the browser to fetch Fastboot- specific build code. This code should be filtered out by the Engine build process but its not.

It occurs in any engine that is mounted in an application that contains ember-cli-fastboot, regardless of whether that host application is being Fastbooted or not.

The main discussion/discovery of this happened on: https://github.com/ember-cli/ember-fetch/pull/70

Reproduction steps and sample Ember App that duplicates this behavior is here: https://github.com/arjansingh/ember-bugs/pull/1

Any thoughts on a potential fix?

// CC @kratiahuja

knownasilya commented 7 years ago

Also just hit this issue. This happens when ember-fetch is a dependency and not a dev dependency in package.json. It works just fine if you move it to devDependencies.

trentmwillis commented 7 years ago

The issue here is that the asset manifest is generated by crawling the directory structure at the end of the build. Thus any files in the crawled directories get added to the manifest. We recently landed a change to ember-asset-loader to allow files to be ignored, but the API is not currently exposed in ember-engines.

villander commented 6 years ago

This issue was created before Fastboot support. I think that this can be closed.

cc: @rwjblue

jasonmit commented 6 years ago

@villander any chance you can reopen this? This issue is still active. Ran into it with the latest of ember-fetch and ember-engines.

@trentmwillis's API for allowing engines to exclude files from the manifest would resolve this.

Happy to carry the torch if anyone wants to pass along some context before I get started. My assumption is this config should be read from the engine config. Since there isn't really a build time app.optionsobjects in the context of an engine, we would need to come to a consensus on that first. Perhaps we hang off the addon/engine object and the host app, the one generating the manifest, would merge all the engine options together.

rwjblue commented 6 years ago

@jasonmit - Maybe we can start with a small repro? (Mostly to make sure I grok the current issue that you mentioned in ember-cli/ember-fetch#69...)

jasonmit commented 6 years ago

@rwjblue here is an example of the issue: https://github.com/jasonmit/x-lazy-app/