Skip to content

fix: add Node 18 deprecation notice #1506

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

Conversation

grdsdev
Copy link
Contributor

@grdsdev grdsdev commented Jul 16, 2025

What kind of change does this PR introduce?

As announced in https://github.com/orgs/supabase/discussions/37217, Node 18 support has been deprecated.

This PR:

  • adds a console warning when this lib is used on Node 18 environment.

@coveralls
Copy link

coveralls commented Jul 16, 2025

Pull Request Test Coverage Report for Build 16472859267

Details

  • 6 of 9 (66.67%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.7%) to 72.199%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/index.ts 6 9 66.67%
Totals Coverage Status
Change from base Build 16347588541: -0.7%
Covered Lines: 115
Relevant Lines: 141

💛 - Coveralls

@grdsdev grdsdev marked this pull request as ready for review July 17, 2025 13:22
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR implements a deprecation notice for Node.js 18 as announced in the Supabase community discussions. The changes add runtime detection and warning for Node.js 18 usage while also improving the CI coverage reporting workflow.

  • Adds runtime deprecation warning for Node.js 18 environments
  • Updates CI workflow to support parallel coverage reporting with proper completion handling

Reviewed Changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated 2 comments.

File Description
src/index.ts Adds Node.js 18 deprecation detection and console warning
.github/workflows/ci.yml Updates coverage reporting to use parallel processing with finish step
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

@grdsdev grdsdev force-pushed the guilherme/clibs-244-add-warning-in-js-lib-when-node-version-equals-18 branch from 034be14 to ec3c428 Compare July 21, 2025 12:20
@soedirgo
Copy link
Member

I just realized engines is advisory only and won't get enforced unless engine-strict is set. Should we do that instead?

@grdsdev
Copy link
Contributor Author

grdsdev commented Jul 23, 2025

Great @soedirgo , didn't know that.

I will add the engine field

package.json Outdated
@@ -86,5 +86,8 @@
},
"jsdelivr": "dist/umd/supabase.js",
"unpkg": "dist/umd/supabase.js",
"engines": {
"node": ">=20"
Copy link
Member

Choose a reason for hiding this comment

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

Just sharing my experience here: Many many people see this as a breaking change as some package managers will outright fail if they encounter conflicts with the used node version which can cause breakage in CI.

Choose a reason for hiding this comment

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

Should we at least add a note that it's a potential breaking change in some configurations then in this case?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If that can be treated as breaking change by some package managers, then I'd rather remove it and keep only the console.warning.

Choose a reason for hiding this comment

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

What is said here

won't get enforced unless engine-strict is set

this narrows down the cases this can be a breaking change, but there still are such cases.

I think what you suggest is safer, have the warning, and roll out the engines.node setting after some time?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I rollback a few changes, please review it again @mandarini

Copy link
Member

Choose a reason for hiding this comment

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

@lforst good call; had a feeling that could be the case. Let's go ahead with the console.warning.

Copy link

@mandarini mandarini left a comment

Choose a reason for hiding this comment

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

I think we should:

  • Move the CI changes in another PR
  • Revert the pnpm i commit, and have a separate PR with pnpm i, but first understand why the versions mismatch (upgrades vs downgrades)

Let me know if I can help somehow!

package.json Outdated
@@ -86,5 +86,8 @@
},
"jsdelivr": "dist/umd/supabase.js",
"unpkg": "dist/umd/supabase.js",
"engines": {
"node": ">=20"

Choose a reason for hiding this comment

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

Should we at least add a note that it's a potential breaking change in some configurations then in this case?

grdsdev and others added 8 commits July 23, 2025 09:49
- Add browser environment check to only show Node.js deprecation warning in Node.js
- Fix typo in types import path

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Fix typo in types import path
- Improve formatting of Node.js 18 deprecation warning condition

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Add deprecation warning for Node.js versions 18 and below
- Extract shouldShowDeprecationWarning function with robust version parsing
- Parse major version number from process.version using regex
- Handle edge cases: null version, malformed strings, browser environments
- Display informative warning message directing users to upgrade to Node.js 20+
- Include link to GitHub discussion for more information
@grdsdev grdsdev force-pushed the guilherme/clibs-244-add-warning-in-js-lib-when-node-version-equals-18 branch from 3fc7863 to ae0ffbb Compare July 23, 2025 12:49
@grdsdev grdsdev requested a review from mandarini July 23, 2025 14:02
@grdsdev grdsdev merged commit ede368c into master Jul 23, 2025
12 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.

5 participants