Skip to content
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

[ALOY-1567] Removed minification code #827

Merged
merged 7 commits into from May 30, 2017
Merged

Conversation

cb1kenobi
Copy link
Contributor

@sgtcoolguy
Copy link
Contributor

sgtcoolguy commented May 26, 2017

This won't work unless we're agreeing to migrate behavior to the main SDK minification - and it will break there if we do anyways.

Those 3 babel plugins were the equivalent of the old uglifyjs compressor stuff that alloy relies on to 'optimize' dead code after inserting booleans for the OS_* constants and string values for Ti.Platform.name and Ti.Platform.osname. The unit tests assume they will run and prune dead code here.

I've argued that this behavior should likely move over to the main SDK build process anyways, since it is generally useful. But this does break the tests as-is and will change alloy's behavior.

Also, a note that even if we remove babili and/or those plugins here, they'll still get run in the SDK when we are doing minification - which I'm assuming will generate "broken" code for TiCore?

@cb1kenobi
Copy link
Contributor Author

The minification should ONLY be done by Titanium since Titanium controls whether we should minify in the first place.

As far as dead code removal is concerned, I'm fine with this in Alloy, however babel-plugin-minify-dead-code-elimination has a bug where hoisted functions defined in block scopes are removed instead of being moved to the parent scope. We'll have to mark the tests as 'skip' until babel-plugin-minify-dead-code-elimination is fixed.

Yes, the babili code in node-titanium-sdk is will also cause issues and we'll need to remove babel-plugin-minify-dead-code-elimination from there too.

@feons
Copy link
Contributor

feons commented May 30, 2017

Approved.

@feons feons merged commit 17bd82d into tidev:master May 30, 2017
@cb1kenobi cb1kenobi deleted the ALOY-1567 branch May 30, 2017 18:51
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.

None yet

3 participants