Skip to content

Remove the globals dependency#18509

Merged
timvandermeij merged 1 commit into
mozilla:masterfrom
timvandermeij:globals
Jul 29, 2024
Merged

Remove the globals dependency#18509
timvandermeij merged 1 commit into
mozilla:masterfrom
timvandermeij:globals

Conversation

@timvandermeij

@timvandermeij timvandermeij commented Jul 29, 2024

Copy link
Copy Markdown
Collaborator

This dependency got introduced in PR #10293, almost six years ago now, because eslint-plugin-mozilla didn't work without it but also didn't require it as a dependency itself.

However, nowadays eslint-plugin-mozilla works just fine without it, and other dependencies that need it correctly require it themselves. This can be seen using npm ls globals:

$ npm ls globals
pdf.js
├─┬ @babel/core@7.24.9
│ └─┬ @babel/traverse@7.25.0
│   └── globals@11.12.0
├─┬ @babel/preset-env@7.25.0
│ └─┬ @babel/plugin-transform-classes@7.25.0
│   └── globals@11.12.0
├─┬ eslint-plugin-unicorn@55.0.0
│ └── globals@15.8.0 deduped
├─┬ eslint@8.57.0
│ ├─┬ @eslint/eslintrc@2.1.4
│ │ └── globals@13.24.0
│ └── globals@13.24.0
└── globals@15.8.0

Further proof that eslint-plugin-mozilla (no longer) uses globals is from a source code search in
https://searchfox.org/mozilla-central/search?q=globals&path=&case=false&regexp=false. The only results for eslint-plugin-mozilla refer to a file named globals.js, but the globals NPM package is not actually imported anywhere.

Given this we should be able to safely get rid of this explicit dependency on our end now.

Fixes a part of #18354.

This dependency got introduced in PR mozilla#10293, almost six years ago now,
because `eslint-plugin-mozilla` didn't work without it but also didn't
require it as a dependency itself.

However, nowadays `eslint-plugin-mozilla` works just fine without it,
and other dependencies that need it correctly require it themselves.
This can be seen using `npm ls globals`:

```
$ npm ls globals
pdf.js
├─┬ @babel/core@7.24.9
│ └─┬ @babel/traverse@7.25.0
│   └── globals@11.12.0
├─┬ @babel/preset-env@7.25.0
│ └─┬ @babel/plugin-transform-classes@7.25.0
│   └── globals@11.12.0
├─┬ eslint-plugin-unicorn@55.0.0
│ └── globals@15.8.0 deduped
├─┬ eslint@8.57.0
│ ├─┬ @eslint/eslintrc@2.1.4
│ │ └── globals@13.24.0
│ └── globals@13.24.0
└── globals@15.8.0
```

Further proof that `eslint-plugin-mozilla` (no longer) uses `globals` is
from a source code search in
https://searchfox.org/mozilla-central/search?q=globals&path=&case=false&regexp=false.
The only results for `eslint-plugin-mozilla` refer to a file named
`globals.js`, but the `globals` NPM package is not actually imported
anywhere.

Given this we should be able to safely get rid of this explicit
dependency on our end now.
@timvandermeij

Copy link
Copy Markdown
Collaborator Author

/botio-linux preview

@moz-tools-bot

Copy link
Copy Markdown
Collaborator

From: Bot.io (Linux m4)


Received

Command cmd_preview from @timvandermeij received. Current queue size: 0

Live output at: http://54.241.84.105:8877/3f4dab4d73e28b7/output.txt

@moz-tools-bot

Copy link
Copy Markdown
Collaborator

From: Bot.io (Linux m4)


Success

Full output at http://54.241.84.105:8877/3f4dab4d73e28b7/output.txt

Total script time: 1.03 mins

Published

@timvandermeij

Copy link
Copy Markdown
Collaborator Author

/botio test

@moz-tools-bot

Copy link
Copy Markdown
Collaborator

From: Bot.io (Linux m4)


Received

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

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

@moz-tools-bot

Copy link
Copy Markdown
Collaborator

From: Bot.io (Windows)


Received

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

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

@moz-tools-bot

Copy link
Copy Markdown
Collaborator

From: Bot.io (Linux m4)


Failed

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

Total script time: 30.00 mins

  • Unit tests: Passed
  • Integration Tests: Passed
  • Regression tests: FAILED
  different ref/snapshot: 16
  different first/second rendering: 1

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

@Snuffleupagus Snuffleupagus left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

r=me, thank you.

@moz-tools-bot

Copy link
Copy Markdown
Collaborator

From: Bot.io (Windows)


Failed

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

Total script time: 44.94 mins

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

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

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.

3 participants