From 46c3402f9b9992297e2fdf47ee19106046b40d3b Mon Sep 17 00:00:00 2001 From: Igor Kamyshev Date: Tue, 16 Apr 2024 12:13:32 +0700 Subject: [PATCH] Runtime deprecation warning in `attachOperation` --- .changeset/plenty-suns-leave.md | 5 +++++ .changeset/pretty-mails-switch.md | 5 +++++ apps/website/docs/releases/0-13.md | 4 +++- packages/core/src/attach/attach.ts | 4 ++++ 4 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 .changeset/plenty-suns-leave.md create mode 100644 .changeset/pretty-mails-switch.md diff --git a/.changeset/plenty-suns-leave.md b/.changeset/plenty-suns-leave.md new file mode 100644 index 00000000..2f0d3d5c --- /dev/null +++ b/.changeset/plenty-suns-leave.md @@ -0,0 +1,5 @@ +--- +"@farfetched/core": minor +--- + +Runtime deprecation warning in `attachOperation` diff --git a/.changeset/pretty-mails-switch.md b/.changeset/pretty-mails-switch.md new file mode 100644 index 00000000..2f0d3d5c --- /dev/null +++ b/.changeset/pretty-mails-switch.md @@ -0,0 +1,5 @@ +--- +"@farfetched/core": minor +--- + +Runtime deprecation warning in `attachOperation` diff --git a/apps/website/docs/releases/0-13.md b/apps/website/docs/releases/0-13.md index 08606615..e10f8854 100644 --- a/apps/website/docs/releases/0-13.md +++ b/apps/website/docs/releases/0-13.md @@ -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. diff --git a/packages/core/src/attach/attach.ts b/packages/core/src/attach/attach.ts index 9877abc8..09120638 100644 --- a/packages/core/src/attach/attach.ts +++ b/packages/core/src/attach/attach.ts @@ -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({