Skip to content
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

Bulk backports to v4-main (3/7 edition) #9751

Merged
merged 61 commits into from
Mar 10, 2025
Merged
Changes from 1 commit
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
4d24763
Add perf info for re-materialization (#9681)
gitKrystan Feb 13, 2025
3ffb4bc
feat: runtime logging activation (#9683)
runspired Feb 19, 2025
9b80ccb
Fix bug where race condition causes errors during Request refresh (#9…
gitKrystan Feb 20, 2025
9532b93
feat(cache): add peekRemoteState to cache to view remote state (#9624)
richgt Feb 21, 2025
7a73dbb
feat: add patchRecord util to JSON:API (#9687)
runspired Feb 22, 2025
2b1cf4b
feat: immutable records should show only remote state, make builder t…
runspired Feb 22, 2025
ead24ba
Fix: support all known http methods (#9689)
runspired Feb 22, 2025
1af9a68
chore: fixup SchemaRecord readme (#9690)
runspired Feb 22, 2025
5e83d6e
chore: minor docs fixes
runspired Feb 22, 2025
7da6373
Feat: hasMany linksMode (#9676)
leoeuclids Feb 22, 2025
8738378
fix: make serialize utils smarter (#9692)
runspired Feb 22, 2025
7ac6b20
chore: add env vars to turbo config (#9693)
runspired Feb 23, 2025
6c8eae4
docs: small cleanup for SchemaRecord intro (#9694)
runspired Feb 23, 2025
d0a034b
chore: [BREAKING to prior alpha/betas] prepare SchemaRecord for stabl…
runspired Feb 23, 2025
fc7c9b4
doc: link to jsonapi.org when referencing
runspired Feb 23, 2025
dc1a602
doc: cleanup wording in SchemaRecord README
runspired Feb 23, 2025
83c1ce6
fix: Don't notify changes for attributes not registered with the sche…
gitKrystan Feb 25, 2025
cb4e391
internal: fixup diagnostic reporting (#9704)
runspired Mar 1, 2025
aac9918
chore: update to pnpm 10 (#9699)
runspired Mar 1, 2025
834a32e
chore: make diagnostic shutdown safer, use bun for holodeck server (#…
runspired Mar 4, 2025
f4e871b
fix(deps): update dependency vite to ^5.4.14 (#9666)
renovate[bot] Mar 4, 2025
76d9eca
chore(deps): update dependency globby to ^14.1.0 (#9708)
renovate[bot] Mar 4, 2025
060ad0b
chore(deps): update dependency bun-types to v1.2.4 (#9706)
renovate[bot] Mar 4, 2025
ed6388c
fix(deps): update dependency inflection to ~3.0.2 (#9664)
renovate[bot] Mar 4, 2025
c70d130
chore(deps): update dependency terser-webpack-plugin to ^5.3.12 (#9710)
renovate[bot] Mar 4, 2025
80b1ac2
chore(deps): update node.js to >= 18.20.7 (#9711)
renovate[bot] Mar 4, 2025
727caaf
fix(deps): update dependency globals to ^15.15.0 (#9715)
renovate[bot] Mar 4, 2025
893a89a
fix(deps): update dependency rollup to ^4.34.9 (#9716)
renovate[bot] Mar 4, 2025
4ea2c59
fix(deps): update dependency semver to ^7.7.1 (#9717)
renovate[bot] Mar 4, 2025
a0294b8
chore(deps): update ember-core (#9719)
renovate[bot] Mar 4, 2025
35459b9
fix(deps): update dependency debug to ^4.4.0 (#9714)
renovate[bot] Mar 4, 2025
2f762d6
fix(deps): update dependency @ember/optional-features to ^2.2.0 (#9713)
renovate[bot] Mar 4, 2025
9f41388
fix(deps): update asset-compilation (#9712)
renovate[bot] Mar 4, 2025
bd69798
chore(deps): update dependency @ember/string to v4.0.1 (#9721)
renovate[bot] Mar 4, 2025
eef0f66
chore(deps): update dependency command-line-args to v6 (#9722)
renovate[bot] Mar 4, 2025
1686b9e
chore(deps): update dependency expect-type to v1 (#9724)
renovate[bot] Mar 4, 2025
2222b67
chore(deps): update dependency ember-inflector to v5 (#9723)
renovate[bot] Mar 4, 2025
55dbced
chore(deps): update dependency mocha to v11 (#9726)
renovate[bot] Mar 4, 2025
194c709
chore(deps): update dependency rimraf to v6 (#9727)
renovate[bot] Mar 4, 2025
2638a3f
chore(deps): update oven-sh/setup-bun action to v2 (#9729)
renovate[bot] Mar 4, 2025
9e2269f
fix(deps): update dependency ember-cli to v6 (#9733)
renovate[bot] Mar 4, 2025
095178f
fix(deps): update build-tools (#9570)
renovate[bot] Mar 4, 2025
a6b8622
fix(deps): update dependency ember-load-initializers to v3 (#9736)
renovate[bot] Mar 4, 2025
65d051f
fix(deps): update dependency globals to v16 (#9737)
renovate[bot] Mar 4, 2025
a4f3ba8
Fix metric count data typo
gitKrystan Mar 4, 2025
f381240
fix(deps): update code-quality (#9571)
renovate[bot] Mar 4, 2025
cc65a28
bump version of tracerbench
runspired Mar 5, 2025
29e95f4
chore: add logging to proxy server for debugging
runspired Mar 5, 2025
780e2ea
chore: Modernize Performance App (use Vite) (#9707)
runspired Mar 5, 2025
7aa8cdd
chore: update main version of perf checks
runspired Mar 5, 2025
64c5e18
chore: fixup vite config for perf (#9744)
runspired Mar 5, 2025
f5e474e
feat: new perf scenario for complex records (#9745)
runspired Mar 6, 2025
ff35399
chore: update scenario
runspired Mar 6, 2025
8d0b992
chore: remove mixin workaround
runspired Mar 6, 2025
410f733
More dramatic update for update-with-same-state perf test (#9743)
gitKrystan Mar 6, 2025
ecc3574
chore: bump size of benchmark (#9746)
runspired Mar 6, 2025
8835a34
Actually add the m2m test case to the perf test output (#9748)
gitKrystan Mar 6, 2025
3121543
chore: update perf suite (#9749)
runspired Mar 7, 2025
499dff2
Don't overnotify for updates to added state that match local updates …
gitKrystan Mar 8, 2025
355e99d
Backport tests/main/tsconfig
gitKrystan Mar 9, 2025
acd9114
Remove unneccessary test assertions
gitKrystan Mar 10, 2025
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
Prev Previous commit
Next Next commit
chore: [BREAKING to prior alpha/betas] prepare SchemaRecord for stabl…
…e, lockdown exports (#9697)

* chore: prepare SchemaRecord for stable, lockdown exports

* cleanup imports

* fix assertion
  • Loading branch information
runspired authored and gitKrystan committed Mar 9, 2025
commit d0a034b4fb1747713cba79137b9abd92d8043236
11 changes: 5 additions & 6 deletions packages/schema-record/README.md
Original file line number Diff line number Diff line change
@@ -64,8 +64,7 @@ that instance, it will call `teardownRecord`.

```diff
import Store from '@ember-data/store';
+import { instantiateRecord, teardownRecord } from '@warp-drive/schema-record/hooks';
+import { registerDerivations, SchemaService } from '@warp-drive/schema-record/schema';
+import { instantiateRecord, teardownRecord, registerDerivations, SchemaService } from '@warp-drive/schema-record';

class AppStore extends Store {

@@ -75,11 +74,11 @@ class AppStore extends Store {
+ return schema;
+ }

+ instantiateRecord(identifier: StableRecordIdentifier, createArgs?: Record<string, unknown>): SchemaRecord {
+ instantiateRecord(identifier, createArgs) {
+ return instantiateRecord(this, identifier, createArgs);
+ }

+ teardownRecord(record: SchemaRecord): void {
+ teardownRecord(record) {
+ return teardownRecord(record);
+ }
}
@@ -230,7 +229,7 @@ in the process gaining access to an editable copy. The immutable version will
not show any in-process edits made to this editable copy.

```ts
import { Checkout } from '@warp-drive/schema-record/record';
import { Checkout } from '@warp-drive/schema-record';

const editable = await user[Checkout]();
```
@@ -242,7 +241,7 @@ conventional fields like identity and `$type`. We can rewrite the schema
definition above using this utility like so:

```ts
import { withDefaults } from '@warp-drive/schema-record/schema';
import { withDefaults } from '@warp-drive/schema-record';

store.registerSchemas([
withDefaults({
4 changes: 4 additions & 0 deletions packages/schema-record/package.json
Original file line number Diff line number Diff line change
@@ -33,6 +33,10 @@
"unstable-preview-types"
],
"exports": {
".": {
"types": "./unstable-preview-types/index.d.ts",
"default": "./dist/index.js"
},
"./*": {
"types": "./unstable-preview-types/*.d.ts",
"default": "./dist/*.js"
1 change: 1 addition & 0 deletions packages/schema-record/src/-private.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { Editable, Legacy } from './-private/symbols';
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type Store from '@ember-data/store';
import { assert } from '@warp-drive/build-config/macros';
import type { StableRecordIdentifier } from '@warp-drive/core-types';

import { SchemaRecord } from './record';
@@ -25,6 +26,11 @@ export function instantiateRecord(
return record;
}

export function teardownRecord(record: SchemaRecord): void {
function assertSchemaRecord(record: unknown): asserts record is SchemaRecord {
assert('Expected a SchemaRecord', record && typeof record === 'object' && Destroy in record);
}

export function teardownRecord(record: unknown): void {
assertSchemaRecord(record);
record[Destroy]();
}
Original file line number Diff line number Diff line change
@@ -28,7 +28,7 @@ import {
ManagedObjectMap,
peekManagedArray,
peekManagedObject,
} from './-private/compute';
} from './fields/compute';
import type { SchemaService } from './schema';
import {
ARRAY_SIGNAL,
@@ -125,6 +125,9 @@ export class SchemaRecord {
},

has(target: SchemaRecord, prop: string | number | symbol) {
if (prop === Destroy || prop === Checkout) {
return true;
}
return fields.has(prop as string);
},

File renamed without changes.
File renamed without changes.
4 changes: 4 additions & 0 deletions packages/schema-record/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
export { instantiateRecord, teardownRecord } from './-private/hooks';
export { type Transformation, SchemaService, withDefaults, fromIdentity, registerDerivations } from './-private/schema';
export { type SchemaRecord } from './-private/record';
export { Checkout } from './-private/symbols';
2 changes: 1 addition & 1 deletion packages/schema-record/vite.config.mjs
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@ import { createConfig } from '@warp-drive/internal-config/vite/config.js';

export const externals = ['@ember/debug'];

export const entryPoints = ['src/hooks.ts', 'src/record.ts', 'src/schema.ts'];
export const entryPoints = ['src/index.ts', 'src/-private.ts'];

export default createConfig(
{
4 changes: 2 additions & 2 deletions packages/store/src/-private/store-service.ts
Original file line number Diff line number Diff line change
@@ -277,7 +277,7 @@ export interface Store {
* For Example, to use the default SchemaService for SchemaRecord
*
* ```ts
* import { SchemaService } from '@warp-drive/schema-record/schema';
* import { SchemaService } from '@warp-drive/schema-record';
*
* class extends Store {
* createSchemaService() {
@@ -307,7 +307,7 @@ export interface Store {
*
* ```ts
* import { DelegatingSchemaService } from '@ember-data/model/migration-support';
* import { SchemaService } from '@warp-drive/schema-record/schema';
* import { SchemaService } from '@warp-drive/schema-record';
*
* class extends Store {
* createSchemaService() {
Original file line number Diff line number Diff line change
@@ -8,9 +8,13 @@ import type { CacheCapabilitiesManager } from '@ember-data/store/types';
import type { StableRecordIdentifier } from '@warp-drive/core-types';
import type { SingleResourceDataDocument } from '@warp-drive/core-types/spec/document';
import type { Type } from '@warp-drive/core-types/symbols';
import { instantiateRecord, teardownRecord } from '@warp-drive/schema-record/hooks';
import type { SchemaRecord } from '@warp-drive/schema-record/record';
import { registerDerivations, SchemaService, withDefaults } from '@warp-drive/schema-record/schema';
import {
instantiateRecord,
registerDerivations,
SchemaService,
teardownRecord,
withDefaults,
} from '@warp-drive/schema-record';

type User = {
id: string;
@@ -40,7 +44,7 @@ class TestStore extends Store {
return instantiateRecord(this, identifier, createRecordArgs);
}

teardownRecord(record: SchemaRecord) {
teardownRecord(record: unknown) {
teardownRecord(record);
}
}
3 changes: 1 addition & 2 deletions tests/warp-drive__schema-record/tests/edit-workflow-test.ts
Original file line number Diff line number Diff line change
@@ -6,8 +6,7 @@ import { serializePatch, serializeResources, updateRecord } from '@ember-data/js
import RequestManager from '@ember-data/request';
import { CacheHandler, recordIdentifierFor } from '@ember-data/store';
import type { Type } from '@warp-drive/core-types/symbols';
import { Checkout } from '@warp-drive/schema-record/record';
import { registerDerivations, withDefaults } from '@warp-drive/schema-record/schema';
import { Checkout, registerDerivations, withDefaults } from '@warp-drive/schema-record';

import type Store from '../app/services/store';

Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@ import { setupTest } from 'ember-qunit';

import type Store from '@ember-data/store';
import type { Type } from '@warp-drive/core-types/symbols';
import { registerDerivations, withDefaults } from '@warp-drive/schema-record/schema';
import { registerDerivations, withDefaults } from '@warp-drive/schema-record';

type User = {
id: string | null;
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@ import type Store from '@ember-data/store';
import { CacheHandler } from '@ember-data/store';
import type { RelatedCollection } from '@ember-data/store/-private';
import type { Type } from '@warp-drive/core-types/symbols';
import { registerDerivations, withDefaults } from '@warp-drive/schema-record/schema';
import { registerDerivations, withDefaults } from '@warp-drive/schema-record';

type User = {
id: string | null;