mirror of
https://github.com/hanzoai/next.js.git
synced 2026-09-24 17:00:51 +00:00
[ci] update relay-compiler to 21.0.1 (#95217)
We need to upgrade this because the ancient version of relay-compiler that we were using didn't support arm64.
This commit is contained in:
@@ -34,6 +34,7 @@ export default globalIgnores([
|
||||
'packages/create-next-app/templates/**/*',
|
||||
'test/development/basic/legacy-decorators/**/*.js',
|
||||
'test/production/emit-decorator-metadata/**/*.js',
|
||||
'test/**/*.graphql.ts',
|
||||
'!test/**/*.test.*',
|
||||
'test/e2e/app-dir/rsc-errors/app/swc/use-client/page.js',
|
||||
'**/test-timings.json',
|
||||
|
||||
@@ -54,6 +54,7 @@ bench/nested-deps/components/**/*
|
||||
|
||||
**/convex/_generated/**
|
||||
**/.tina/__generated__/**
|
||||
test/**/*.graphql.ts
|
||||
test/e2e/app-dir/server-source-maps/fixtures/default/app/bad-sourcemap/page.js
|
||||
test/e2e/app-dir/server-source-maps/fixtures/default/internal-pkg/ignored.js
|
||||
test/e2e/app-dir/server-source-maps/fixtures/default/internal-pkg/sourcemapped.js
|
||||
|
||||
@@ -162,7 +162,6 @@
|
||||
"@types/node-fetch": "2.6.1",
|
||||
"@types/react": "19.2.10",
|
||||
"@types/react-dom": "19.2.3",
|
||||
"@types/relay-runtime": "14.1.13",
|
||||
"@types/shell-quote": "1.7.1",
|
||||
"@types/string-hash": "1.1.1",
|
||||
"@types/trusted-types": "2.0.3",
|
||||
@@ -271,8 +270,6 @@
|
||||
"react-server-dom-webpack-experimental": "npm:[email protected]",
|
||||
"react-ssr-prepass": "1.0.8",
|
||||
"react-virtualized": "9.22.3",
|
||||
"relay-compiler": "13.0.2",
|
||||
"relay-runtime": "13.0.2",
|
||||
"release": "6.3.1",
|
||||
"request-promise-core": "1.1.2",
|
||||
"resolve-from": "5.0.0",
|
||||
|
||||
Generated
+1
-61
@@ -231,9 +231,6 @@ importers:
|
||||
'@types/react-dom':
|
||||
specifier: 19.2.3
|
||||
version: 19.2.3(@types/[email protected])
|
||||
'@types/relay-runtime':
|
||||
specifier: 14.1.13
|
||||
version: 14.1.13
|
||||
'@types/shell-quote':
|
||||
specifier: 1.7.1
|
||||
version: 1.7.1
|
||||
@@ -558,12 +555,6 @@ importers:
|
||||
react-virtualized:
|
||||
specifier: 9.22.3
|
||||
version: 9.22.3([email protected]([email protected]))([email protected])
|
||||
relay-compiler:
|
||||
specifier: 13.0.2
|
||||
version: 13.0.2
|
||||
relay-runtime:
|
||||
specifier: 13.0.2
|
||||
version: 13.0.2
|
||||
release:
|
||||
specifier: 6.3.1
|
||||
version: 6.3.1([email protected])
|
||||
@@ -6681,9 +6672,6 @@ packages:
|
||||
'@types/[email protected]':
|
||||
resolution: {integrity: sha512-WPigyYuGhgZ/cTPRXB2EwUw+XvsRA3GqHlsP4qteqrnnjDrApbS7MxcGr/hke5iUoeB7E/gQtrs9I37zAJ0Vjw==}
|
||||
|
||||
'@types/[email protected]':
|
||||
resolution: {integrity: sha512-NODqEnGjERJr02M0YQclUnXWCldmerNUkpFfuO317h/od1uXuwAW5131vpeiROE11BizPC/Qhup5VrwKsENazw==}
|
||||
|
||||
'@types/[email protected]':
|
||||
resolution: {integrity: sha512-yy7HuzQhj0dhGpD8RLXSZWEkLsV9ibvxvi6EiJ3bkqLAO1RGo0WbkWQiwpRlSFymTJRz0d3k5LM3kkx8ArDbLw==}
|
||||
|
||||
@@ -8717,9 +8705,6 @@ packages:
|
||||
engines: {node: '>=10.14', npm: '>=6', yarn: '>=1'}
|
||||
hasBin: true
|
||||
|
||||
[email protected]:
|
||||
resolution: {integrity: sha512-1eAtFWdIubi6T4XPy6ei9iUFoKpUkIF971QLN8lIvvvwueI65+Nw5haMNKUwfJxabqlIIDODJKGrQ66gxC0PbQ==}
|
||||
|
||||
[email protected]:
|
||||
resolution: {integrity: sha512-cvA+JwZoU0Xq+h6WkMvAUqPEYy92Obet6UdKLfW60qn99ftItKjB5T+BkyWOFWe2pUyfQ+IJHmpOTznqk1M6Kg==}
|
||||
|
||||
@@ -10363,12 +10348,6 @@ packages:
|
||||
[email protected]:
|
||||
resolution: {integrity: sha512-DkPJKQeY6kKwmuMretBhr7G6Vodr7bFwDYTXIkfG1gjvNpaxBTQV3PbXg6bR1c1UP4jPOX0jHUbbHANL9vRjVg==}
|
||||
|
||||
[email protected]:
|
||||
resolution: {integrity: sha512-b2XGFAFdWZWg0phtAWLHCk836A1Xann+I+Dgd3Gk64MHKZO44FfoD1KxyvbSh0qZsIoXQGGlVztIY+oitJPpRQ==}
|
||||
|
||||
[email protected]:
|
||||
resolution: {integrity: sha512-qv+boqYndjElAJHNN3NoM8XuwQZ1j2m3kEvTgdle8IDjr6oUbkEpvABWtj/rQl3vq4ew7dnElBxL4YJAwTVqQQ==}
|
||||
|
||||
[email protected]:
|
||||
resolution: {integrity: sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==}
|
||||
engines: {node: '>=12.0.0'}
|
||||
@@ -15896,13 +15875,6 @@ packages:
|
||||
resolution: {integrity: sha512-G08Dxvm4iDN3MLM0EsP62EDV9IuhXPR6blNz6Utcp7zyV3tr4HVNINt6MpaRWbxoOHT3Q7YN2P+jaHX8vUbgog==}
|
||||
engines: {node: '>= 0.10'}
|
||||
|
||||
[email protected]:
|
||||
resolution: {integrity: sha512-Gg/5FNj8gz03GRkG5KjMNpDB4nOeApDFZq+8CZehu3KkQQ+vNIurX6RiTY3UNUYvg5SX2A9DS5bq5iHJ8iEV3A==}
|
||||
hasBin: true
|
||||
|
||||
[email protected]:
|
||||
resolution: {integrity: sha512-sP4lNGfFcOm7tQD12qlvwsiOREDgjkw4FQAjtemmtwivKOqI4qHAL22Ar62r5TPVlASn4iVWMk7rIdIJI20KGQ==}
|
||||
|
||||
[email protected]:
|
||||
resolution: {integrity: sha512-gUAyHVHPPC5wdqX/LG4LWtRYtgjxyX78oanFNTMMyFEfOqdC54s3eE82imuWKbOeqYht2CrNf64Qb8vgmmtZGA==}
|
||||
engines: {node: '>=4'}
|
||||
@@ -17627,10 +17599,6 @@ packages:
|
||||
engines: {node: '>=14.17'}
|
||||
hasBin: true
|
||||
|
||||
[email protected]:
|
||||
resolution: {integrity: sha512-qLK/Xe9E2uzmYI3qLeOmI0tEOt+TBBQyUIAh4aAgU05FVYzeZrKUdkAZfBNVGRaHVgV0TDkdEngJSw/SyQchkQ==}
|
||||
deprecated: You are using an outdated version of ua-parser-js. Please update to ua-parser-js v0.7.33 / v1.0.33 / v2.0.0 (or later) to avoid ReDoS vulnerability [CVE-2022-25927](https://github.com/advisories/GHSA-fhg7-m89q-25r3)
|
||||
|
||||
[email protected]:
|
||||
resolution: {integrity: sha512-fKnGuqmTBnIE+/KXSzCn4db8RTigUzw1AN0DmdU6hJovUTbYJKyqj+8Mt1c4VfRDnOVJnENmfYkIPZ946UrSAA==}
|
||||
|
||||
@@ -23740,8 +23708,6 @@ snapshots:
|
||||
dependencies:
|
||||
csstype: 3.2.3
|
||||
|
||||
'@types/[email protected]': {}
|
||||
|
||||
'@types/[email protected]':
|
||||
dependencies:
|
||||
'@types/node': 20.17.6(patch_hash=9c31d25336aea4076b3cb942c35e59fd160c540947f01ea455a060367153f9fd)
|
||||
@@ -26118,10 +26084,6 @@ snapshots:
|
||||
dependencies:
|
||||
cross-spawn: 7.0.3
|
||||
|
||||
[email protected]:
|
||||
dependencies:
|
||||
node-fetch: 2.6.1
|
||||
|
||||
[email protected]([email protected]):
|
||||
dependencies:
|
||||
node-fetch: 2.7.0([email protected])
|
||||
@@ -26973,7 +26935,7 @@ snapshots:
|
||||
[email protected]:
|
||||
dependencies:
|
||||
'@babel/runtime': 7.27.0
|
||||
csstype: 3.1.2
|
||||
csstype: 3.2.3
|
||||
|
||||
[email protected]:
|
||||
dependencies:
|
||||
@@ -28334,18 +28296,6 @@ snapshots:
|
||||
dependencies:
|
||||
bser: 2.1.1
|
||||
|
||||
[email protected]: {}
|
||||
|
||||
[email protected]:
|
||||
dependencies:
|
||||
cross-fetch: 3.1.4
|
||||
fbjs-css-vars: 1.0.2
|
||||
loose-envify: 1.4.0
|
||||
object-assign: 4.1.1
|
||||
promise: 7.3.1
|
||||
setimmediate: 1.0.5
|
||||
ua-parser-js: 0.7.31
|
||||
|
||||
[email protected]([email protected]):
|
||||
optionalDependencies:
|
||||
picomatch: 4.0.3
|
||||
@@ -35229,14 +35179,6 @@ snapshots:
|
||||
|
||||
[email protected]: {}
|
||||
|
||||
[email protected]: {}
|
||||
|
||||
[email protected]:
|
||||
dependencies:
|
||||
'@babel/runtime': 7.27.0
|
||||
fbjs: 3.0.2
|
||||
invariant: 2.2.4
|
||||
|
||||
[email protected]:
|
||||
dependencies:
|
||||
es6-error: 4.1.1
|
||||
@@ -37287,8 +37229,6 @@ snapshots:
|
||||
|
||||
[email protected]: {}
|
||||
|
||||
[email protected]: {}
|
||||
|
||||
[email protected]: {}
|
||||
|
||||
[email protected]:
|
||||
|
||||
+46
-49
@@ -1,63 +1,60 @@
|
||||
/**
|
||||
* @generated SignedSource<<afaeba3a661c4bb0d2a399327c82d32b>>
|
||||
* @generated SignedSource<<7364a156ed6067a8aadb7d1c484d0d44>>
|
||||
* @lightSyntaxTransform
|
||||
* @nogrep
|
||||
*/
|
||||
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
// @ts-nocheck
|
||||
|
||||
import { ConcreteRequest, Query } from 'relay-runtime'
|
||||
export type pagesAQuery$variables = {}
|
||||
export type pagesAQueryVariables = pagesAQuery$variables
|
||||
import { ConcreteRequest } from 'relay-runtime';
|
||||
export type pagesAQuery$variables = Record<PropertyKey, never>;
|
||||
export type pagesAQuery$data = {
|
||||
readonly greeting: string
|
||||
}
|
||||
export type pagesAQueryResponse = pagesAQuery$data
|
||||
readonly greeting: string;
|
||||
};
|
||||
export type pagesAQuery = {
|
||||
variables: pagesAQueryVariables
|
||||
response: pagesAQuery$data
|
||||
}
|
||||
response: pagesAQuery$data;
|
||||
variables: pagesAQuery$variables;
|
||||
};
|
||||
|
||||
const node: ConcreteRequest = (function () {
|
||||
var v0 = [
|
||||
{
|
||||
alias: null,
|
||||
args: null,
|
||||
kind: 'ScalarField',
|
||||
name: 'greeting',
|
||||
storageKey: null,
|
||||
},
|
||||
]
|
||||
return {
|
||||
fragment: {
|
||||
argumentDefinitions: [],
|
||||
kind: 'Fragment',
|
||||
metadata: null,
|
||||
name: 'pagesAQuery',
|
||||
selections: v0 /*: any*/,
|
||||
type: 'Query',
|
||||
abstractKey: null,
|
||||
},
|
||||
kind: 'Request',
|
||||
operation: {
|
||||
argumentDefinitions: [],
|
||||
kind: 'Operation',
|
||||
name: 'pagesAQuery',
|
||||
selections: v0 /*: any*/,
|
||||
},
|
||||
params: {
|
||||
cacheID: 'bc59dc1b50eecd19488f004d5cd93913',
|
||||
id: null,
|
||||
metadata: {},
|
||||
name: 'pagesAQuery',
|
||||
operationKind: 'query',
|
||||
text: 'query pagesAQuery {\n greeting\n}\n',
|
||||
},
|
||||
const node: ConcreteRequest = (function(){
|
||||
var v0 = [
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "greeting",
|
||||
"storageKey": null
|
||||
}
|
||||
})()
|
||||
];
|
||||
return {
|
||||
"fragment": {
|
||||
"argumentDefinitions": [],
|
||||
"kind": "Fragment",
|
||||
"metadata": null,
|
||||
"name": "pagesAQuery",
|
||||
"selections": (v0/*:: as any*/),
|
||||
"type": "Query",
|
||||
"abstractKey": null
|
||||
},
|
||||
"kind": "Request",
|
||||
"operation": {
|
||||
"argumentDefinitions": [],
|
||||
"kind": "Operation",
|
||||
"name": "pagesAQuery",
|
||||
"selections": (v0/*:: as any*/)
|
||||
},
|
||||
"params": {
|
||||
"cacheID": "bc59dc1b50eecd19488f004d5cd93913",
|
||||
"id": null,
|
||||
"metadata": {},
|
||||
"name": "pagesAQuery",
|
||||
"operationKind": "query",
|
||||
"text": "query pagesAQuery {\n greeting\n}\n"
|
||||
}
|
||||
};
|
||||
})();
|
||||
|
||||
;(node as any).hash = '7f699085b71746bb18cb74e3a0776f46'
|
||||
(node as any).hash = "7f699085b71746bb18cb74e3a0776f46";
|
||||
|
||||
export default node
|
||||
export default node;
|
||||
|
||||
+46
-49
@@ -1,63 +1,60 @@
|
||||
/**
|
||||
* @generated SignedSource<<9f92ea3ccfda1f64fa269e68b912abae>>
|
||||
* @generated SignedSource<<b379ecb8d3a28edccf96b8fbbab39b39>>
|
||||
* @lightSyntaxTransform
|
||||
* @nogrep
|
||||
*/
|
||||
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
// @ts-nocheck
|
||||
|
||||
import { ConcreteRequest, Query } from 'relay-runtime'
|
||||
export type pagesBQuery$variables = {}
|
||||
export type pagesBQueryVariables = pagesBQuery$variables
|
||||
import { ConcreteRequest } from 'relay-runtime';
|
||||
export type pagesBQuery$variables = Record<PropertyKey, never>;
|
||||
export type pagesBQuery$data = {
|
||||
readonly greeting: string
|
||||
}
|
||||
export type pagesBQueryResponse = pagesBQuery$data
|
||||
readonly greeting: string;
|
||||
};
|
||||
export type pagesBQuery = {
|
||||
variables: pagesBQueryVariables
|
||||
response: pagesBQuery$data
|
||||
}
|
||||
response: pagesBQuery$data;
|
||||
variables: pagesBQuery$variables;
|
||||
};
|
||||
|
||||
const node: ConcreteRequest = (function () {
|
||||
var v0 = [
|
||||
{
|
||||
alias: null,
|
||||
args: null,
|
||||
kind: 'ScalarField',
|
||||
name: 'greeting',
|
||||
storageKey: null,
|
||||
},
|
||||
]
|
||||
return {
|
||||
fragment: {
|
||||
argumentDefinitions: [],
|
||||
kind: 'Fragment',
|
||||
metadata: null,
|
||||
name: 'pagesBQuery',
|
||||
selections: v0 /*: any*/,
|
||||
type: 'Query',
|
||||
abstractKey: null,
|
||||
},
|
||||
kind: 'Request',
|
||||
operation: {
|
||||
argumentDefinitions: [],
|
||||
kind: 'Operation',
|
||||
name: 'pagesBQuery',
|
||||
selections: v0 /*: any*/,
|
||||
},
|
||||
params: {
|
||||
cacheID: 'e7cc6f8c55ef42783faec7a49b72ae71',
|
||||
id: null,
|
||||
metadata: {},
|
||||
name: 'pagesBQuery',
|
||||
operationKind: 'query',
|
||||
text: 'query pagesBQuery {\n greeting\n}\n',
|
||||
},
|
||||
const node: ConcreteRequest = (function(){
|
||||
var v0 = [
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "greeting",
|
||||
"storageKey": null
|
||||
}
|
||||
})()
|
||||
];
|
||||
return {
|
||||
"fragment": {
|
||||
"argumentDefinitions": [],
|
||||
"kind": "Fragment",
|
||||
"metadata": null,
|
||||
"name": "pagesBQuery",
|
||||
"selections": (v0/*:: as any*/),
|
||||
"type": "Query",
|
||||
"abstractKey": null
|
||||
},
|
||||
"kind": "Request",
|
||||
"operation": {
|
||||
"argumentDefinitions": [],
|
||||
"kind": "Operation",
|
||||
"name": "pagesBQuery",
|
||||
"selections": (v0/*:: as any*/)
|
||||
},
|
||||
"params": {
|
||||
"cacheID": "e7cc6f8c55ef42783faec7a49b72ae71",
|
||||
"id": null,
|
||||
"metadata": {},
|
||||
"name": "pagesBQuery",
|
||||
"operationKind": "query",
|
||||
"text": "query pagesBQuery {\n greeting\n}\n"
|
||||
}
|
||||
};
|
||||
})();
|
||||
|
||||
;(node as any).hash = '83bf9452eafa7635d81bdc98603cd75f'
|
||||
(node as any).hash = "83bf9452eafa7635d81bdc98603cd75f";
|
||||
|
||||
export default node
|
||||
export default node;
|
||||
|
||||
@@ -1,27 +1,30 @@
|
||||
import { join } from 'path'
|
||||
import { execFileSync } from 'child_process'
|
||||
import { nextTestSetup, isNextDev } from 'e2e-utils'
|
||||
import {
|
||||
nextTestSetup,
|
||||
isNextDev,
|
||||
isNextDeploy,
|
||||
type NextInstance,
|
||||
} from 'e2e-utils'
|
||||
import execa from 'execa'
|
||||
import { shouldUseTurbopack } from 'next-test-utils'
|
||||
|
||||
const relayCompilerPath = join(
|
||||
__dirname,
|
||||
'../../../node_modules/relay-compiler/cli.js'
|
||||
)
|
||||
|
||||
describe('Relay Compiler Transform - Multi Project Config', () => {
|
||||
beforeAll(() => {
|
||||
execFileSync(process.execPath, [relayCompilerPath], {
|
||||
cwd: __dirname,
|
||||
stdio: 'inherit',
|
||||
function relayCompilerValidate(next: NextInstance) {
|
||||
;(isNextDeploy ? it.skip : it)('has up-to-date graphql types', async () => {
|
||||
await execa('pnpm', ['exec', 'relay-compiler', '--validate'], {
|
||||
cwd: next.testDir,
|
||||
stdout: 'inherit',
|
||||
stderr: 'inherit',
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
describe('Relay Compiler Transform - Multi Project Config', () => {
|
||||
describe('project-a', () => {
|
||||
const { next } = nextTestSetup({
|
||||
files: __dirname,
|
||||
dependencies: {
|
||||
'relay-runtime': '13.0.2',
|
||||
'@types/relay-runtime': '14.1.13',
|
||||
'relay-compiler': '21.0.1',
|
||||
'relay-runtime': '21.0.1',
|
||||
'@types/relay-runtime': '20.1.1',
|
||||
react: '19.3.0-canary-fef12a01-20260413',
|
||||
'react-dom': '19.3.0-canary-fef12a01-20260413',
|
||||
},
|
||||
@@ -45,6 +48,8 @@ describe('Relay Compiler Transform - Multi Project Config', () => {
|
||||
skipDeployment: true,
|
||||
})
|
||||
|
||||
relayCompilerValidate(next)
|
||||
|
||||
it('should resolve index page correctly', async () => {
|
||||
const html = await next.render('/')
|
||||
expect(html).toContain('Project A')
|
||||
@@ -56,8 +61,9 @@ describe('Relay Compiler Transform - Multi Project Config', () => {
|
||||
const { next } = nextTestSetup({
|
||||
files: __dirname,
|
||||
dependencies: {
|
||||
'relay-runtime': '13.0.2',
|
||||
'@types/relay-runtime': '14.1.13',
|
||||
'relay-compiler': '21.0.1',
|
||||
'relay-runtime': '21.0.1',
|
||||
'@types/relay-runtime': '20.1.1',
|
||||
react: '19.3.0-canary-fef12a01-20260413',
|
||||
'react-dom': '19.3.0-canary-fef12a01-20260413',
|
||||
},
|
||||
@@ -76,6 +82,8 @@ describe('Relay Compiler Transform - Multi Project Config', () => {
|
||||
skipDeployment: true,
|
||||
})
|
||||
|
||||
relayCompilerValidate(next)
|
||||
|
||||
it('should resolve index page correctly', async () => {
|
||||
const html = await next.render('/')
|
||||
expect(html).toContain('Project B')
|
||||
|
||||
+46
-49
@@ -1,63 +1,60 @@
|
||||
/**
|
||||
* @generated SignedSource<<187ead9fb6e7b26d71c9161bda6ab902>>
|
||||
* @generated SignedSource<<d54cc95ecdca6c472aeedb358edd52c3>>
|
||||
* @lightSyntaxTransform
|
||||
* @nogrep
|
||||
*/
|
||||
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
// @ts-nocheck
|
||||
|
||||
import { ConcreteRequest, Query } from 'relay-runtime'
|
||||
export type pagesQuery$variables = {}
|
||||
export type pagesQueryVariables = pagesQuery$variables
|
||||
import { ConcreteRequest } from 'relay-runtime';
|
||||
export type pagesQuery$variables = Record<PropertyKey, never>;
|
||||
export type pagesQuery$data = {
|
||||
readonly greeting: string
|
||||
}
|
||||
export type pagesQueryResponse = pagesQuery$data
|
||||
readonly greeting: string;
|
||||
};
|
||||
export type pagesQuery = {
|
||||
variables: pagesQueryVariables
|
||||
response: pagesQuery$data
|
||||
}
|
||||
response: pagesQuery$data;
|
||||
variables: pagesQuery$variables;
|
||||
};
|
||||
|
||||
const node: ConcreteRequest = (function () {
|
||||
var v0 = [
|
||||
{
|
||||
alias: null,
|
||||
args: null,
|
||||
kind: 'ScalarField',
|
||||
name: 'greeting',
|
||||
storageKey: null,
|
||||
},
|
||||
]
|
||||
return {
|
||||
fragment: {
|
||||
argumentDefinitions: [],
|
||||
kind: 'Fragment',
|
||||
metadata: null,
|
||||
name: 'pagesQuery',
|
||||
selections: v0 /*: any*/,
|
||||
type: 'Query',
|
||||
abstractKey: null,
|
||||
},
|
||||
kind: 'Request',
|
||||
operation: {
|
||||
argumentDefinitions: [],
|
||||
kind: 'Operation',
|
||||
name: 'pagesQuery',
|
||||
selections: v0 /*: any*/,
|
||||
},
|
||||
params: {
|
||||
cacheID: '167b6de16340efeb876a7787c90e7cec',
|
||||
id: null,
|
||||
metadata: {},
|
||||
name: 'pagesQuery',
|
||||
operationKind: 'query',
|
||||
text: 'query pagesQuery {\n greeting\n}\n',
|
||||
},
|
||||
const node: ConcreteRequest = (function(){
|
||||
var v0 = [
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "greeting",
|
||||
"storageKey": null
|
||||
}
|
||||
})()
|
||||
];
|
||||
return {
|
||||
"fragment": {
|
||||
"argumentDefinitions": [],
|
||||
"kind": "Fragment",
|
||||
"metadata": null,
|
||||
"name": "pagesQuery",
|
||||
"selections": (v0/*:: as any*/),
|
||||
"type": "Query",
|
||||
"abstractKey": null
|
||||
},
|
||||
"kind": "Request",
|
||||
"operation": {
|
||||
"argumentDefinitions": [],
|
||||
"kind": "Operation",
|
||||
"name": "pagesQuery",
|
||||
"selections": (v0/*:: as any*/)
|
||||
},
|
||||
"params": {
|
||||
"cacheID": "167b6de16340efeb876a7787c90e7cec",
|
||||
"id": null,
|
||||
"metadata": {},
|
||||
"name": "pagesQuery",
|
||||
"operationKind": "query",
|
||||
"text": "query pagesQuery {\n greeting\n}\n"
|
||||
}
|
||||
};
|
||||
})();
|
||||
|
||||
;(node as any).hash = '4017856344f36f61252354e2eb442d98'
|
||||
(node as any).hash = "4017856344f36f61252354e2eb442d98";
|
||||
|
||||
export default node
|
||||
export default node;
|
||||
|
||||
+16
-12
@@ -1,18 +1,22 @@
|
||||
import { nextTestSetup, isNextDev, isNextStart } from 'e2e-utils'
|
||||
;((isNextDev && process.env.TURBOPACK_BUILD) ||
|
||||
(isNextStart && process.env.TURBOPACK_DEV)
|
||||
? describe.skip
|
||||
: describe)('Relay Compiler Transform - Single Project Config', () => {
|
||||
const { next } = nextTestSetup({
|
||||
import { nextTestSetup } from 'e2e-utils'
|
||||
import execa from 'execa'
|
||||
|
||||
describe('Relay Compiler Transform - Single Project Config', () => {
|
||||
const { next, isNextDeploy } = nextTestSetup({
|
||||
files: __dirname,
|
||||
dependencies: {
|
||||
'relay-compiler': '13.0.2',
|
||||
'relay-runtime': '13.0.2',
|
||||
'@types/relay-runtime': 'latest',
|
||||
'relay-compiler': '21.0.1',
|
||||
'relay-runtime': '21.0.1',
|
||||
'@types/relay-runtime': '20.1.1',
|
||||
},
|
||||
// Relay expects the project root to contain relay.config.js. Run the compiler
|
||||
// after install so generated artifacts match the schema before dev/start.
|
||||
installCommand: 'pnpm install && npx relay-compiler',
|
||||
})
|
||||
|
||||
;(isNextDeploy ? it.skip : it)('has up-to-date graphql types', async () => {
|
||||
await execa('pnpm', ['exec', 'relay-compiler', '--validate'], {
|
||||
cwd: next.testDir,
|
||||
stdout: 'inherit',
|
||||
stderr: 'inherit',
|
||||
})
|
||||
})
|
||||
|
||||
it('should resolve index page correctly', async () => {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
module.exports = {
|
||||
src: './pages',
|
||||
src: './queries',
|
||||
schema: './schema.graphql',
|
||||
language: 'typescript',
|
||||
}
|
||||
|
||||
@@ -1,6 +1,12 @@
|
||||
import { Environment, Network, RecordSource, Store } from 'relay-runtime'
|
||||
import {
|
||||
Environment,
|
||||
type GraphQLResponse,
|
||||
Network,
|
||||
RecordSource,
|
||||
Store,
|
||||
} from 'relay-runtime'
|
||||
|
||||
async function fetchGraphQL(text, variables) {
|
||||
async function fetchGraphQL(text, variables): Promise<GraphQLResponse> {
|
||||
return new Promise((next) => {
|
||||
const res = () => {
|
||||
return next({ data: { viewer: { user: { id: '123', name: 'Foo' } } } })
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import { graphql, useRelayEnvironment, QueryRenderer } from 'react-relay'
|
||||
|
||||
import type { pagesQueryResponse } from '@/types/pagesQuery.graphql'
|
||||
import type { pagesQuery } from '@/types/pagesQuery.graphql'
|
||||
|
||||
function Component() {
|
||||
const env = useRelayEnvironment()
|
||||
return (
|
||||
<QueryRenderer
|
||||
<QueryRenderer<pagesQuery>
|
||||
environment={env}
|
||||
query={graphql`
|
||||
query pagesQuery {
|
||||
@@ -17,7 +17,7 @@ function Component() {
|
||||
}
|
||||
}
|
||||
`}
|
||||
render={({ props }: { props: pagesQueryResponse }) => {
|
||||
render={({ props }) => {
|
||||
if (props) {
|
||||
return (
|
||||
<div>
|
||||
@@ -28,6 +28,7 @@ function Component() {
|
||||
|
||||
return <div>Loading...</div>
|
||||
}}
|
||||
variables={{}}
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"src": "./pages",
|
||||
"artifactDirectory": "./types",
|
||||
"schema": "./main.graphql",
|
||||
"language": "typescript"
|
||||
}
|
||||
@@ -1,107 +1,109 @@
|
||||
/**
|
||||
* @generated SignedSource<<a6468d297da1928100bce80db9f1b8ab>>
|
||||
* @generated SignedSource<<cb876bb940c4d1e98190d2e07ef3ad92>>
|
||||
* @lightSyntaxTransform
|
||||
* @nogrep
|
||||
*/
|
||||
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
// @ts-nocheck
|
||||
|
||||
import { ConcreteRequest, Query } from 'relay-runtime'
|
||||
export type pagesQuery$variables = {}
|
||||
export type pagesQueryVariables = pagesQuery$variables
|
||||
import { ConcreteRequest } from 'relay-runtime';
|
||||
export type pagesQuery$variables = Record<PropertyKey, never>;
|
||||
export type pagesQuery$data = {
|
||||
readonly viewer: {
|
||||
readonly user: {
|
||||
readonly id: string
|
||||
readonly name: string
|
||||
}
|
||||
}
|
||||
}
|
||||
export type pagesQueryResponse = pagesQuery$data
|
||||
readonly id: string;
|
||||
readonly name: string;
|
||||
};
|
||||
};
|
||||
};
|
||||
export type pagesQuery = {
|
||||
variables: pagesQueryVariables
|
||||
response: pagesQuery$data
|
||||
}
|
||||
response: pagesQuery$data;
|
||||
variables: pagesQuery$variables;
|
||||
};
|
||||
|
||||
const node: ConcreteRequest = (function () {
|
||||
var v0 = {
|
||||
alias: null,
|
||||
args: null,
|
||||
kind: 'ScalarField',
|
||||
name: 'id',
|
||||
storageKey: null,
|
||||
},
|
||||
v1 = {
|
||||
alias: null,
|
||||
args: null,
|
||||
concreteType: 'User',
|
||||
kind: 'LinkedField',
|
||||
name: 'user',
|
||||
plural: false,
|
||||
selections: [
|
||||
v0 /*: any*/,
|
||||
{
|
||||
alias: null,
|
||||
args: null,
|
||||
kind: 'ScalarField',
|
||||
name: 'name',
|
||||
storageKey: null,
|
||||
},
|
||||
],
|
||||
storageKey: null,
|
||||
const node: ConcreteRequest = (function(){
|
||||
var v0 = {
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "id",
|
||||
"storageKey": null
|
||||
},
|
||||
v1 = {
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"concreteType": "User",
|
||||
"kind": "LinkedField",
|
||||
"name": "user",
|
||||
"plural": false,
|
||||
"selections": [
|
||||
(v0/*:: as any*/),
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"kind": "ScalarField",
|
||||
"name": "name",
|
||||
"storageKey": null
|
||||
}
|
||||
return {
|
||||
fragment: {
|
||||
argumentDefinitions: [],
|
||||
kind: 'Fragment',
|
||||
metadata: null,
|
||||
name: 'pagesQuery',
|
||||
selections: [
|
||||
{
|
||||
alias: null,
|
||||
args: null,
|
||||
concreteType: 'Viewer',
|
||||
kind: 'LinkedField',
|
||||
name: 'viewer',
|
||||
plural: false,
|
||||
selections: [v1 /*: any*/],
|
||||
storageKey: null,
|
||||
},
|
||||
],
|
||||
type: 'Query',
|
||||
abstractKey: null,
|
||||
},
|
||||
kind: 'Request',
|
||||
operation: {
|
||||
argumentDefinitions: [],
|
||||
kind: 'Operation',
|
||||
name: 'pagesQuery',
|
||||
selections: [
|
||||
{
|
||||
alias: null,
|
||||
args: null,
|
||||
concreteType: 'Viewer',
|
||||
kind: 'LinkedField',
|
||||
name: 'viewer',
|
||||
plural: false,
|
||||
selections: [v1 /*: any*/, v0 /*: any*/],
|
||||
storageKey: null,
|
||||
},
|
||||
],
|
||||
},
|
||||
params: {
|
||||
cacheID: '5a14ce729d0deb2c3170bcdcba33a61a',
|
||||
id: null,
|
||||
metadata: {},
|
||||
name: 'pagesQuery',
|
||||
operationKind: 'query',
|
||||
text: 'query pagesQuery {\n viewer {\n user {\n id\n name\n }\n id\n }\n}\n',
|
||||
},
|
||||
],
|
||||
"storageKey": null
|
||||
};
|
||||
return {
|
||||
"fragment": {
|
||||
"argumentDefinitions": [],
|
||||
"kind": "Fragment",
|
||||
"metadata": null,
|
||||
"name": "pagesQuery",
|
||||
"selections": [
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"concreteType": "Viewer",
|
||||
"kind": "LinkedField",
|
||||
"name": "viewer",
|
||||
"plural": false,
|
||||
"selections": [
|
||||
(v1/*:: as any*/)
|
||||
],
|
||||
"storageKey": null
|
||||
}
|
||||
],
|
||||
"type": "Query",
|
||||
"abstractKey": null
|
||||
},
|
||||
"kind": "Request",
|
||||
"operation": {
|
||||
"argumentDefinitions": [],
|
||||
"kind": "Operation",
|
||||
"name": "pagesQuery",
|
||||
"selections": [
|
||||
{
|
||||
"alias": null,
|
||||
"args": null,
|
||||
"concreteType": "Viewer",
|
||||
"kind": "LinkedField",
|
||||
"name": "viewer",
|
||||
"plural": false,
|
||||
"selections": [
|
||||
(v1/*:: as any*/),
|
||||
(v0/*:: as any*/)
|
||||
],
|
||||
"storageKey": null
|
||||
}
|
||||
]
|
||||
},
|
||||
"params": {
|
||||
"cacheID": "5a14ce729d0deb2c3170bcdcba33a61a",
|
||||
"id": null,
|
||||
"metadata": {},
|
||||
"name": "pagesQuery",
|
||||
"operationKind": "query",
|
||||
"text": "query pagesQuery {\n viewer {\n user {\n id\n name\n }\n id\n }\n}\n"
|
||||
}
|
||||
})()
|
||||
};
|
||||
})();
|
||||
|
||||
;(node as any).hash = '00b43dedd685e716dda36f66f4d5e30e'
|
||||
(node as any).hash = "00b43dedd685e716dda36f66f4d5e30e";
|
||||
|
||||
export default node
|
||||
export default node;
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
import { FileRef, nextTestSetup } from 'e2e-utils'
|
||||
import execa from 'execa'
|
||||
import path from 'path'
|
||||
|
||||
const appDir = path.join(__dirname, 'app')
|
||||
|
||||
// react-relay is not compatible with React 19 and therefore Next.js 15
|
||||
describe.skip('next/jest', () => {
|
||||
nextTestSetup({
|
||||
describe('next/jest', () => {
|
||||
const { next, isNextDeploy } = nextTestSetup({
|
||||
files: {
|
||||
components: new FileRef(path.join(appDir, 'components')),
|
||||
pages: new FileRef(path.join(appDir, 'pages')),
|
||||
'tests/entry.test.tsx': `
|
||||
import { render, waitFor } from '@testing-library/react'
|
||||
import { act, render, waitFor } from '@testing-library/react'
|
||||
import { RelayEnvironmentProvider } from 'react-relay'
|
||||
import { createMockEnvironment, MockPayloadGenerator } from 'relay-test-utils'
|
||||
|
||||
@@ -26,8 +26,10 @@ describe.skip('next/jest', () => {
|
||||
</RelayEnvironmentProvider>
|
||||
)
|
||||
|
||||
environment.mock.resolveMostRecentOperation((operation) => {
|
||||
return MockPayloadGenerator.generate(operation)
|
||||
act(() => {
|
||||
environment.mock.resolveMostRecentOperation((operation) => {
|
||||
return MockPayloadGenerator.generate(operation)
|
||||
})
|
||||
})
|
||||
|
||||
await waitFor(() => getByText('Data requested:'))
|
||||
@@ -39,22 +41,24 @@ describe.skip('next/jest', () => {
|
||||
`,
|
||||
types: new FileRef(path.join(appDir, 'types')),
|
||||
'jest.config.js': new FileRef(path.join(appDir, 'jest.config.js')),
|
||||
'next.config.js': new FileRef(path.join(appDir, 'next.config.js')),
|
||||
'tsconfig.json': new FileRef(path.join(appDir, 'tsconfig.json')),
|
||||
'main.graphql': new FileRef(path.join(appDir, 'main.graphql')),
|
||||
'next.config.js': new FileRef(path.join(appDir, 'next.config.js')),
|
||||
'relay.config.json': new FileRef(path.join(appDir, 'relay.config.json')),
|
||||
'tsconfig.json': new FileRef(path.join(appDir, 'tsconfig.json')),
|
||||
},
|
||||
dependencies: {
|
||||
jest: '27.4.7',
|
||||
'react-relay': '13.2.0',
|
||||
jest: '29.7.0',
|
||||
'@testing-library/react': '15.0.2',
|
||||
'@types/jest': '27.4.1',
|
||||
'@types/relay-runtime': '20.1.1',
|
||||
'babel-jest': '27.5.1',
|
||||
'babel-plugin-relay': '13.2.0',
|
||||
jsdom: '19.0.0',
|
||||
'relay-compiler': '13.0.1',
|
||||
'relay-runtime': '13.0.2',
|
||||
'relay-test-utils': '13.0.2',
|
||||
typescript: '5.2.2',
|
||||
'babel-plugin-relay': '21.0.1',
|
||||
'jest-environment-jsdom': '29.7.0',
|
||||
'react-relay': '21.0.1',
|
||||
'relay-compiler': '21.0.1',
|
||||
'relay-runtime': '21.0.1',
|
||||
'relay-test-utils': '21.0.1',
|
||||
typescript: '5.9.3',
|
||||
},
|
||||
packageJson: {
|
||||
scripts: {
|
||||
@@ -62,8 +66,14 @@ describe.skip('next/jest', () => {
|
||||
build: 'jest --forceExit tests/entry.test.tsx && next build',
|
||||
},
|
||||
},
|
||||
installCommand: 'pnpm i',
|
||||
buildCommand: `pnpm build`,
|
||||
})
|
||||
|
||||
;(isNextDeploy ? it.skip : it)('has up-to-date graphql types', async () => {
|
||||
await execa('pnpm', ['exec', 'relay-compiler', '--validate'], {
|
||||
cwd: next.testDir,
|
||||
stdout: 'inherit',
|
||||
stderr: 'inherit',
|
||||
})
|
||||
})
|
||||
|
||||
it('should work', async () => {
|
||||
|
||||
Reference in New Issue
Block a user