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

update babel-plugin-transform-amp-asserts with devAssert removal. #23377

Merged
merged 18 commits into from
Aug 14, 2019

Conversation

erwinmombay
Copy link
Member

@erwinmombay erwinmombay commented Jul 17, 2019

Currently the transformer does not remove devAssert (we should leave userAssert's alone).

@erwinmombay erwinmombay changed the title Multi pipeline extra update babel-plugin-transform-amp-asserts with devAssert removal. Jul 17, 2019
@erwinmombay erwinmombay requested review from rsimha and jridgewell July 17, 2019 21:50
@erwinmombay erwinmombay force-pushed the multi-pipeline-extra branch from b59c971 to e4910be Compare July 17, 2019 21:51
@erwinmombay
Copy link
Member Author

@jridgewell @rsimha PTAL

Copy link
Contributor

@rsimha rsimha left a comment

Choose a reason for hiding this comment

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

LGTM. Will defer to @jridgewell to review and approve.

@rsimha
Copy link
Contributor

rsimha commented Jul 19, 2019

From the single pass failure logs, I see two issues:

  • Closure is complaining while DCEing the remnants of the assert removals
  • It appears that paths are being needlessly duplicated. For example, ads/google/a4a/ads/google/a4a/utils.js

@erwinmombay
Copy link
Member Author

@rsimha could you explain what you mean by "It appears that paths are being needlessly duplicated. For example, ads/google/a4a/ads/google/a4a/utils.js" ?

@rsimha
Copy link
Contributor

rsimha commented Jul 19, 2019

@rsimha could you explain what you mean by "It appears that paths are being needlessly duplicated. For example, ads/google/a4a/ads/google/a4a/utils.js" ?

The path should be ads/google/a4a/utils.js (the ads/google/a4a prefix is duplicated). I'm seeing the same pattern in most of the warnings printed by closure. Perhaps there's a missing base: <PATH> option to a gulp.src() somewhere?

@mrjoro
Copy link
Member

mrjoro commented Aug 8, 2019

Is this PR still active?

@erwinmombay erwinmombay force-pushed the multi-pipeline-extra branch from 512f12c to f2c9fce Compare August 12, 2019 17:43
@jridgewell jridgewell merged commit aa7c50f into ampproject:master Aug 14, 2019
@rsimha
Copy link
Contributor

rsimha commented Aug 14, 2019

@jridgewell @erwinmombay Today, AmpPass.java eliminates all these calls:

/**
* List of string suffixes to eliminate from the AST.
*/
ImmutableSet<String> suffixTypes = ImmutableSet.of(
"dev$$module$src$log().assert()",
"dev$$module$src$log().fine()",
"dev$$module$src$log().assertElement()",
"dev$$module$src$log().assertString()",
"dev$$module$src$log().assertNumber()",
"dev$$module$src$log().assertArray()",
"dev$$module$src$log().assertBoolean()",
"devAssert$$module$src$log()",
"user$$module$src$log().fine()"
);

Does this PR remove all of them? If not, are there plans to do so?

@jridgewell
Copy link
Contributor

They're all eliminated.

@rsimha
Copy link
Contributor

rsimha commented Aug 14, 2019

They're all eliminated.

When I tried removing AmpPass.java, the number of instances of assert in v0.js jumped from 20 to ~80. I don't think assertElement, etc. are being removed.

@jridgewell
Copy link
Contributor

Open an issue, please.

@rsimha
Copy link
Contributor

rsimha commented Aug 14, 2019

Open an issue, please.

#23960

thekorn pushed a commit to edelight/amphtml that referenced this pull request Sep 11, 2019
…ampproject#23377)

* temp

* temp

* temp

* add babel pipeline to multipass build

* temp

* temp

* temp

* temp

* add pre build code to execute before copying occurs

* apply lint fixes

* additional cleanup

* additional lint cleanup

* consolidate src globs location

* more lint fixes

* remove references to isCommonJsModule

* fix assert transformer to handle devAssert and userAssert

* fix tests

* lint fix
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.

5 participants