Skip to content

Commit

Permalink
Runtime deprecation warning in attachOperation
Browse files Browse the repository at this point in the history
  • Loading branch information
igorkamyshev committed Apr 16, 2024
1 parent 323cb83 commit 46c3402
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/plenty-suns-leave.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@farfetched/core": minor
---

Runtime deprecation warning in `attachOperation`
5 changes: 5 additions & 0 deletions .changeset/pretty-mails-switch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@farfetched/core": minor
---

Runtime deprecation warning in `attachOperation`
4 changes: 3 additions & 1 deletion apps/website/docs/releases/0-13.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ TODO:

## Migration guide

TODO:
### `attachOperation` operator

This operator is deprecated since [v0.12](/releases/0-12) and will be removed in v0.14. Please read [this ADR](/adr/attach_operation_deprecation) for more information and migration guide.

<!--@include: ./0-13.changelog.md-->
4 changes: 4 additions & 0 deletions packages/core/src/attach/attach.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,10 @@ export function attachOperation<
mapParams?: (params: NewParams, source?: any) => OriginalParams;
}
) {
console.error(
'attachOperation is deprecated since 0.12, please read the migration guide: https://farfetched.pages.dev/adr/attach_operation_deprecation.html'
);

const { source, mapParams } = config ?? {};

return operation.__.experimentalAPI?.attach({
Expand Down

0 comments on commit 46c3402

Please sign in to comment.