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

Refactor Dist Output #465

Merged
merged 9 commits into from
May 6, 2019
Merged

Refactor Dist Output #465

merged 9 commits into from
May 6, 2019

Conversation

kristoferbaxter
Copy link
Contributor

Motivations

  1. syntax npm proposal, allowing bundlers to selectively choose modern JS for an expected module output.
  2. Reduce the number of builds.
  3. Explicitly remove minification, compression, and ensure debugging code is retained for AMP specific builds.

Solution

Updated dist structure:

Screen Shot 2019-05-03 at 10 19 44 AM

Importantly each sub dependency is nested, to allow for the node resolution algorithm to correctly grab relatively modern JS versus transpiled to ES5 code.

The matrix for features enabled per build:

default debug amp
minified X
transpiled mirrored output X X
debugging output included X X

Todo

  • Include debugging output reduction script for consumers of the amp version.

@kristoferbaxter
Copy link
Contributor Author

Will need to be a minor release since we're still pre 1.0.0, but changes the output names and locations.

Copy link
Collaborator

@dreamofabear dreamofabear left a comment

Choose a reason for hiding this comment

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

OOC, what version number are you going to release this as?

config/rollup.main-thread.js Outdated Show resolved Hide resolved
document.addEventListener('DOMContentLoaded', function() {
MainThread.upgradeElement(document.getElementById('upgrade-me'), '/dist/worker.safe.js');
}, false);
</script>
Copy link
Collaborator

Choose a reason for hiding this comment

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

Intentionally removing nomodule support here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, the amp builds do not generate a nomodule output. The expectation is AMP as a consumer will perform the work of transpiling this output.

Do you think this is a concern?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Right-o.

* Do not let Babel transpile template literals

* Keep whitespace removal, allow babel + closure to compress other objects
@kristoferbaxter
Copy link
Contributor Author

OOC, what version number are you going to release this as?

Thought was to release as 0.11.0 since minors can reflect significant changes pre 1.0.0. What do you think?

@dreamofabear
Copy link
Collaborator

0.11.0 SGTM.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants