-
Notifications
You must be signed in to change notification settings - Fork 82
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] Remove all addon artefacts from production build #98
[WIP] Remove all addon artefacts from production build #98
Conversation
Can an addon blacklist it's own addon dependencies like an app can? |
@kellyselden Don't think so. The blacklist is part of I guess you are refering to the issue of removing the addon dependencies? |
@chrislopresto could I get some feedback on this? |
@simonihmig I've been working with @chrislopresto on this topic and we are planning on going in a different direction. Instead of a custom stripping option/config, we're going to tell people how to blacklist ember-freestyle in their app's |
@lukemelia thanks, good to know. Afair I tried that approach as well, but wonder how you can make |
@simonihmig that was an indeed a blocker. We addressed it (along with criticism from people who want to use freestyle but are not using scss in their app) here. |
@simonihmig Thanks for getting the ball rolling on all of this. Your PR was a great jumpstart for @lukemelia and me the other day. As we reviewed this PR (and related approaches), we realized that stripping ember-freestyle bits in this fashion still left us with problems in scenarios where an app included an addon that itself included ember-freestyle. We made a few simplifying decisions to get the ball rolling on a few fronts:
Thanks again for the PR, the ideas, the payload reduction stats, etc. It really underscored the need to figure this out ASAP. I'm going to close this PR and a few others now that we have carved out a direction. Feel free to reach out with thoughts and questions as we work to get the next release out the door. Cheers! |
Ok guys, appreciate the feedback, and looking forward to your solution and the next release! |
Here is something to solve #31. Still not ready to merge, needs at least some review, documentation and maybe some acceptance tests.
It introduces a new option
enabled
for yourember-cli-build.js
, which defaults to false for a production build. So when this is false, it does the following:app
folder is removed from build, so none of the components are availableapp/styles
files with an empty file. This is to not break any@import
statements from the app'sapp.scss
, but still not add any styleguide related styles to the app's CSS payloadWhat it does not:
package.json
, namelyember-remarkable
andember-truth-helpers
. This is because I found no way to do that, see https://github.com/chrislopresto/ember-freestyle/compare/master...simonihmig:disable-production-build?expand=1#diff-168726dbe96b3ce427e7fedce31bb0bcR85. Maybe someone has an idea about this?ember-cli-funnel
. Did that for our app, works just fine. We can add documentation to make this easy for the user.This worked so far well for our app, reducing the JS payload by about 775kB! (uncompressed)
So, if this looks right for you, I can add some pieces to the docs and add some tests.