Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
4 changes: 0 additions & 4 deletions .babelrc

This file was deleted.

29 changes: 7 additions & 22 deletions config/eslint/repo/rules/unicornPlugin.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export default {
rules: {
// Improve regexes by making them shorter, consistent, and safer
'unicorn/better-regex': ['error', { sortCharacterClasses: true }],
'unicorn/better-regex': 'error',
// Enforce a specific parameter name in catch clauses
'unicorn/catch-error-name': ['error', { name: 'error', ignore: [] }],
// Use destructured variables over properties
Expand All @@ -20,7 +20,7 @@ export default {
'unicorn/expiring-todo-comments': [
'error',
{
ignoreDatesOnPullRequests: true,
checkDatesOnPullRequests: false,
terms: ['todo', 'fixme', 'xxx'],
allowWarningComments: true,
ignore: [],
Expand All @@ -29,7 +29,7 @@ export default {
// Enforce explicitly comparing the `length` or `size` property of a value
'unicorn/explicit-length-check': ['error', { 'non-zero': 'greater-than' }],
// Enforce a case style for filenames
'unicorn/filename-case': ['error', { cases: { kebabCase: true }, ignore: [] }],
'unicorn/filename-case': ['error', { cases: { kebabCase: true }, ignore: [/^__\w+__$/u] }],
// Enforce specific import styles per module
'unicorn/import-style': 'off',
// Enforce the use of new for all builtins, except `String`, `Number`, `Boolean`, `Symbol`
Expand All @@ -39,8 +39,8 @@ export default {
'unicorn/no-abusive-eslint-disable': 'error',
// Prevent passing a function reference directly to iterator methods
'unicorn/no-array-callback-reference': 'off',
// Prefer `for…of` over `Array#forEach(…)`
'unicorn/no-array-for-each': 'error',
// Prefer `for…of` over `Array#forEach(…)` (renamed from no-array-for-each in v65)
'unicorn/no-for-each': 'error',
// Disallow using the `this` argument in array methods
'unicorn/no-array-method-this-argument': 'error',
// Enforce combining multiple `Array#push()` into one call
Expand Down Expand Up @@ -161,7 +161,7 @@ export default {
// Prefer `.textContent` over `.innerText`
'unicorn/prefer-dom-node-text-content': 'error',
// Prefer `export…from` when re-exporting
'unicorn/prefer-export-from': ['error', { ignoreUsedVariables: false }],
'unicorn/prefer-export-from': ['error', { checkUsedVariables: true }],
// Prefer `.includes()` over `.indexOf()` and `Array#some()` when checking for existence
// or non-existence
'unicorn/prefer-includes': 'error',
Expand Down Expand Up @@ -214,22 +214,7 @@ export default {
// Enforce throwing `TypeError` in type checking conditions
'unicorn/prefer-type-error': 'error',
// Prevent abbreviations
'unicorn/prevent-abbreviations': [
'off',
{
replacements: {},
extendDefaultReplacements: false,
allowList: {},
extendDefaultAllowList: false,
checkDefaultAndNamespaceImports: 'internal',
checkShorthandImports: 'internal',
checkShorthandProperties: false,
checkProperties: false,
checkVariables: true,
checkFilenames: true,
ignore: [],
},
],
'unicorn/prevent-abbreviations': 'off',
// Enforce consistent relative URL style
'unicorn/relative-url-style': ['error', 'always'],
// Enforce using the separator argument with `Array#join()`
Expand Down
8 changes: 7 additions & 1 deletion config/jest/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,13 @@ const config = {
'runtime/fastedge/deps',
],
transform: {
'^.+\\.(ts|js)$': 'babel-jest',
'^.+\\.(ts|js)$': ['@swc/jest', {
jsc: {
parser: { syntax: 'typescript' },
target: 'es2022',
},
module: { type: 'commonjs' },
}],
Comment thread
godronus marked this conversation as resolved.
},
};
export default config;
35 changes: 35 additions & 0 deletions context/PATCHES.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,41 @@ fallback, and the accompanying WPT expectations.
| Upstream PR | (PR opened from fork — link when available) |
| Status | Open — awaiting upstream review |

### 3. `Ensure maybe_stream_body does not bypass JS Streams when cloned`

| Field | Value |
|-------|-------|
| Commit on `gcore/integration` | `c0d7f79` |
| Source branch | `godronus/feature/response-clone` |
| Upstream PR | https://github.com/bytecodealliance/StarlingMonkey/pull/312 (part of the Response.clone work) |
| Status | Open — awaiting upstream review |

Follow-up to patch #1. `RequestOrResponse::maybe_stream_body` forwards incoming
bodies host-to-host gated only on `is_incoming()`, ignoring whether a JS
`BodyStream` exists. `clone()` tees the body into `self`'s `BodyStream` but
leaves the incoming handle attached, so sending the original after a clone took
the fast path, bypassed the tee branch, and double-read the single host body.
Fix is one condition — also gate on `!body_stream(body_owner)` — so once a
stream is reified (`.body` access or a `clone()` tee) the JS-stream path is used.
Lives in shared `maybe_stream_body`, so it also closes the same latent hazard in
`Request::clone`.

### 4. `update WPT expectations for mime-type`

| Field | Value |
|-------|-------|
| Commit on `gcore/integration` | `4dc05f3` |
| Source branch | `godronus/feature/response-clone` |
| Status | Test baseline only |

Re-records `expectations/fetch/api/body/mime-type.any.js.json` to match the
`Blob.type`-from-`Content-Type` behaviour added in patch #2 (which updated the
code but not this baseline). 13 subtests flip to PASS. One subtest,
`Response: Extract a MIME type with clone`, stays FAIL on purpose: the upstream
WPT test passes its `headers` dict as a stray 3rd argument to `Blob(...)` instead
of the `Response` init, so the Response never receives the header — it fails in
conformant browsers too, not a runtime issue.

---

## Rebase procedure (when upstream releases a new version)
Expand Down
2 changes: 1 addition & 1 deletion examples/mcp-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"@gcoredev/fastedge-sdk-js": "^2.3.0",
"@hono/mcp": "^0.2.5",
"@modelcontextprotocol/sdk": "^1.29.0",
"hono": "^4.12.12",
"hono": "^4.12.25",
"zod": "^4.3.6"
},
"devDependencies": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
*/

const staticAssetManifest = {
'/assets/index-COcDBgFa.css': { assetKey: '/assets/index-COcDBgFa.css', contentType: 'text/css', isText: true, fileInfo: { size: 1381, hash: '053fffbd3cb2f092a85d67a83459e078b9fe405f2da931b9d21d03d6a853bf34', lastModifiedTime: 1779197809, assetPath: './dist/assets/index-COcDBgFa.css' }, lastModifiedTime: 1779197809, type: 'wasm-inline' },
'/assets/index-DjqI1cle.js': { assetKey: '/assets/index-DjqI1cle.js', contentType: 'application/javascript', isText: true, fileInfo: { size: 195714, hash: '7b7102e112107e13c808d2d82ce9df83bcb9199808112cd2bbf4b35048e17aaa', lastModifiedTime: 1779197809, assetPath: './dist/assets/index-DjqI1cle.js' }, lastModifiedTime: 1779197809, type: 'wasm-inline' },
'/assets/react-CHdo91hT.svg': { assetKey: '/assets/react-CHdo91hT.svg', contentType: 'image/svg+xml', isText: true, fileInfo: { size: 4126, hash: '35ef61ed53b323ae94a16a8ec659b3d0af3880698791133f23b084085ab1c2e5', lastModifiedTime: 1779197809, assetPath: './dist/assets/react-CHdo91hT.svg' }, lastModifiedTime: 1779197809, type: 'wasm-inline' },
'/index.html': { assetKey: '/index.html', contentType: 'text/html', isText: true, fileInfo: { size: 463, hash: '96073e01ae8aa8a822a0c5960219ede99df8839186cc3598da3dad7a46b134ee', lastModifiedTime: 1779197809, assetPath: './dist/index.html' }, lastModifiedTime: 1779197809, type: 'wasm-inline' },
'/vite.svg': { assetKey: '/vite.svg', contentType: 'image/svg+xml', isText: true, fileInfo: { size: 1497, hash: '4a748afd443918bb16591c834c401dae33e87861ab5dbad0811c3a3b4a9214fb', lastModifiedTime: 1779197809, assetPath: './dist/vite.svg' }, lastModifiedTime: 1779197809, type: 'wasm-inline' },
'/assets/index-9jaZKl3E.js': { assetKey: '/assets/index-9jaZKl3E.js', contentType: 'application/javascript', isText: true, fileInfo: { size: 193167, hash: '0d24f9f225bc2f2ad59f638fae48474b97b95dbdd9a66780902e8c5d629d6a69', lastModifiedTime: 1782807172, assetPath: './dist/assets/index-9jaZKl3E.js' }, lastModifiedTime: 1782807172, type: 'wasm-inline' },
'/assets/index-hoDP6v4Q.css': { assetKey: '/assets/index-hoDP6v4Q.css', contentType: 'text/css', isText: true, fileInfo: { size: 1553, hash: '6747fc46412fa77c263e7ad1aef9fc5e5d4a3992a4d61af856701f604da038f9', lastModifiedTime: 1782807172, assetPath: './dist/assets/index-hoDP6v4Q.css' }, lastModifiedTime: 1782807172, type: 'wasm-inline' },
'/assets/react-CHdo91hT.svg': { assetKey: '/assets/react-CHdo91hT.svg', contentType: 'image/svg+xml', isText: true, fileInfo: { size: 4126, hash: '35ef61ed53b323ae94a16a8ec659b3d0af3880698791133f23b084085ab1c2e5', lastModifiedTime: 1782807172, assetPath: './dist/assets/react-CHdo91hT.svg' }, lastModifiedTime: 1782807172, type: 'wasm-inline' },
'/index.html': { assetKey: '/index.html', contentType: 'text/html', isText: true, fileInfo: { size: 463, hash: '9d14148f80c294fd76d895bbf4dd239f581c4b76ba1a05783b18d2182cd7584e', lastModifiedTime: 1782807172, assetPath: './dist/index.html' }, lastModifiedTime: 1782807172, type: 'wasm-inline' },
'/vite.svg': { assetKey: '/vite.svg', contentType: 'image/svg+xml', isText: true, fileInfo: { size: 1497, hash: '4a748afd443918bb16591c834c401dae33e87861ab5dbad0811c3a3b4a9214fb', lastModifiedTime: 1782807172, assetPath: './dist/vite.svg' }, lastModifiedTime: 1782807172, type: 'wasm-inline' },
};

export { staticAssetManifest };
10 changes: 5 additions & 5 deletions examples/react-with-hono-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@
},
"dependencies": {
"@gcoredev/fastedge-sdk-js": "^2.3.0",
"hono": "^4.9.8",
"hono": "^4.12.25",
"react": "^19.1.1",
"react-dom": "^19.1.1"
},
"devDependencies": {
"@eslint/js": "^9.36.0",
"@hono/node-server": "^1.19.5",
"@hono/node-server": "^1.19.14",
"@types/node": "^24.6.0",
"@types/react": "^19.1.16",
"@types/react-dom": "^19.1.9",
Expand All @@ -31,11 +31,11 @@
"eslint-plugin-react-hooks": "^5.2.0",
"eslint-plugin-react-refresh": "^0.4.22",
"globals": "^16.4.0",
"npm-run-all2": "^8.0.4",
"npm-run-all2": "^9.0.2",
"ts-node": "^10.9.2",
"tsx": "^4.20.6",
"tsx": "^4.22.4",
"typescript": "~5.9.3",
"typescript-eslint": "^8.45.0",
"vite": "^7.1.7"
"vite": "^8.1.0"
}
}
4 changes: 2 additions & 2 deletions examples/static-assets/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
"license": "ISC",
"dependencies": {
"@gcoredev/fastedge-sdk-js": "^2.3.0",
"hono": "^4.11.9"
"hono": "^4.12.25"
},
"devDependencies": {
"npm-run-all2": "^8.0.4"
"npm-run-all2": "^9.0.2"
}
}
4 changes: 2 additions & 2 deletions examples/static-assets/src/images-static-assets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
*/

const staticAssetManifest = {
'/gcore.png': { assetKey: '/gcore.png', contentType: 'image/png', isText: false, fileInfo: { size: 40261, hash: 'af4a1427e9072e0a17ea2d74cfb47082db334a9ca4b1747cf1cd45e78c0f8c84', lastModifiedTime: 1775648879, assetPath: './images/gcore.png' }, lastModifiedTime: 1775648879, type: 'wasm-inline' },
'/home.png': { assetKey: '/home.png', contentType: 'image/png', isText: false, fileInfo: { size: 1502064, hash: '14fcd7ae0ab7080ddec2d1fa1af265432e93bd662f5f714512b3fda3157a4825', lastModifiedTime: 1775648879, assetPath: './images/home.png' }, lastModifiedTime: 1775648879, type: 'wasm-inline' },
'/gcore.png': { assetKey: '/gcore.png', contentType: 'image/png', isText: false, fileInfo: { size: 40261, hash: 'af4a1427e9072e0a17ea2d74cfb47082db334a9ca4b1747cf1cd45e78c0f8c84', lastModifiedTime: 1777556341, assetPath: './images/gcore.png' }, lastModifiedTime: 1777556341, type: 'wasm-inline' },
'/home.png': { assetKey: '/home.png', contentType: 'image/png', isText: false, fileInfo: { size: 1502064, hash: '14fcd7ae0ab7080ddec2d1fa1af265432e93bd662f5f714512b3fda3157a4825', lastModifiedTime: 1777556341, assetPath: './images/home.png' }, lastModifiedTime: 1777556341, type: 'wasm-inline' },
};

export { staticAssetManifest };
2 changes: 1 addition & 1 deletion examples/static-assets/src/styles-static-assets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/

const staticAssetManifest = {
'/index.css': { assetKey: '/index.css', contentType: 'text/css', isText: true, fileInfo: { size: 469, hash: '33301f457d01b81b22d448a9d7d4731de3da9e7618a7b15dfc6b688677d246f1', lastModifiedTime: 1775648879, assetPath: './styles/index.css' }, lastModifiedTime: 1775648879, type: 'wasm-inline' },
'/index.css': { assetKey: '/index.css', contentType: 'text/css', isText: true, fileInfo: { size: 469, hash: '33301f457d01b81b22d448a9d7d4731de3da9e7618a7b15dfc6b688677d246f1', lastModifiedTime: 1777556341, assetPath: './styles/index.css' }, lastModifiedTime: 1777556341, type: 'wasm-inline' },
};

export { staticAssetManifest };
2 changes: 1 addition & 1 deletion examples/static-assets/src/templates-static-assets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/

const staticAssetManifest = {
'/index.html': { assetKey: '/index.html', contentType: 'text/html', isText: true, fileInfo: { size: 1010, hash: 'cae9bcf1c0af05f33b86d27874b7765ed33c52e8ab9ca1c26655db917273ef4d', lastModifiedTime: 1775648879, assetPath: './templates/index.html' }, lastModifiedTime: 1775648879, type: 'wasm-inline' },
'/index.html': { assetKey: '/index.html', contentType: 'text/html', isText: true, fileInfo: { size: 1010, hash: 'cae9bcf1c0af05f33b86d27874b7765ed33c52e8ab9ca1c26655db917273ef4d', lastModifiedTime: 1777556341, assetPath: './templates/index.html' }, lastModifiedTime: 1777556341, type: 'wasm-inline' },
};

export { staticAssetManifest };
2 changes: 1 addition & 1 deletion github-pages/astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ export default defineConfig({
{
label: 'Migrating',
collapsed: true,
autogenerate: { directory: 'migrating' },
items: [{ autogenerate: { directory: 'migrating' } }],
},
],
}),
Expand Down
7 changes: 4 additions & 3 deletions github-pages/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@
"astro": "astro"
},
"dependencies": {
"@astrojs/starlight": "^0.37.7",
"astro": "^5.18.1",
"sharp": "^0.34.5"
"@astrojs/markdown-remark": "^7.2.0",
"@astrojs/starlight": "^0.41.1",
"astro": "^7.0.3",
"sharp": "^0.35.2"
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { defineCollection } from 'astro:content';
import { docsLoader } from '@astrojs/starlight/loaders';
import { docsSchema } from '@astrojs/starlight/schema';

export const collections = {
docs: defineCollection({ schema: docsSchema() }),
docs: defineCollection({ loader: docsLoader(), schema: docsSchema() }),
};
20 changes: 7 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@gcoredev/fastedge-sdk-js",
"version": "2.4.0",
"version": "2.5.1",
"engines": {
"node": ">=22",
"pnpm": ">=10"
Expand Down Expand Up @@ -58,30 +58,24 @@
"wit:bindings": "./runtime/fastedge/scripts/create-wit-bindings.sh"
},
"devDependencies": {
"@babel/core": "^7.29.0",
"@babel/preset-env": "^7.29.2",
"@babel/preset-typescript": "^7.28.5",
"@gmrchk/cli-testing-library": "^0.1.2",
"@jest/globals": "^30.3.0",
"@jest/transform": "^30.3.0",
"@semantic-release/changelog": "^6.0.3",
"@stylistic/eslint-plugin": "^5.10.0",
"@swc/core": "^1.15.0",
"@swc/jest": "^0.2.39",
"@types/jest": "^30.0.0",
"@types/node": "^25.6.0",
"babel-jest": "^30.3.0",
"babel-plugin-transform-import-meta": "^2.3.3",
"conventional-changelog-eslint": "^5.0.0",
"esbuild-plugin-polyfill-node": "^0.3.0",
"eslint": "^10.2.0",
"eslint-plugin-import-x": "^4.16.2",
"eslint-plugin-jest": "^29.15.2",
"eslint-plugin-testing-library": "^7.16.2",
"eslint-plugin-unicorn": "^64.0.0",
"eslint-plugin-unicorn": "^69.0.0",
"globals": "^17.5.0",
"hono": "^4.12.12",
"husky": "^9.1.7",
"jest": "^30.3.0",
"semantic-release": "^23.1.1",
"semantic-release": "^25.0.5",
"typescript": "^5.9.3",
"typescript-eslint": "^8.58.1"
},
Expand All @@ -95,8 +89,8 @@
"esbuild": "^0.28.0",
"event-target-polyfill": "^0.0.4",
"magic-string": "^0.30.21",
"npm-run-all2": "^8.0.4",
"npm-run-all2": "^9.0.2",
"prompts": "^2.4.2",
"regexpu-core": "^5.3.2"
"regexpu-core": "^6.4.0"
}
}
Loading
Loading