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

Add @ember-data/legacy-compat/builders #9319

Merged
merged 18 commits into from
Apr 9, 2024
Merged

Conversation

gitKrystan
Copy link
Contributor

@gitKrystan gitKrystan commented Apr 4, 2024

Description

Adds @ember-data/legacy-compat/builders module with builders for migrating from store methods to store.request.

These builders enable you to migrate your codebase to using the correct syntax for store.request while temporarily preserving legacy behaviors. This is useful for quickly upgrading an entire app to a unified syntax while a longer incremental migration is made to shift off of adapters and serializers.

  • findRecord
  • query
  • queryRecord
  • findAll
  • saveRecord

Notes for the release

@gitKrystan gitKrystan added 🎯 canary PR is targeting canary (default) 🏷️ feat This PR introduces a new feature labels Apr 4, 2024
@gitKrystan gitKrystan changed the title legacy compat builders Add @ember-data/legacy-compat/builders Apr 5, 2024
@gitKrystan gitKrystan force-pushed the legacy-compat-builders branch 2 times, most recently from a3b8892 to 73fdf43 Compare April 8, 2024 18:04
Copy link
Contributor

@runspired runspired left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good, cleanup on doc tag ordering and pass through of generics would be good though

@runspired runspired merged commit 286f5bc into main Apr 9, 2024
19 checks passed
@runspired runspired deleted the legacy-compat-builders branch April 9, 2024 08:25
@@ -222,8 +222,8 @@ module('Integration - legacy-compat/builders/saveRecord', function (hooks) {
const { content: savedPost } = await store.request<Post>(saveRecord(existingPost));

assert.strictEqual(savedPost.id, '1', 'post has correct id');
assert.strictEqual(savedPost.name, 'Krystan rules, you drool', 'post has correct name');
assert.true(savedPost.isDeleted, 'post isDeleted');
assert.strictEqual(savedPost.name, 'Chris drools, Krystan rules', 'post has correct name');
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🎯 canary PR is targeting canary (default) 🏷️ feat This PR introduces a new feature
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

3 participants