Skip to content

Conversation

@legobeat
Copy link

@legobeat legobeat commented Feb 1, 2024

json-stable-stringify is already failing CI tests on Node.js version <=0.6 (https://github.com/ljharb/json-stable-stringify/actions/runs/7545755257/job/20542261535).

Node.js 0.10 went EOL in 2016.

The shims contain code permuting globals, which causes noise in static analysis and may be an cause issues if inadvertently triggered.

  • BREAKING: Increase minimum Node.js version from 0.4 to 0.10
    • Remove Node.js v0.6 and v0.8 from test matrix (v0.4 was already not tested despite support being indicated)
  • Replace isarray with native Array.isArray
  • Replace object-keys with native Object.keys

@legobeat legobeat marked this pull request as ready for review February 1, 2024 10:08
@legobeat legobeat force-pushed the native-object-keys-isarray branch from c15d6b0 to 2de457a Compare February 1, 2024 10:10
@legobeat legobeat force-pushed the native-object-keys-isarray branch from 2de457a to 8b53f17 Compare February 1, 2024 10:23
Copy link
Owner

@ljharb ljharb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The 0.6 failure is because node itself can't compile, not because the project doesn't pass on it.

EOL status is irrelevant.

The code paths we use here don't mutate globals, so it shouldn't break any static analysis worth relying on.

Additionally, Object.keys has a ton of bugs in a ton of engines, including browsers, so using the package is the safest approach by a long shot.

@ljharb ljharb marked this pull request as draft February 1, 2024 17:38
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.

2 participants