Skip to content

Commit 4e6f327

Browse files
committed
feat: request infra improvements (#9220)
* chore: improve error message tracing * update all the things * fixup docs * cleanup private access * fix trailing ? * fix lint * fix arg ordering * fix type * fix more types
1 parent 05aa5e4 commit 4e6f327

File tree

48 files changed

+2369
-191
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+2369
-191
lines changed

docs-generator/yuidoc.json

+1-4
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,7 @@
66
"enabledEnvironments": [],
77
"extension": ".js,.ts",
88
"preprocessor": "./yui-docs-preprocessor.js",
9-
"excludeTags": [
10-
"internal",
11-
"feature"
12-
],
9+
"excludeTags": ["internal", "feature", "typedoc", "see", "link", "inheritdoc"],
1310
"paths": [
1411
"../ember-data-types",
1512
"../packages/-ember-data/addon",

package.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -84,13 +84,13 @@
8484
"node": "16.* || >= 18.*",
8585
"yarn": "use pnpm",
8686
"npm": "use pnpm",
87-
"pnpm": "8.7.5"
87+
"pnpm": "8.6.0"
8888
},
8989
"volta": {
90-
"node": "18.17.1",
91-
"pnpm": "8.7.5"
90+
"node": "20.11.0",
91+
"pnpm": "8.6.0"
9292
},
93-
"packageManager": "pnpm@8.7.5",
93+
"packageManager": "pnpm@8.6.0",
9494
"changelog": {
9595
"labels": {
9696
":label: breaking": ":boom: Breaking Change",

packages/-ember-data/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -101,5 +101,5 @@
101101
"volta": {
102102
"extends": "../../package.json"
103103
},
104-
"packageManager": "pnpm@8.7.5"
105-
}
104+
"packageManager": "pnpm@8.6.0"
105+
}

packages/active-record/src/-private/builders/query.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -77,10 +77,11 @@ export function query(
7777

7878
const url = buildBaseURL(urlOptions);
7979
const headers = new Headers();
80-
headers.append('Accept', 'application/json; charset=utf-8');
80+
headers.append('Accept', 'application/json;charset=utf-8');
81+
const queryString = buildQueryParams(query, options.urlParamsSettings);
8182

8283
return {
83-
url: `${url}?${buildQueryParams(query, options.urlParamsSettings)}`,
84+
url: queryString ? `${url}?${queryString}` : url,
8485
method: 'GET',
8586
headers,
8687
cacheOptions,

packages/active-record/src/-private/builders/save-record.ts

+3
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ export function deleteRecord(record: unknown, options: ConstrainedRequestOptions
101101
data: {
102102
record: identifier,
103103
},
104+
records: [identifier],
104105
};
105106
}
106107

@@ -170,6 +171,7 @@ export function createRecord(record: unknown, options: ConstrainedRequestOptions
170171
data: {
171172
record: identifier,
172173
},
174+
records: [identifier],
173175
};
174176
}
175177

@@ -246,5 +248,6 @@ export function updateRecord(
246248
data: {
247249
record: identifier,
248250
},
251+
records: [identifier],
249252
};
250253
}

packages/adapter/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -80,5 +80,5 @@
8080
"volta": {
8181
"extends": "../../package.json"
8282
},
83-
"packageManager": "pnpm@8.7.5"
84-
}
83+
"packageManager": "pnpm@8.6.0"
84+
}

packages/debug/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -45,5 +45,5 @@
4545
"volta": {
4646
"extends": "../../package.json"
4747
},
48-
"packageManager": "pnpm@8.7.5"
49-
}
48+
"packageManager": "pnpm@8.6.0"
49+
}

packages/graph/package.json

+10-10
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,6 @@
1818
"prepack": "pnpm build",
1919
"prepare": "pnpm build"
2020
},
21-
"ember-addon": {
22-
"main": "addon-main.js",
23-
"type": "addon",
24-
"version": 1
25-
},
2621
"files": [
2722
"addon-main.js",
2823
"addon",
@@ -70,14 +65,19 @@
7065
"walk-sync": "^3.0.0",
7166
"webpack": "^5.88.2"
7267
},
73-
"ember": {
74-
"edition": "octane"
75-
},
7668
"engines": {
7769
"node": "16.* || >= 18.*"
7870
},
7971
"volta": {
8072
"extends": "../../package.json"
8173
},
82-
"packageManager": "pnpm@8.7.5"
83-
}
74+
"packageManager": "pnpm@8.6.0",
75+
"ember-addon": {
76+
"main": "addon-main.js",
77+
"type": "addon",
78+
"version": 1
79+
},
80+
"ember": {
81+
"edition": "octane"
82+
}
83+
}

packages/json-api/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -89,5 +89,5 @@
8989
"volta": {
9090
"extends": "../../package.json"
9191
},
92-
"packageManager": "pnpm@8.7.5"
93-
}
92+
"packageManager": "pnpm@8.6.0"
93+
}

packages/json-api/src/-private/builders/query.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,10 @@ export function query(
8181
const url = buildBaseURL(urlOptions);
8282
const headers = new Headers();
8383
headers.append('Accept', ACCEPT_HEADER_VALUE);
84+
const queryString = buildQueryParams(query, options.urlParamsSettings);
8485

8586
return {
86-
url: `${url}?${buildQueryParams(query, options.urlParamsSettings)}`,
87+
url: queryString ? `${url}?${queryString}` : url,
8788
method: 'GET',
8889
headers,
8990
cacheOptions,

packages/json-api/src/-private/builders/save-record.ts

+3
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ export function deleteRecord(record: unknown, options: ConstrainedRequestOptions
100100
data: {
101101
record: identifier,
102102
},
103+
records: [identifier],
103104
};
104105
}
105106

@@ -169,6 +170,7 @@ export function createRecord(record: unknown, options: ConstrainedRequestOptions
169170
data: {
170171
record: identifier,
171172
},
173+
records: [identifier],
172174
};
173175
}
174176

@@ -245,5 +247,6 @@ export function updateRecord(
245247
data: {
246248
record: identifier,
247249
},
250+
records: [identifier],
248251
};
249252
}

packages/legacy-compat/src/legacy-network-handler/legacy-network-handler.ts

+7
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,13 @@ function saveRecord<T>(context: StoreRequestContext): Promise<T> {
205205
store._join(() => {
206206
result = store.cache.didCommit(identifier, { request: context.request, content: payload });
207207
});
208+
209+
// blatantly lie if we were a createRecord request
210+
// to give some semblance of cache-control to the
211+
// lifetimes service while legacy is still around
212+
if (store.lifetimes?.didRequest && operation === 'createRecord') {
213+
store.lifetimes.didRequest(context.request, { status: 201 } as Response, null, store);
214+
}
208215
return store.peekRecord(result!.data!);
209216
})
210217
.catch((e: unknown) => {

packages/model/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -103,5 +103,5 @@
103103
"volta": {
104104
"extends": "../../package.json"
105105
},
106-
"packageManager": "pnpm@8.7.5"
107-
}
106+
"packageManager": "pnpm@8.6.0"
107+
}

packages/private-build-infra/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -41,5 +41,5 @@
4141
"volta": {
4242
"extends": "../../package.json"
4343
},
44-
"packageManager": "pnpm@8.7.5"
45-
}
44+
"packageManager": "pnpm@8.6.0"
45+
}

0 commit comments

Comments
 (0)