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

🏗Always build amp-loader and amp-auto-lightbox. #24137

Closed
wants to merge 9 commits into from

Conversation

sparhami
Copy link

It is easy to forget to build these extensions when running locally.
Since these are loaded by the runtime, they should be built in order to
get a more accurate representation of how AMP behaves when manually
testing changes.

  • Remove unnecessary @private for things that are not exported.
  • Remove unnecessary type that can be inferred.

- It is easy to forget to build these extensions when running locally.
Since these are loaded by the runtime, they should be built in order to
get a more accurate represnetation of how AMP behaves when manually
testing changes.
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 with one comment below.

build-system/tasks/extension-helpers.js Outdated Show resolved Hide resolved
Sepand Parhami added 6 commits August 22, 2019 10:43
- Do not build all extensions when specified extensions are empty, since
we always build some extensions (amp-laoder, amp-auto-lightbox).
- Stop using the gulp entry point to build CSS from dep-check, instead
do the same things (update pacakges, priint help message and call the
compile CSS with option to build all.
@sparhami
Copy link
Author

Had to make some more changes, since there was an assumption that having no extensions to build meant to build all the extensions. I fixed dep-check which was relying on this assumption, but I may have missed others that also have the same problem.

@sparhami sparhami requested a review from rsimha August 23, 2019 18:21
@sparhami
Copy link
Author

Looks like this actually also applies to the dist target. I think I need to change the approach here.

@rsimha
Copy link
Contributor

rsimha commented Aug 23, 2019

Looks like this actually also applies to the dist target. I think I need to change the approach here.

You're right. There's another problem too. buildExtensions() in build-system/tasks/extension-helpers.js does nothing when --noextensions is passed in to gulp. This means DEFAULT_EXTENSION_SET won't actually get built.

I too will play around with the code to see if I can spot a simple fix.

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.

I'd like to push back against several of the changes you've made because I believe there's a cleaner way to do what you're trying to do.

  • options.compileAll was added years ago, and is no longer necessary after recent refactors. (I've meant to remove it for a while.)
  • options.compileOnlyCss is a sufficient signal for buildExtensions to compile all the CSS and no JS.
  • I think the way to do this is to roll back this PR to 454560e and then remove options.compileAll from buildExtensions.

I'll try to come up with a working version that includes your changes until 454560e. SG?

@sparhami
Copy link
Author

I'll try to come up with a working version that includes your changes until 454560e. SG?

Sounds good.

@rsimha
Copy link
Contributor

rsimha commented Aug 23, 2019

@sparhami I just sent you #24193 for review. It should effectively replace this PR. Feel free to test locally and let me know what you think.

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.

None yet

3 participants