Skip to content

Remove unused preset-env dependencies#10916

Merged
andreslucena merged 3 commits intodevelopfrom
fix/babel-preset-env
May 29, 2023
Merged

Remove unused preset-env dependencies#10916
andreslucena merged 3 commits intodevelopfrom
fix/babel-preset-env

Conversation

@alecslupu
Copy link
Copy Markdown
Contributor

@alecslupu alecslupu commented May 26, 2023

🎩 What? Why?

While working on #10727 i have noticed the pipeline failed, due to some babel configuration as per below stacktrace:

Since @babel/preset-env has been updated to 7.22.0, it has removed the dependency to @babel/plugin-proposal-private-property-in-object.

Since I have added @babel/plugin-proposal-private-property-in-object, @babel/plugin-proposal-private-methods and @babel/plugin-proposal-class-properties back in #8670, and I do not remember why, i am removing it in the current PR.

Testing

Make sure the pipeline is green.

♥️ Thank you!

@alecslupu alecslupu added dependencies Pull requests that update a dependency file or issues that talk about updating dependencies javascript Pull requests that update Javascript code type: fix PRs that implement a fix for a bug labels May 26, 2023
@alecslupu alecslupu requested a review from a team May 26, 2023 16:24
@alecslupu alecslupu marked this pull request as ready for review May 26, 2023 17:49
@andreslucena
Copy link
Copy Markdown
Member

@alecslupu I'm not able to reproduce the error locally by following the instructions, but just seeing the changes (and specially the pipeline result 😄) it wouldn't hurt. I had just two doubts:

  1. In the plugins' doc page it says:

NOTE: This plugin is included in @babel/preset-env, in ES2022

So, I understand that we could remove it altogether from our configuration if we update @babel/preset-env?

  1. I've seen that this rule was introduced on Update npm dependencies #8670, but as far as I remember we are not using this new syntax. Do you remember/know why we introduced this babel plugin?

@andreslucena
Copy link
Copy Markdown
Member

FYI, I've removed the unfilled section from the PR template

@alecslupu
Copy link
Copy Markdown
Contributor Author

@alecslupu I'm not able to reproduce the error locally by following the instructions, but just seeing the changes (and specially the pipeline result smile) it wouldn't hurt. I had just two doubts:

1. In the [plugins' doc page](https://babeljs.io/docs/babel-plugin-transform-private-property-in-object) it says:

NOTE: This plugin is included in @babel/preset-env, in ES2022

So, I understand that we could remove it altogether from our configuration if we update @babel/preset-env?

2. I've seen that this rule was introduced on [Update npm dependencies #8670](https://github.com/decidim/decidim/pull/8670), but as far as I remember we are not using this new syntax. Do you remember/know why we introduced this babel plugin?
  1. I would say that if we upgrade the preset env maybe we will fix this issue. I would not try to do it in this PR, as it is currently blocking all the dev activities, and i see a potential of having unforeseen issues ...
  2. I do not remember why i have added that. If i remember right, January 2022 was around a rails upgrade.

@alecslupu
Copy link
Copy Markdown
Contributor Author

I confirm that if we upgrade the preset env and we remove that config entry, the compilation process is successful.

@alecslupu alecslupu force-pushed the fix/babel-preset-env branch from 34bc4db to db1ab2e Compare May 29, 2023 06:41
@alecslupu alecslupu changed the title Lock @babel/preset-env and @babel/core Remove unused preset-env dependencies May 29, 2023
Copy link
Copy Markdown
Contributor

@ahukkanen ahukkanen left a comment

Choose a reason for hiding this comment

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

I tested this approach in another repository where we had the same issue and it seems to have fixed the problem.

Also, I can see that the pipeline is green in this PR so it should be fine to merge.

I would like to have some kind of guidance also for implementors and module developers facing this issue once we can release the next versions, as it will take some time from now as we just released. But I am unsure what would be the correct place for such documentation, a GitHub issue maybe?

Anyways, regarding this PR, everything seems to be fine.

Copy link
Copy Markdown
Member

@andreslucena andreslucena left a comment

Choose a reason for hiding this comment

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

LGTM 👍🏽

@ahukkanen
Copy link
Copy Markdown
Contributor

@andreslucena I'll leave the final merge for you since you were already looking into this. Just to add some confirmation to the issue that this seems to be fixing the problem.

@andreslucena andreslucena merged commit 67c2631 into develop May 29, 2023
@andreslucena andreslucena deleted the fix/babel-preset-env branch May 29, 2023 08:43
@andreslucena
Copy link
Copy Markdown
Member

I would like to have some kind of guidance also for implementors and module developers facing this issue once we can release the next versions, as it will take some time from now as we just released. But I am unsure what would be the correct place for such documentation, a GitHub issue maybe?

Yes, a GH issue seems to be the place, probably referencing this PR

@ahukkanen
Copy link
Copy Markdown
Contributor

Yes, a GH issue seems to be the place, probably referencing this PR

Created #10918 explaining the workaround.

Feel free to edit if it is not clear enough.

@alecslupu alecslupu mentioned this pull request May 29, 2023
entantoencuanto added a commit that referenced this pull request May 29, 2023
* Remove unneeded dependency @babel/plugin-proposal-private-property-in-object

* Remove unneeded dependency @babel/plugin-proposal-private-methods

* Remove unneeded dependency @babel/plugin-proposal-class-properties
entantoencuanto added a commit that referenced this pull request May 29, 2023
* feature/redesign:
  Remove unused preset-env dependencies (#10916)
  Feature/redesign components breadcrumb (#10441)
entantoencuanto added a commit that referenced this pull request May 29, 2023
* feature/redesign:
  Remove unused preset-env dependencies (#10916)
entantoencuanto added a commit that referenced this pull request May 30, 2023
…rafts

* feature/redesign:
  Redesign: proposals (#10555)
  Remove unused preset-env dependencies (#10916)
entantoencuanto added a commit that referenced this pull request May 30, 2023
* feature/redesign:
  Redesign: proposals (#10555)
  Remove unused preset-env dependencies (#10916)
entantoencuanto added a commit that referenced this pull request Jun 2, 2023
* feature/redesign:
  Redesign: amendments (#10765)
  Redesign: proposals (#10555)
  Remove unused preset-env dependencies (#10916)
entantoencuanto added a commit that referenced this pull request Jun 2, 2023
* feature/redesign:
  Redesign: amendments (#10765)
  Redesign: proposals (#10555)
  Remove unused preset-env dependencies (#10916)
entantoencuanto added a commit that referenced this pull request Jun 2, 2023
…blies-details-page

* feature/redesign:
  Redesign: amendments (#10765)
  Redesign: proposals (#10555)
  Remove unused preset-env dependencies (#10916)
  Feature/redesign components breadcrumb (#10441)
  Redesign: debates (#10653)
  Redesign: Remove reference to commentable in activity cell (#10816)
  Redesign: spinner (#10848)
  Redesign: omnipresent banner (#10847)
  Add redesign enable ENV variable to control the pipeline (#10610)
entantoencuanto added a commit that referenced this pull request Jun 2, 2023
* feature/redesign:
  Redesign: amendments (#10765)
  Redesign: proposals (#10555)
  Remove unused preset-env dependencies (#10916)
entantoencuanto added a commit that referenced this pull request Jun 2, 2023
* feature/redesign:
  Redesign: amendments (#10765)
  Redesign: proposals (#10555)
  Remove unused preset-env dependencies (#10916)
  Feature/redesign components breadcrumb (#10441)
  Redesign: debates (#10653)
  Redesign: Remove reference to commentable in activity cell (#10816)
  Redesign: spinner (#10848)
  Redesign: omnipresent banner (#10847)
  Add redesign enable ENV variable to control the pipeline (#10610)
entantoencuanto added a commit that referenced this pull request Jun 2, 2023
* feature/redesign:
  Redesign: amendments (#10765)
  Redesign: proposals (#10555)
  Remove unused preset-env dependencies (#10916)
  Feature/redesign components breadcrumb (#10441)
  Redesign: debates (#10653)
  Redesign: Remove reference to commentable in activity cell (#10816)
  Redesign: spinner (#10848)
  Redesign: omnipresent banner (#10847)
  Add redesign enable ENV variable to control the pipeline (#10610)
  Redesign: progress bar (#10638)
  Redesign: meeting cards (#10722)
  Redesign: pending login (#10699)
entantoencuanto added a commit that referenced this pull request Jun 2, 2023
* feature/redesign:
  Redesign: amendments (#10765)
  Redesign: proposals (#10555)
  Remove unused preset-env dependencies (#10916)
  Feature/redesign components breadcrumb (#10441)
  Redesign: debates (#10653)
  Redesign: Remove reference to commentable in activity cell (#10816)
  Redesign: spinner (#10848)
  Redesign: omnipresent banner (#10847)
  Add redesign enable ENV variable to control the pipeline (#10610)
  Redesign: progress bar (#10638)
  Redesign: meeting cards (#10722)
  Redesign: pending login (#10699)
armandfardeau pushed a commit that referenced this pull request Jun 13, 2023
* Remove unneeded dependency @babel/plugin-proposal-private-property-in-object

* Remove unneeded dependency @babel/plugin-proposal-private-methods

* Remove unneeded dependency @babel/plugin-proposal-class-properties
@andreslucena
Copy link
Copy Markdown
Member

@alecslupu should we backport this one to v0.26 too?

@andreslucena
Copy link
Copy Markdown
Member

@alecslupu should we backport this one to v0.26 too?

Oh never mind, I see that we don't have this configuration there:

https://github.com/decidim/decidim/blob/release/0.26-stable/babel.config.json

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file or issues that talk about updating dependencies javascript Pull requests that update Javascript code type: fix PRs that implement a fix for a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants