Skip to content

Fix and correct details from the modernize review - #567

Merged
CodeByZach merged 3 commits into
candidate-2.0from
review-fixes
Nov 8, 2026
Merged

CodeByZach merged 3 commits into
candidate-2.0from
review-fixes

Conversation

@CodeByZach

Copy link
Copy Markdown
Owner

Fixes and corrections found in a review of the commits from "Modernize pace.js":

  • ajax.trackMethods that isn't an array behaves as before again: a string or number matches nothing. Since the modernize PR, a string matched substrings and a number made the page's own xhr.open() throw. Two tests cover it, and both fail on the previous code.
  • Corrections (the commit message lists them): the build.mjs comment now says what the es-check test catches, and the README names the supported Opera and Samsung Internet versions and says jsdom needs its pretendToBeVisual option (Jest and Vitest turn it on).

"Replace CoffeeScript helpers with built-in features" replaced the indexOf
polyfill with trackMethods.includes() and said nothing else changed. That
holds for arrays, but a misconfigured string now matched substrings ('GET'
matched GET), and a number made the page's own xhr.open() throw. Calling
Array.prototype.includes on the value restores the old result: a string or
number matches nothing.
Corrections to earlier commits:
- "Build for the 2.0 browser targets": the build.mjs comment said the
  esbuild target and .browserslistrc "can't drift apart unnoticed", but
  lowering the target goes unnoticed. The comment now says what the test
  checks. Its message gave Array.prototype.at as an example es-check
  catches; es-check detects it only in some code patterns (Object.hasOwn
  or findLast are reliable examples).
- "Remove code for browsers 2.0 doesn't support" said no behavior changes.
  In jsdom without its pretendToBeVisual option, which has no
  requestAnimationFrame, pace now throws once it starts. Jest and Vitest
  turn the option on; the README now says to.
- "Update the README's browser support and size": "browsers built on the
  same engines" was too loose (Samsung Internet 16 is Chromium-based but
  not supported). The README now names Opera 82+, Samsung Internet 17+ and
  Chromium 96 or later.
Brings in the event handler changes. pace.min.js is rebuilt from the
merged pace.js.
@CodeByZach
CodeByZach merged commit ff2bde3 into candidate-2.0 Nov 8, 2026
2 checks passed
@CodeByZach
CodeByZach deleted the review-fixes branch November 8, 2026 01: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