openedx / frontend-platform

A framework for Open edX micro-frontend applications.
http://openedx.github.io/frontend-platform
GNU Affero General Public License v3.0
32 stars 64 forks source link

chore: replace 'global' with 'globalThis' #701

Closed bradenmacdonald closed 4 months ago

bradenmacdonald commented 5 months ago

The global keyword is a non-standard NodeJS specific keyword. But since 2019, we can use globalThis instead, which works in every runtime. For example, globalThis has the same consistent meaning in both browsers and NodeJS, whereas global does not work in browsers unless you use some build process to rewrite it to window.

Details: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/globalThis#description

Example from Chrome console: Screenshot of chrome browser console

openedx-webhooks commented 5 months ago

Thanks for the pull request, @bradenmacdonald! Please note that it may take us up to several weeks or months to complete a review and merge your PR.

Feel free to add as much of the following information to the ticket as you can:

All technical communication about the code itself will be done via the GitHub pull request interface. As a reminder, our process documentation is here.

Please let us know once your PR is ready for our review and all tests are green.

codecov[bot] commented 5 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 83.41%. Comparing base (9d2e727) to head (d331922).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #701 +/- ## ======================================= Coverage 83.41% 83.41% ======================================= Files 40 40 Lines 1073 1073 Branches 197 197 ======================================= Hits 895 895 Misses 166 166 Partials 12 12 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

openedx-webhooks commented 4 months ago

@bradenmacdonald 🎉 Your pull request was merged! Please take a moment to answer a two question survey so we can improve your experience in the future.