Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file added .eslintrc.js
Empty file.
4 changes: 2 additions & 2 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ on: ["pull_request"]
jobs:
benchmark:
name: Run JavaScript benchmark
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
node: [18, 20, 22]
node: [20, 22, 24]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ name: General Validity
on: ["push"]

jobs:
lint:
runs-on: ubuntu-20.04
static-code-validation:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
Expand All @@ -17,15 +17,15 @@ jobs:
run: yarn --immutable
shell: bash

- name: Lint
run: yarn lint
- name: Static code validation
run: yarn static-code-validation
shell: bash

test:
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04
strategy:
matrix:
node: [18, 20, 22]
node: [20, 22, 24]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
Expand All @@ -50,7 +50,7 @@ jobs:
github-token: ${{ secrets.github_token }}

build:
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04
needs: [lint, test]
steps:
- uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
lts/iron
lts/jod
13 changes: 13 additions & 0 deletions .oxlintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"$schema": "./node_modules/oxlint/configuration_schema.json",
"plugins": ["oxc", "typescript", "jest"],
"env": {
"es6": true
},
"globals": {
"SharedArrayBuffer": "readonly",
"BigInt": "readonly",
"BigInt64Array": "readonly",
"BigUint64Array": "readonly"
}
}
2 changes: 1 addition & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
trailingComma: "es5"
"trailingComma": "es5"
}
4 changes: 2 additions & 2 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"recommendations": [
"orta.vscode-jest",
"editorconfig.editorconfig",
"dbaeumer.vscode-eslint",
"davidanson.vscode-markdownlint"
"davidanson.vscode-markdownlint",
"oxc.oxc-vscode"
]
}
53 changes: 25 additions & 28 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@
],
"scripts": {
"prepare": "husky",
"lint": "concurrently \"eslint src --ext .js,.jsx,.ts,.tsx\" \"tsc --noEmit --emitDeclarationOnly false\"",
"lint": "yarn oxlint --deny-warnings src",
"type-check": "tsc --noEmit --emitDeclarationOnly false",
"static-code-validation": "concurrently \"yarn lint\" \"yarn type-check\"",
"test": "jest",
"test-coverage": "jest --coverage",
"build-declarations": "tsc -p tsconfig.build.json --isolatedModules false --declaration true --declarationMap true --noEmit false --emitDeclarationOnly true",
Expand All @@ -44,49 +46,44 @@
"as:test": "node tests",
"deoptigate-benchmarks": "npx deoptigate benchmarks/main-register-ts-node.js",
"v8-deopt-viewer-benchmarks": "npx v8-deopt-viewer benchmarks/main-register-ts-node.js --open",
"benchmark": "node benchmarks/main-register-ts-node.js"
"benchmark": "node benchmarks/main-register-ts-node.js",
"prettier-check": "prettier --check src"
},
"devDependencies": {
"@babel/cli": "^7.24.5",
"@babel/core": "^7.24.5",
"@babel/node": "^7.23.9",
"@babel/preset-env": "^7.24.5",
"@babel/preset-typescript": "^7.24.1",
"@changesets/cli": "^2.27.1",
"@babel/cli": "^7.27.2",
"@babel/core": "^7.27.1",
"@babel/node": "^7.27.1",
"@babel/preset-env": "^7.27.2",
"@babel/preset-typescript": "^7.27.1",
"@changesets/cli": "^2.29.3",
"@rollup/plugin-babel": "^6.0.4",
"@rollup/plugin-node-resolve": "^15.2.3",
"@rollup/plugin-node-resolve": "^16.0.1",
"@types/benchmark": "^2.1.5",
"@types/jest": "^29.5.12",
"@types/node": "^20.12.11",
"@typescript-eslint/eslint-plugin": "^7.9.0",
"@typescript-eslint/parser": "^7.9.0",
"@types/jest": "^29.5.14",
"@types/node": "^22.15.17",
"assemblyscript": "^0.27.27",
"babel-loader": "^9.1.3",
"benchmark": "^2.1.4",
"concurrently": "^8.2.2",
"concurrently": "^9.1.2",
"core-js": "^3.37.0",
"dts-bundle-generator": "^9.5.1",
"eslint": "^8.57.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.1.3",
"expose-gc": "^1.0.0",
"gh-pages": "^6.1.1",
"html-webpack-plugin": "^5.6.0",
"husky": "^9.0.11",
"husky": "^9.1.7",
"jest": "^29.7.0",
"kind-of": "^6.0.3",
"prettier": "^3.2.5",
"prettier-eslint": "^16.3.0",
"rimraf": "^5.0.7",
"rollup": "^4.17.2",
"oxlint": "^0.16.9",
"prettier": "^3.5.3",
"rimraf": "^6.0.1",
"rollup": "^4.40.2",
"rollup-plugin-terser": "^7.0.2",
"ts-node": "^10.9.2",
"typedoc": "^0.25.13",
"typedoc-plugin-markdown": "^4.0.1",
"typescript": "^5.4.5",
"webpack": "^5.91.0",
"webpack-cli": "^5.1.4",
"webpack-dev-server": "^5.0.4",
"webpack": "^5.99.8",
"webpack-cli": "^6.0.1",
"webpack-dev-server": "^5.2.1",
"worker-loader": "^3.0.8"
},
"files": [
Expand All @@ -95,5 +92,5 @@
"COMMIT",
"LICENSE"
],
"packageManager": "yarn@4.1.1"
}
"packageManager": "yarn@4.9.1"
}
20 changes: 4 additions & 16 deletions src/internal/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,21 +47,15 @@ export function createObjectBuffer<T = any>(
}

const allocator = new TransactionalAllocator(
{
start: MEM_POOL_START,
size,
},
{ start: MEM_POOL_START, size },
arrayBufferKind === "shared"
);

const arrayBuffer = allocator.getArrayBuffer();

initializeArrayBuffer(arrayBuffer);

const carrier: GlobalCarrier = {
allocator,
heap: allocator.getHeap(),
};
const carrier: GlobalCarrier = { allocator, heap: allocator.getHeap() };

const referencedPointers: number[] = [];

Expand Down Expand Up @@ -149,10 +143,7 @@ export function loadObjectBuffer<T = any>(
): T {
const allocator = TransactionalAllocator.load(arrayBuffer);

const carrier: GlobalCarrier = {
allocator,
heap: allocator.getHeap(),
};
const carrier: GlobalCarrier = { allocator, heap: allocator.getHeap() };

const dv = new DataView(arrayBuffer);
// endianness flag is always saved in little endian so we can read in every system endianness
Expand Down Expand Up @@ -191,10 +182,7 @@ export function unstable_replaceUnderlyingArrayBuffer(
newArrayBuffer: ArrayBuffer | SharedArrayBuffer
) {
const allocator = TransactionalAllocator.load(newArrayBuffer);
const carrier: GlobalCarrier = {
allocator,
heap: allocator.getHeap(),
};
const carrier: GlobalCarrier = { allocator, heap: allocator.getHeap() };

const dv = new DataView(newArrayBuffer);
// endianness flag is always saved in little endian so we can read in every system endianness
Expand Down
Loading
Loading