thomasboyt / defeatureify Goto Github PK
View Code? Open in Web Editor NEWexperimental. node script to remove specially flagged feature blocks from ember source.
experimental. node script to remove specially flagged feature blocks from ember source.
(made this issue in the right repo this time)
https://gist.github.com/rjackson/b994de1561a4c720ade7#file-features-json-L5-L8
cc @rjackson
FYI, I wrapped this module in a grunt plugin so it would be available for grunt users.
https://github.com/craigteegarden/grunt-ember-defeatureify
Hope you don't mind, but I needed to strip Ember debug comments in a grunt build process and when some of the statements in Ember switched to multi-line statements my regex based line stripping code was definitely not working properly.
Hi,
The ember-cli-babel compress the file if file size is larger than 100kb.
Then, it seems that defeatureify also remove first character in next statement.
And error occur when do uglify. Could anyone help me?
babel-output_path-jVys26A1.tmp
Ember.debug('test');if(!this.flag){this.hoge = false;}
defeatureify_filter-tmp_dest_dir-H1J41JaT.tmp
:f(!this.flag){this.hoge = false;}
my environment is following:
ember: 1.12.0
ember-cli: 0.2.7
ember-cli-babel: 5.1.5
ember-cli-defeatureify: 1.1.1
my defeatureify option is following:
defeatureify: {
'enableStripDebug': true,
'debugStatements': [
'Ember.default.debug',
'Ember.default.runInDebug'
],
'features': {}
}
Thanks
Currently this hacky workaround is required:
if (Ember.FEATURES.isEnabled("foo")) {
// do nothing
} else {
// do something
}
Is this possible to use this with Ember.js CLI project? If yes then where do I have to put features.json and do I have to install this in some way or configure?
Currently defeatureify
does not support nested feature flags, and a build error occurs if the features.json
value is anything other than null
.
For reference this is where this functionality is needed at the moment:
https://github.com/emberjs/ember.js/blob/beta/packages/ember-metal/lib/computed.js#L690-691.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.