Skip to content
This repository has been archived by the owner on Jan 20, 2019. It is now read-only.

Commit

Permalink
updates based on feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
GavinJoyce committed Nov 7, 2016
1 parent 17effe9 commit af60ace
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions active/0000-production-code-stripping.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,23 @@ A Babel plugin will execute the removal of these function calls. It will either
* [babel-plugin-filter-imports](https://github.com/ember-cli/babel-plugin-filter-imports) with added support for defining module functions for removal ([spike here](https://github.com/GavinJoyce/babel-plugin-filter-imports/pull/1))
* a new babel plugin which works similarly to `babel-plugin-filter-imports`

For consistency, this plugin should also be used in Ember Data and other Ember projects which would benefit from the reduced size.
The babel plugin will affect the code of the current app or addon only and won't affect code in child or grandchild addons. As this change becomes part of the default ember-cli configuration, addons will adopt the code stripping as they upgrade to newer ember-cli versions.

# How We Teach This

This change doesn't bring any new functionality or visible changes. Other than updating the Ember API docs, we don't need to make guide or other documentation changes.
This change doesn't bring any new functionality. Other than updating the Ember API docs, we don't need to make guide or other documentation changes. At the time of releasing, we may want to point out the possible side effects in a release blog post (see the _Drawbacks_ section below).

If we want to expose the configuration options so that application authors can customise the settings, we can include a new section in the Ember CLI docs.
If we want to expose the configuration options so that application authors can customize the settings, we can include a new section in the Ember CLI docs.

# Drawbacks

These functions are already no-ops in production so there are no obvious drawbacks
This may introduce an unexpected change in production builds as arguments that have side effects will no longer be executed. For example:

```js
Ember.assert('Some assertion', someSideEffect());
```

Currently, the `someSideEffect` function will be executed in production. When this RFC lands, it won't.

# Alternatives

Expand All @@ -47,3 +53,4 @@ An Ember addon could provide opt-in function stripping for applications that wan
# Unresolved questions

* [ ] Should we allow the stripping configuration to be overridden in `ember-cli-build.js`? If so, what should the API be?
* [ ] Related to above, should we allow the feature to be disabled?

0 comments on commit af60ace

Please sign in to comment.