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

πŸ—βœ¨ Enable lazy-build and watch modes for minified code #27471

Merged
merged 1 commit into from
Mar 30, 2020
Merged

πŸ—βœ¨ Enable lazy-build and watch modes for minified code #27471

merged 1 commit into from
Mar 30, 2020

Conversation

rsimha
Copy link
Contributor

@rsimha rsimha commented Mar 28, 2020

Background:

With #27426 and #27447, the pre-closure babel transforms run by gulp dist were refactored from all-at-once to on-demand. This paves the way for lazy-build and watch modes for minified code.

PR Highlights:

  • Introduces watch mode for minified code
  • Standardizes minified and unminified usage via β€”watch
  • Introduces lazy-build mode for minified code
  • Reduces minified startup from ~7m (gulp dist) to <1m (gulp --compiled)
  • Standardizes error handling during compilation and cleans up error logging
  • Cleans up internal flags and options
  • Updates stale documentation

Newly added commands:

# Unminified watch build
gulp build --watch # Replaces gulp watch
# Minified watch build
gulp dist --watch
# Minified watch build for just the core runtime
gulp dist --watch --core_runtime_only
# Minified watch build for some extensions
gulp dist --watch --extensions=amp-foo,amp-bar
# Minified watch build for extensions used by an example file
gulp dist --watch --extensions_from=examples/foo.amp.html 
# Minified lazy + watch build
gulp --compiled
# Minified lazy + watch build (pre-build some extensions)
gulp --compiled --extensions=amp-foo,amp-bar
# Minified lazy + watch build (pre-build extensions used by an example file)
gulp --compiled --extensions_from=examples/foo.amp.html 

Examples:

gulp --compiled

image

gulp dist --watch --core_runtime_only

image

Follow up to #27426 and #27447

@cramforce
Copy link
Member

Nice!
CC @kristoferbaxter as this is very relevant for performance debugging. We should also make sure more people know about pseudo optimized code.

Copy link
Member

@samouri samouri left a comment

Choose a reason for hiding this comment

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

This change is awesome ⭐️

build-system/server/lazy-build.js Show resolved Hide resolved
build-system/tasks/build.js Show resolved Hide resolved
build-system/tasks/dist.js Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants