Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to eslint and update WPILibUtility to Electron 28 #680

Merged
merged 8 commits into from
Aug 14, 2024

Conversation

sciencewhiz
Copy link
Contributor

Supersedes #644 to fix merge conflicts
Fixes #666

Original PR description:
This PR updates wpilib-utility-standalone's Electron dependency to version 28 from version 11. I had to update @types/node and typescript to fix compilation errors. Electron's remote module was moved to the @electron/remote package in Electron 14, so I had to make some minor changes to use that. I also had to set contextIsolation to false because the default for contextIsolation changed from false to true in Electron 12. (Disabling contextIsolation and enabling nodeIntegration creates possible security risks, so I suggest removing usage of require in rendered pages. It is recommended to expose functions in preload.js instead of using require: https://www.electronjs.org/docs/latest/tutorial/context-isolation. @electron/remote also has some pitfalls: https://nornagon.medium.com/electrons-remote-module-considered-harmful-70d69500f31)

Updating Electron to version 28 fixes an issue on Linux where wpilib-utility-standalone would crash upon starting. This issue was caused by a glibc change (the issue was fixed in electron/electron#31091). This fix was not backported to Electron version 11. Updating Electron also fixes multiple security vulnerabilities, which you can get info on by running npm audit in wpilib-utility-standalone.

It is worth nothing that Windows 7, 8, and 8.1 support was removed in Electron 23, but seeing as though WPILib does not support these either I thought it was fine to update past 23.

All the projects have been migrated to eslint now. I didn't upgrade any dependencies due to the likelihood of breaking changes and having to refactor things.

Lints should succeed and typescript compilation works; however, I haven't done any testing. I doubt this would cause any bugs though.

@PeterJohnson PeterJohnson merged commit 1bc4d01 into wpilibsuite:main Aug 14, 2024
6 checks passed
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.

Standalone utility crashes on startup on macOS
3 participants