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

Switch production codegen to use closure compiler. #1390

Merged
merged 1 commit into from Jan 17, 2016

Conversation

cramforce
Copy link
Member

Production part of #86. Does not implement type checking.

@erwinmombay
Copy link
Member

woot, nice find on the compiler issue (for the spread)

@cramforce
Copy link
Member Author

@erwinmombay Do you want to do a review?

  • Removed the uglify post processing
  • Fixed sourcemaps
  • There is now SIMPLE_PLUS_OPTIMIZATIONS in CC. (Only in local fork, flag will likely be different later) for ever better code size

@erwinmombay erwinmombay self-assigned this Jan 13, 2016
.pipe(rename(outputFilename + '.map'))
.pipe(gulp.dest(outputDir))
.on('end', resolve);
return gulp.src(intermediateFilename)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does this work correctly? i don't think iv'e ever started a read (using gulp.src) again on an event. ideally we'd break these down into smaller gulp tasks so we can sequence them correctly.

/cc @jridgewell

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It does work. Although I hate gulp and don't want to learn it :)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'm perfectly fine with this as long as it works. was just worried if there was anything racy (because of async nature of tasks. guessing gulp knows its still working)

haha yes, gulp likes to make things that are supposed to be easy slightly hard sometimes..

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we using an intermediate file name at all?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just for the gulp-replace, I can get rid of it for the source map.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you do the replace before passing it to closure?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't because the gulp-closure plugin doesn't actually work on streams.

@erwinmombay
Copy link
Member

@cramforce besides the questions, LGTM

@cramforce cramforce force-pushed the cc-all-the-things branch 2 times, most recently from a048ebe to d3768c4 Compare January 15, 2016 21:23
@cramforce
Copy link
Member Author

Now with 100% less hacks :)

@cramforce cramforce changed the title Experimental: Switch production codegen to use closure compiler. Switch production codegen to use closure compiler. Jan 17, 2016
@cramforce
Copy link
Member Author

YOLO

cramforce added a commit that referenced this pull request Jan 17, 2016
Switch production codegen to use closure compiler.
@cramforce cramforce merged commit fa453d9 into ampproject:master Jan 17, 2016
@cramforce cramforce deleted the cc-all-the-things branch January 17, 2016 04:22
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