-
Notifications
You must be signed in to change notification settings - Fork 8
feat: support Node 26 #89
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| name: Test Native ABI | ||
| description: > | ||
| Set up the given Node.js major and run the core package's integ tests | ||
| in-band, without rebuilding, to catch native addon ABI mismatches and | ||
| V8-version-specific natives-syntax behavior. The flags mirror what the | ||
| runner passes in a real benchmark process; they cannot go through | ||
| NODE_OPTIONS (--allow-natives-syntax is rejected there), so jest runs | ||
| in-band under a flagged node instead of forking workers. | ||
|
|
||
| inputs: | ||
| node-version: | ||
| description: Node.js major version to test under | ||
| required: true | ||
|
|
||
| runs: | ||
| using: composite | ||
| steps: | ||
| - uses: actions/setup-node@v6 | ||
| with: | ||
| node-version: ${{ inputs.node-version }} | ||
| - shell: bash | ||
| working-directory: packages/core | ||
| run: > | ||
| node --interpreted-frames-native-stack --allow-natives-syntax | ||
| "$(node -p 'require.resolve("jest/bin/jest")')" | ||
| -c jest.config.integ.js --runInBand | ||
| tests/index.integ.test.ts tests/optimization.integ.test.ts |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| 24.19.0 | ||
| 26.8.1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| import { execFileSync } from "child_process"; | ||
| import path from "path"; | ||
|
|
||
| // A function optimized without being marked for manual optimization first aborts | ||
| // the process on V8 >= 14.6, which no in-process assertion can observe. The helpers | ||
| // are exercised through the built package so the bundled natives calls are covered. | ||
| const runWithNatives = (snippet: string): string => | ||
| execFileSync(process.execPath, ["--allow-natives-syntax", "-e", snippet], { | ||
| encoding: "utf8", | ||
| }); | ||
|
|
||
| const corePath = JSON.stringify(path.join(__dirname, "..")); | ||
|
|
||
| // %GetOptimizationStatus's bitmask layout shifts between V8 versions, so a | ||
| // specific bit isn't safe to assert on. Comparing the status before and after | ||
| // the optimize call instead proves TurboFan recompiled the function, without | ||
| // depending on what any bit means. | ||
| describe("optimization helpers", () => { | ||
| it("should optimize a sync function without aborting", () => { | ||
| const stdout = runWithNatives( | ||
| `const target = () => 1; | ||
| const before = %GetOptimizationStatus(target); | ||
| require(${corePath}).optimizeFunctionSync(target); | ||
| console.log("done", before, %GetOptimizationStatus(target));`, | ||
| ); | ||
| const [, before, after] = stdout.match(/done (\d+) (\d+)/) ?? []; | ||
| expect(stdout).toContain("done"); | ||
| expect(after).not.toEqual(before); | ||
| }); | ||
|
|
||
| it("should optimize an async function without aborting", () => { | ||
| const stdout = runWithNatives( | ||
| `const target = async () => 1; | ||
| const before = %GetOptimizationStatus(target); | ||
| require(${corePath}) | ||
| .optimizeFunction(target) | ||
| .then(() => console.log("done", before, %GetOptimizationStatus(target)));`, | ||
| ); | ||
| const [, before, after] = stdout.match(/done (\d+) (\d+)/) ?? []; | ||
| expect(stdout).toContain("done"); | ||
| expect(after).not.toEqual(before); | ||
| }); | ||
| }); | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.