GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Avoid checking `Scope.globals` multiple times by liuxingbaoyu · Pull Request #16619 · babel/babel

Conversation

@liuxingbaoyu

@liuxingbaoyu liuxingbaoyu commented Jul 7, 2024 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member
Q                       A
Fixed Issues? Fixes #1, Fixes #2
Patch: Bug Fix?
Major: Breaking Change?
Minor: New Feature?
Tests Added + Pass? Yes
Documentation PR Link
Any Dependency Changes?
License MIT

Previously hasBinding was called on each parent scope, which resulted in multiple checks of Scope.globals and Scope.contextVariables.
This improvement is small, and I didn't notice a noticeable improvement in real-case-preset-env-typescript.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@liuxingbaoyu
perf
9830f8d
@liuxingbaoyu liuxingbaoyu added PR: Performance 🏃‍♀️ A type of pull request used for our changelog categories pkg: traverse (scope) labels Jul 7, 2024
@liuxingbaoyu liuxingbaoyu changed the title Avoid checking Scope.globals multiple times. Avoid checking Scope.globals multiple times Jul 7, 2024
@babel-bot

babel-bot commented Jul 7, 2024

Copy link
Copy Markdown
Collaborator

Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/57280

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

JLHwung
JLHwung reviewed Jul 8, 2024
View reviewed changes
Comment thread packages/babel-traverse/src/scope/index.ts
} else if (typeof opts === "boolean") {
noGlobals = opts;
}
if (this.parentHasBinding(name, opts)) return true;

@JLHwung JLHwung Jul 8, 2024

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Do we have other parentHasBinding usage? If not maybe we can deprecate and remove this method in Babel 8, as it is trivial to implement.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

liuxingbaoyu and nicolo-ribaudo reacted with thumbs up emoji
All reactions
  • 👍 2 reactions

@liuxingbaoyu liuxingbaoyu Jul 8, 2024

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

It has only this one use.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
JLHwung
JLHwung approved these changes Jul 8, 2024
View reviewed changes
nicolo-ribaudo
nicolo-ribaudo approved these changes Jul 8, 2024
View reviewed changes

@nicolo-ribaudo nicolo-ribaudo left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

I would not label this as "performance", since the performance different is insignificant

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

liuxingbaoyu reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
@liuxingbaoyu liuxingbaoyu added PR: Polish 💅 A type of pull request used for our changelog categories and removed PR: Performance 🏃‍♀️ A type of pull request used for our changelog categories labels Jul 8, 2024
@nicolo-ribaudo
nicolo-ribaudo merged commit e0368a8 into babel:main Jul 9, 2024
@davidjbradshaw davidjbradshaw mentioned this pull request Jul 19, 2024
[Snyk] Upgrade @babel/runtime from 7.24.7 to 7.24.8 davidjbradshaw/iframe-resizer#1298
Merged
@richyhoopd richyhoopd mentioned this pull request Aug 1, 2024
[Snyk] Upgrade: , , richyhoopd/Video-App#1187
Open
@Exkaleburx Exkaleburx mentioned this pull request Aug 1, 2024
[Snyk] Upgrade @babel/core from 7.9.0 to 7.24.8 Exkaleburx/plug-and-klay#10
Open
@X-oss-byte X-oss-byte mentioned this pull request Aug 1, 2024
[Snyk] Upgrade @babel/core from 7.11.6 to 7.24.8 X-oss-byte/gatsby-1#800
Open
This was referenced Aug 1, 2024
[Snyk] Upgrade @babel/runtime from 7.19.0 to 7.24.8 DevangPatelUK/BotFramework-WebChat#54
Open
[Snyk] Upgrade @babel/runtime from 7.19.0 to 7.24.8 DevangPatelUK/BotFramework-WebChat#57
Open
[Snyk] Upgrade @babel/runtime from 7.17.2 to 7.24.8 DevangPatelUK/BotFramework-WebChat#61
Open
This was referenced Aug 1, 2024
[Snyk] Upgrade @babel/core from 7.24.7 to 7.24.8 hashim21223445/async#2
Open
[Snyk] Upgrade @babel/eslint-parser from 7.24.7 to 7.24.8 hashim21223445/async#3
Merged
@ashly1111111 ashly1111111 mentioned this pull request Aug 1, 2024
[Snyk] Upgrade: , , , , ashly1111111/node#116
Open
@jamesleesaunders jamesleesaunders mentioned this pull request Aug 1, 2024
[Snyk] Upgrade: , jamesleesaunders/d3-ez#200
Closed
This was referenced Aug 1, 2024
[Snyk] Upgrade: , tiff-es/fewpjs-class-extensions-super-lab-online-web-sp-000#197
Open
[Snyk] Upgrade: , tiff-es/fewpjs-getter-and-setter-methods-dc-web-091619#211
Open
[Snyk] Upgrade: , tiff-es/fewpjs-acting-on-events-dc-web-091619#195
Open
[Snyk] Upgrade: , tiff-es/js-looping-and-iteration-looping-code-along-dc-web-091619#204
Open
[Snyk] Upgrade: , tiff-es/fewpjs-document-onload-dc-web-091619#200
Open
@anbo-de anbo-de mentioned this pull request Aug 2, 2024
[Snyk] Upgrade @babel/core from 7.24.7 to 7.24.8 WDAqua/Qanary#290
Merged
This was referenced Aug 2, 2024
[Snyk] Upgrade @babel/preset-env from 7.10.4 to 7.24.8 tiff-es/tiffany-portfolio-responsive#465
Open
[Snyk] Upgrade: , tiff-es/fewpjs-fns-as-first-class-data-do-behavior-dc-web-091619#192
Open
@rawdaymohamed rawdaymohamed mentioned this pull request Sep 15, 2024
[Snyk] Upgrade: , , , , body-parser, dotenv, express, mongoose, nodemon rawdaymohamed/Hot-Todo#373
Open
@AKJUS AKJUS mentioned this pull request Sep 16, 2024
[Snyk] Upgrade: , , , , , , , , classnames, docusaurus-lunr-search, react-markdown AKJUS/OpenLineage#26
Open
@bee22193 bee22193 mentioned this pull request Sep 17, 2024
[Snyk] Upgrade: , , browserify, cssnano, gulp-zip bee22193/mnmlurl#1254
Open
@AnushaSalian AnushaSalian mentioned this pull request Sep 17, 2024
[Snyk] Upgrade: , , , ajv, glob, eslint, minimist, handlebars, jsdom, katex, moment, prettier, winston, yargs, workbox-cli virtual-labs/ph3-lab-mgmt#530
Open
@vinit-aikido vinit-aikido mentioned this pull request Sep 17, 2024
[Snyk] Upgrade: , , , , , , , magic-string, , convert-source-map, source-map, graceful-fs, tslib, chokidar, , terser, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , brotli, core-js-bundle, diff, http-server, jasmine-core, jasmine, jquery, tmp, karma, karma-chrome-launcher, karma-firefox-launcher, karma-jasmine, karma-sourcemap-loader, selenium-webdriver, puppeteer, reflect-metadata, requirejs, rollup, shelljs, systemjs, tsickle, typescript, yargs vinit-aikido/terragoat#58
Open
@Sonic269 Sonic269 mentioned this pull request Sep 17, 2024
[Snyk] Upgrade: , , , , , , , magic-string, , convert-source-map, source-map, graceful-fs, tslib, chokidar, , terser, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , brotli, core-js-bundle, diff, http-server, jasmine-core, jasmine, jquery, tmp, karma, karma-chrome-launcher, karma-firefox-launcher, karma-jasmine, karma-sourcemap-loader, selenium-webdriver, puppeteer, reflect-metadata, requirejs, rollup, shelljs, systemjs, tsickle, typescript, yargs Sonic269/App6#120
Open
@venkatarao-palaparthi venkatarao-palaparthi mentioned this pull request Sep 17, 2024
[Snyk] Upgrade: lodash, , , , , , , , , , react, react-dom, semver, , , node-fetch, , , , babel-loader, cheerio, cookie-parser, mkdirp, copy-webpack-plugin, cross-env, directory-tree, dotenv, express, express-rate-limit, express-timeout-handler, flat, github-slugger, js-yaml, gray-matter, helmet, hot-shots, html-entities, linkinator, liquidjs, lunr-languages, mini-css-extract-plugin, morgan, redis, resolve-url-loader, rimraf, rss-parser, sass, sass-loader, style-loader, uuid, webpack venkatarao-palaparthi/docs#455
Open
@AKJUS AKJUS mentioned this pull request Sep 17, 2024
[Snyk] Upgrade: , , , , , , , , classnames, docusaurus-lunr-search, react-markdown AKJUS/OpenLineage#28
Open
@rawdaymohamed rawdaymohamed mentioned this pull request Sep 17, 2024
[Snyk] Upgrade: , , , , body-parser, dotenv, express, mongoose, nodemon rawdaymohamed/Hot-Todo#374
Open
@karencapiiro karencapiiro mentioned this pull request Sep 17, 2024
[Snyk] Upgrade: , , , , , , , magic-string, , convert-source-map, source-map, graceful-fs, tslib, chokidar, , terser, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , brotli, core-js-bundle, diff, http-server, jasmine-core, jasmine, jquery, tmp, karma, karma-chrome-launcher, karma-firefox-launcher, karma-jasmine, karma-sourcemap-loader, selenium-webdriver, puppeteer, reflect-metadata, requirejs, rollup, shelljs, systemjs, tsickle, typescript, yargs Rashdamada/terragoat#5
Open
@bee22193 bee22193 mentioned this pull request Sep 18, 2024
[Snyk] Upgrade: , , browserify, cssnano, gulp-zip bee22193/mnmlurl#1255
Open
@vinit-aikido vinit-aikido mentioned this pull request Sep 18, 2024
[Snyk] Upgrade: , , , , , , , magic-string, , convert-source-map, source-map, graceful-fs, tslib, chokidar, , terser, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , brotli, core-js-bundle, diff, http-server, jasmine-core, jasmine, jquery, tmp, karma, karma-chrome-launcher, karma-firefox-launcher, karma-jasmine, karma-sourcemap-loader, selenium-webdriver, puppeteer, reflect-metadata, requirejs, rollup, shelljs, systemjs, tsickle, typescript, yargs vinit-aikido/terragoat#59
Open
@syofyanzuhad syofyanzuhad mentioned this pull request Sep 18, 2024
[Snyk] Upgrade: , , , , , classnames, formik, markdown-to-jsx, typescript syofyanzuhad/profile#134
Open
@AnushaSalian AnushaSalian mentioned this pull request Sep 18, 2024
[Snyk] Upgrade: , , , ajv, glob, eslint, minimist, handlebars, jsdom, katex, moment, prettier, winston, yargs, workbox-cli virtual-labs/ph3-lab-mgmt#531
Open
@Sonic269 Sonic269 mentioned this pull request Sep 18, 2024
[Snyk] Upgrade: , , , , , , , magic-string, , convert-source-map, source-map, graceful-fs, tslib, chokidar, , terser, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , brotli, core-js-bundle, diff, http-server, jasmine-core, jasmine, jquery, tmp, karma, karma-chrome-launcher, karma-firefox-launcher, karma-jasmine, karma-sourcemap-loader, selenium-webdriver, puppeteer, reflect-metadata, requirejs, rollup, shelljs, systemjs, tsickle, typescript, yargs Sonic269/App6#121
Open
@MrRio MrRio mentioned this pull request Sep 18, 2024
[Snyk] Upgrade: , core-js, canvg, fflate, html2canvas parallax/jsPDF#3770
Closed
@AnushaSalian AnushaSalian mentioned this pull request Sep 19, 2024
[Snyk] Upgrade: , , , ajv, glob, eslint, minimist, handlebars, jsdom, katex, moment, prettier, winston, yargs, workbox-cli virtual-labs/ph3-lab-mgmt#532
Open
@venkatarao-palaparthi venkatarao-palaparthi mentioned this pull request Sep 19, 2024
[Snyk] Upgrade: lodash, , , , , , , , , , react, react-dom, semver, , , node-fetch, , , , babel-loader, cheerio, cookie-parser, mkdirp, copy-webpack-plugin, cross-env, directory-tree, dotenv, express, express-rate-limit, express-timeout-handler, flat, github-slugger, js-yaml, gray-matter, helmet, hot-shots, html-entities, linkinator, liquidjs, lunr-languages, mini-css-extract-plugin, morgan, redis, resolve-url-loader, rimraf, rss-parser, sass, sass-loader, style-loader, uuid, webpack venkatarao-palaparthi/docs#456
Open
@rawdaymohamed rawdaymohamed mentioned this pull request Sep 19, 2024
[Snyk] Upgrade: , , , , body-parser, dotenv, express, mongoose, nodemon rawdaymohamed/Hot-Todo#375
Open
@venkatarao-palaparthi venkatarao-palaparthi mentioned this pull request Sep 20, 2024
[Snyk] Upgrade: lodash, , , , , , , , , , react, react-dom, semver, , , node-fetch, , , , babel-loader, cheerio, cookie-parser, mkdirp, copy-webpack-plugin, cross-env, directory-tree, dotenv, express, express-rate-limit, express-timeout-handler, flat, github-slugger, js-yaml, gray-matter, helmet, hot-shots, html-entities, linkinator, liquidjs, lunr-languages, mini-css-extract-plugin, morgan, redis, resolve-url-loader, rimraf, rss-parser, sass, sass-loader, style-loader, uuid, webpack venkatarao-palaparthi/docs#457
Open
@rawdaymohamed rawdaymohamed mentioned this pull request Sep 20, 2024
[Snyk] Upgrade: , , , , body-parser, dotenv, express, mongoose, nodemon rawdaymohamed/Hot-Todo#376
Open
@venkatarao-palaparthi venkatarao-palaparthi mentioned this pull request Sep 21, 2024
[Snyk] Upgrade: lodash, , , , , , , , , , react, react-dom, semver, , , node-fetch, , , , babel-loader, cheerio, cookie-parser, mkdirp, copy-webpack-plugin, cross-env, directory-tree, dotenv, express, express-rate-limit, express-timeout-handler, flat, github-slugger, js-yaml, gray-matter, helmet, hot-shots, html-entities, linkinator, liquidjs, lunr-languages, mini-css-extract-plugin, morgan, redis, resolve-url-loader, rimraf, rss-parser, sass, sass-loader, style-loader, uuid, webpack venkatarao-palaparthi/docs#458
Open
@rawdaymohamed rawdaymohamed mentioned this pull request Sep 21, 2024
[Snyk] Upgrade: , , , , body-parser, dotenv, express, mongoose, nodemon rawdaymohamed/Hot-Todo#377
Open
This was referenced Sep 22, 2024
[Snyk] Upgrade: lodash, , , , , , , , , , react, react-dom, semver, , , node-fetch, , , , babel-loader, cheerio, cookie-parser, mkdirp, copy-webpack-plugin, cross-env, directory-tree, dotenv, express, express-rate-limit, express-timeout-handler, flat, github-slugger, js-yaml, gray-matter, helmet, hot-shots, html-entities, linkinator, liquidjs, lunr-languages, mini-css-extract-plugin, morgan, redis, resolve-url-loader, rimraf, rss-parser, sass, sass-loader, style-loader, uuid, webpack venkatarao-palaparthi/docs#459
Open
[Snyk] Upgrade: lodash, , , , , , , , , , react, react-dom, semver, , , node-fetch, , , , babel-loader, cheerio, cookie-parser, mkdirp, copy-webpack-plugin, cross-env, directory-tree, dotenv, express, express-rate-limit, express-timeout-handler, flat, github-slugger, js-yaml, gray-matter, helmet, hot-shots, html-entities, linkinator, liquidjs, lunr-languages, mini-css-extract-plugin, morgan, redis, resolve-url-loader, rimraf, rss-parser, sass, sass-loader, style-loader, uuid, webpack venkatarao-palaparthi/docs#460
Open
@rawdaymohamed rawdaymohamed mentioned this pull request Sep 23, 2024
[Snyk] Upgrade @babel/node from 7.18.10 to 7.25.0 rawdaymohamed/Hot-Todo#382
Open
@anandgupta193 anandgupta193 mentioned this pull request Sep 24, 2024
[Snyk] Upgrade @babel/node from 7.10.4 to 7.25.0 anandgupta193/sortNsuffle-react#1128
Open
@anandgupta193 anandgupta193 mentioned this pull request Oct 3, 2024
[Snyk] Upgrade @babel/node from 7.10.4 to 7.25.0 anandgupta193/sortNsuffle-react#1136
Open
@github-actions github-actions Bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label Oct 9, 2024
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Oct 9, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Reviewers

@JLHwung JLHwung JLHwung approved these changes
@nicolo-ribaudo nicolo-ribaudo nicolo-ribaudo approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

outdated A closed issue/PR that is archived due to age. Recommended to make a new issue pkg: traverse (scope) PR: Polish 💅 A type of pull request used for our changelog categories

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@liuxingbaoyu @babel-bot @JLHwung @nicolo-ribaudo
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.