Skip to content
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

chore: run CI tests on Node 20 #9706

Merged
merged 10 commits into from
May 5, 2023
Merged

chore: run CI tests on Node 20 #9706

merged 10 commits into from
May 5, 2023

Conversation

benmccann
Copy link
Member

No description provided.

@changeset-bot
Copy link

changeset-bot bot commented Apr 19, 2023

⚠️ No Changeset found

Latest commit: b5c965a

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@benmccann
Copy link
Member Author

benmccann commented Apr 19, 2023

uh oh. I've run the tests three times now and they've failed in the same way each time:

packages/kit test: FAIL make_trackable "makes URL properties trackable"
packages/kit test: Expected value to be truthy (ok)
packages/kit test:
packages/kit test: at Object.handler (file:///home/runner/work/kit/kit/packages/kit/src/utils/url.spec.js:103:10)

The Svelte, Vite, and vite-plugin-svelte CIs pass on Node 20, so it must be something specific to this project

@gtm-nayan
Copy link
Contributor

gtm-nayan commented Apr 20, 2023

In make_trackable, we're using tracked[property] to access searchParams:

let value = tracked[property];

Its impl in Node 20 is

if (this.#searchParams == null) {
      this.#searchParams = new URLSearchParams(this.search);
      setURLSearchParamsContext(this.#searchParams, this);
    }
    return this.#searchParams;

so when it tries to access this.search, it triggers the tracking callback because the search property was patched in the previous iteration.

I think at some point we used proxies instead for this, I'll try to dig up the history, perhaps we can switch to that depending on the reason or if I'm just misremembering.

or alternatively hack around it by accessing searchParams before we patching search.

EDIT: There's probably a simpler solution, running tests for it now, will push if they pass.

@gtm-nayan
Copy link
Contributor

Test are passing now with 20.1.0.

@benmccann
Copy link
Member Author

amazing! thank you so much @gtm-nayan !

@benmccann benmccann merged commit a1fe0bf into master May 5, 2023
@benmccann benmccann deleted the node20 branch May 5, 2023 13:30
@benmccann
Copy link
Member Author

I forgot to add a changeset here after this added changes to sveltekit, so did that here: 6e2efcf

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