JS compatibility build checks - #978
Open
tanzoniteblack wants to merge 2 commits into
Open
tanzoniteblack wants to merge 2 commits into
tanzoniteblack wants to merge 2 commits into
Conversation
rollerderby#767 updated code to older js syntax to help support older devices, but it's easy for these to sneak back in without an explicit check for it. Also updates the circleci config to run this job. Current output from running this compat script: ``` scoreboard [js-compatibility●] % npm run compat > compat > eslint 'html/**/*.js' /Users/ryan/Code/opensource/scoreboard/html/components/plt-input/index.js 169:1 error let declarations aren’t supported on older devices no-restricted-syntax 170:1 error let declarations aren’t supported on older devices no-restricted-syntax /Users/ryan/Code/opensource/scoreboard/html/javascript/sortfunctions.js 43:8 error let declarations aren’t supported on older devices no-restricted-syntax /Users/ryan/Code/opensource/scoreboard/html/javascript/windowfunctions.js 27:12 error URL.searchParams() is not supported in iOS Safari 9.3 compat/compat /Users/ryan/Code/opensource/scoreboard/html/json/WS.js 504:7 error Object.entries() is not supported in iOS Safari 9.3 compat/compat 1058:5 error Object.entries() is not supported in iOS Safari 9.3 compat/compat /Users/ryan/Code/opensource/scoreboard/html/json/core.js 68:15 error URL.searchParams() is not supported in iOS Safari 9.3 compat/compat ✖ 7 problems (7 errors, 0 warnings) ```
Fix the issues that the new compat script identified that could be breaking the site for older devices.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
I saw the comments on this PR about some of the code changes being more modern JS then we want to support on this project. While annoying to try and be backwards compatible with 10+ year old devices, it makes sense to have that as an aim to help leagues use old tablets donated by players/officials which would otherwise just be ewaste.
I saw that this PR fixed a number of issues at the time, but I think a handful have crept back in already, just like the comments on 971 are trying to prevent. Instead of just relying on people noticing that in PR's, let's create a tiny eslint validation step with a
.browserlintrcthat dictates what we're trying to continue supporting.It's not going to catch everything, but it at least catches the most obvious.