Skip to content

JS compatibility build checks - #978

Open
tanzoniteblack wants to merge 2 commits into
rollerderby:devfrom
tanzoniteblack:js-compatibility
Open

tanzoniteblack wants to merge 2 commits into
rollerderby:devfrom
tanzoniteblack:js-compatibility

Conversation

@tanzoniteblack

Copy link
Copy Markdown

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 .browserlintrc that dictates what we're trying to continue supporting.

It's not going to catch everything, but it at least catches the most obvious.

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.
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