Skip to content

refactor(js): Minor cleanups to the global scope#19573

Closed
SyntaxColoring wants to merge 2 commits intoedgefrom
app_shell_remote_typing
Closed

refactor(js): Minor cleanups to the global scope#19573
SyntaxColoring wants to merge 2 commits intoedgefrom
app_shell_remote_typing

Conversation

@SyntaxColoring
Copy link
Copy Markdown
Contributor

Overview

Minor improvements to our Vite config and TypeScript declarations.

Changelog

  • All of our projects were configuring Vite to replace global with globalThis. (As I understand it, global is a historical Node-ism, and globalThis is the modern standard cross-environment replacement.) With this PR, our source code just spells out globalThis directly, and we can delete that bit of Vite config. There's a lint rule to prevent us from using global in the future.
  • Separately, fix some .d.ts problems and associated // @ts-expect-errors. The trick seems to be that if the .d.ts file is a module, you gotta wrap it with declare global {}, and if it's not a module, you gotta not. 🤷

Test Plan and Hands on Testing

Just CI.

Review requests

None in particular.

Risk assessment

Low.

@SyntaxColoring SyntaxColoring requested review from a team as code owners September 16, 2025 00:22
@SyntaxColoring SyntaxColoring requested review from smb2268 and removed request for a team September 16, 2025 00:22
@codecov
Copy link
Copy Markdown

codecov bot commented Sep 16, 2025

Codecov Report

❌ Patch coverage is 23.68421% with 29 lines in your changes missing coverage. Please review.
✅ Project coverage is 23.97%. Comparing base (c2d02a7) to head (1a8dc4f).
⚠️ Report is 17 commits behind head on edge.

Files with missing lines Patch % Lines
.eslintrc.js 0.00% 8 Missing ⚠️
app/src/App/portal.tsx 0.00% 6 Missing ⚠️
...nts/organisms/AssignLiquidsModal/LiquidToolbox.tsx 0.00% 4 Missing ⚠️
app/src/redux/shell/remote.ts 0.00% 3 Missing ⚠️
labware-library/src/analytics/utils.ts 0.00% 2 Missing ⚠️
app-shell-odd/src/preload.ts 0.00% 1 Missing ⚠️
app-shell/src/preload.ts 0.00% 1 Missing ⚠️
app/src/redux/analytics/hash.ts 0.00% 1 Missing ⚠️
protocol-designer/src/configureStore.ts 0.00% 1 Missing ⚠️
...col-designer/src/labware-ingred/actions/actions.ts 0.00% 1 Missing ⚠️
... and 1 more
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             edge   #19573      +/-   ##
==========================================
+ Coverage   23.73%   23.97%   +0.24%     
==========================================
  Files        3419     3431      +12     
  Lines      302359   303362    +1003     
  Branches    39474    39592     +118     
==========================================
+ Hits        71766    72735     +969     
- Misses     230576   230611      +35     
+ Partials       17       16       -1     
Flag Coverage Δ
app 2.11% <2.70%> (+0.03%) ⬆️
protocol-designer 18.95% <21.05%> (+0.23%) ⬆️
step-generation 5.44% <2.63%> (-0.04%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
app-shell-odd/typings/global.d.ts 100.00% <100.00%> (ø)
app-shell/src/config/migrate.ts 79.31% <100.00%> (+0.38%) ⬆️
app-shell/typings/global.d.ts 100.00% <ø> (ø)
...rotocol-designer/src/networking/opentronsWebApi.ts 100.00% <100.00%> (ø)
.../ProtocolSteps/Timeline/ConnectedStepContainer.tsx 78.14% <100.00%> (ø)
...esigner/ProtocolSteps/Timeline/TimelineToolbox.tsx 66.07% <100.00%> (ø)
protocol-designer/src/persist.ts 45.83% <100.00%> (ø)
app-shell-odd/src/preload.ts 0.00% <0.00%> (ø)
app-shell/src/preload.ts 0.00% <0.00%> (ø)
app/src/redux/analytics/hash.ts 7.69% <0.00%> (ø)
... and 8 more

... and 94 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@SyntaxColoring SyntaxColoring marked this pull request as draft September 16, 2025 14:00
@SyntaxColoring
Copy link
Copy Markdown
Contributor Author

Alright, I understand TypeScript worse than I thought and can't figure out those errors. Might come back to this later.

@SyntaxColoring SyntaxColoring deleted the app_shell_remote_typing branch November 19, 2025 18:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant