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 the Babel plugin to remove empty static blocks #18562

Merged
merged 1 commit into from
Aug 5, 2024

Conversation

nicolo-ribaudo
Copy link
Contributor

Update the Babel plugin to remove empty static blocks

This commit updates the Babel plugin to:

  • apply the same flattening logic that we already have for blocks, to flatten blocks nested inside class static blocks
  • remove class static blocks when, after flattening all the blocks they contain, they are empty.

Before this commit, the transform output was the same as the input.

Closes #18559

Copy link
Collaborator

@Snuffleupagus Snuffleupagus left a comment

Choose a reason for hiding this comment

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

r=me, with the comment addressed and passing tests; thank you!

external/builder/fixtures_babel/staticblock.js Outdated Show resolved Hide resolved
This commit updates the Babel plugin to:
- apply the same flattening logic that we already
  have for blocks, to flatten blocks nested inside
  class static blocks
- remove class static blocks when, after flattening
  all the blocks they contain, they are empty.

Before this commit, the transform output was the
same as the input.
external/builder/fixtures_babel/staticblock-expected.js Dismissed Show dismissed Hide dismissed
external/builder/fixtures_babel/staticblock.js Dismissed Show dismissed Hide dismissed
@Snuffleupagus
Copy link
Collaborator

/botio test

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Windows)


Received

Command cmd_test from @Snuffleupagus received. Current queue size: 0

Live output at: http://54.193.163.58:8877/e38aa397a12e696/output.txt

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Received

Command cmd_test from @Snuffleupagus received. Current queue size: 0

Live output at: http://54.241.84.105:8877/ae26256d9f6719a/output.txt

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Linux m4)


Failed

Full output at http://54.241.84.105:8877/ae26256d9f6719a/output.txt

Total script time: 30.15 mins

  • Unit tests: Passed
  • Integration Tests: Passed
  • Regression tests: FAILED
  different ref/snapshot: 15

Image differences available at: http://54.241.84.105:8877/ae26256d9f6719a/reftest-analyzer.html#web=eq.log

@moz-tools-bot
Copy link
Collaborator

From: Bot.io (Windows)


Failed

Full output at http://54.193.163.58:8877/e38aa397a12e696/output.txt

Total script time: 45.31 mins

  • Unit tests: Passed
  • Integration Tests: Passed
  • Regression tests: FAILED
  different ref/snapshot: 1

Image differences available at: http://54.193.163.58:8877/e38aa397a12e696/reftest-analyzer.html#web=eq.log

@Snuffleupagus Snuffleupagus merged commit d32b294 into mozilla:master Aug 5, 2024
6 checks passed
@nicolo-ribaudo nicolo-ribaudo deleted the babel-static-block branch August 5, 2024 15:01
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.

Update the Babel plugin to remove empty static initialization blocks
3 participants