Skip to content

♻️ amp-story: Refactor JSX#36706

Merged
alanorozco merged 46 commits intoampproject:mainfrom
alanorozco:amp-story-jsx-optimized
Nov 30, 2021
Merged

♻️ amp-story: Refactor JSX#36706
alanorozco merged 46 commits intoampproject:mainfrom
alanorozco:amp-story-jsx-optimized

Conversation

@alanorozco
Copy link
Copy Markdown
Member

@alanorozco alanorozco commented Nov 2, 2021

Refactor to take advantage of JSX inline patterns. Rendering functions were simplified were possible. Local instance members were removed in cases where inlining was simpler.

This simplifies the model of rendering functions, while shrinking the amp-story bundle by 0.90 kb in compressed size.

@amp-owners-bot
Copy link
Copy Markdown

amp-owners-bot bot commented Nov 2, 2021

Hey @gmajoulet, @newmuis! These files were changed:

extensions/amp-story/1.0/amp-story-access.js
extensions/amp-story/1.0/amp-story-consent.js
extensions/amp-story/1.0/amp-story-draggable-drawer.js
extensions/amp-story/1.0/amp-story-embedded-component.js
extensions/amp-story/1.0/amp-story-form.js
extensions/amp-story/1.0/amp-story-hint.js
extensions/amp-story/1.0/amp-story-info-dialog.js
extensions/amp-story/1.0/amp-story-open-page-attachment.js
extensions/amp-story/1.0/amp-story-page-attachment.js
extensions/amp-story/1.0/amp-story-page.js
extensions/amp-story/1.0/amp-story-share-menu.js
extensions/amp-story/1.0/amp-story-share.js
+10 more

@alanorozco alanorozco changed the title ♻️ \amp-story\: Refactor JSX ♻️ amp-story: Refactor JSX Nov 2, 2021
@alanorozco alanorozco force-pushed the amp-story-jsx-optimized branch from 713bf92 to c87e8c6 Compare November 2, 2021 15:19
@lgtm-com

This comment has been minimized.

Copy link
Copy Markdown
Contributor

@gmajoulet gmajoulet left a comment

Choose a reason for hiding this comment

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

0.4 more kb shaved!!
I didn't read all the code that closely but the overall direction is awesome, thank you Alan.

@alanorozco alanorozco force-pushed the amp-story-jsx-optimized branch from fcfac23 to 393b0d8 Compare November 4, 2021 04:58
@lgtm-com

This comment has been minimized.

@lgtm-com
Copy link
Copy Markdown

lgtm-com bot commented Nov 4, 2021

This pull request introduces 1 alert when merging 398e75e into 2d5d9a2 - view on LGTM.com

new alerts:

  • 1 for Potentially unsafe external link

@lgtm-com
Copy link
Copy Markdown

lgtm-com bot commented Nov 4, 2021

This pull request introduces 1 alert when merging 1790841 into 2d5d9a2 - view on LGTM.com

new alerts:

  • 1 for Potentially unsafe external link

@alanorozco alanorozco force-pushed the amp-story-jsx-optimized branch from 1790841 to e7f2b2f Compare November 4, 2021 15:07
@lgtm-com
Copy link
Copy Markdown

lgtm-com bot commented Nov 4, 2021

This pull request introduces 1 alert when merging e7f2b2f into d287103 - view on LGTM.com

new alerts:

  • 1 for Potentially unsafe external link

@samouri
Copy link
Copy Markdown
Member

samouri commented Nov 4, 2021

Does this JSX work in classic AMP?

@alanorozco
Copy link
Copy Markdown
Member Author

@samouri Yep!

@lgtm-com
Copy link
Copy Markdown

lgtm-com bot commented Nov 4, 2021

This pull request introduces 1 alert when merging d3c08b4 into 27754c5 - view on LGTM.com

new alerts:

  • 1 for Potentially unsafe external link

@alanorozco alanorozco force-pushed the amp-story-jsx-optimized branch from d3c08b4 to 721ef27 Compare November 4, 2021 20:48
@lgtm-com
Copy link
Copy Markdown

lgtm-com bot commented Nov 4, 2021

This pull request introduces 1 alert when merging 721ef27 into ce5decd - view on LGTM.com

new alerts:

  • 1 for Potentially unsafe external link

@alanorozco alanorozco force-pushed the amp-story-jsx-optimized branch from 721ef27 to a649760 Compare November 5, 2021 17:34
// We set the href imperatively here to avoid triggering the warning
// (an lgtm-disable comment will not work due to formatting, unfortunately.)
// Consider whether we can use `noopener` and/or `noreferrer` so that we
// can inline the attribute, and avoid the warning.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thank you for leaving a comment explaining this!

@alanorozco alanorozco force-pushed the amp-story-jsx-optimized branch from 3591485 to 82f702b Compare November 11, 2021 21:40
@alanorozco alanorozco force-pushed the amp-story-jsx-optimized branch 2 times, most recently from a101f4a to d758312 Compare November 23, 2021 21:45
@lgtm-com

This comment has been minimized.

@alanorozco alanorozco force-pushed the amp-story-jsx-optimized branch from cf1dc76 to 4d2f064 Compare November 24, 2021 00:25
@alanorozco alanorozco force-pushed the amp-story-jsx-optimized branch from 42692d2 to eebe544 Compare November 29, 2021 22:33
@alanorozco alanorozco merged commit 27e204e into ampproject:main Nov 30, 2021
@alanorozco alanorozco deleted the amp-story-jsx-optimized branch November 30, 2021 16:37
@alanorozco alanorozco restored the amp-story-jsx-optimized branch November 30, 2021 16:37
@alanorozco alanorozco deleted the amp-story-jsx-optimized branch November 30, 2021 16:37
@alanorozco alanorozco restored the amp-story-jsx-optimized branch November 30, 2021 16:37
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.

7 participants