Skip to content

Commit

Permalink
PKG -- [sdk] Change getEvents deprecation notice to use @onflow/util-…
Browse files Browse the repository at this point in the history
…logger instead of console.warn
  • Loading branch information
jribbink authored May 26, 2022
1 parent 25bf824 commit 1654ebb
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 13 deletions.
5 changes: 5 additions & 0 deletions .changeset/smart-toys-joke.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@onflow/sdk": patch
---

Make deprecation notice for getEvents use @onflow/util-logger instead of console.warn
20 changes: 7 additions & 13 deletions packages/sdk/src/build/build-get-events.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,14 @@
import {pipe, Ok, makeGetEvents} from "../interaction/interaction.js"
import * as logger from "@onflow/util-logger"

export function getEvents(eventType, start, end) {

if (typeof start !== "undefined" || typeof end !== "undefined") {
console.warn(
`
%cFCL/SDK Deprecation Notice
============================
Passing a start and end into getEnvents has been deprecated and will not be supported in future versions of the Flow JS-SDK/FCL.
You can learn more (including a guide on common transition paths) here: https://github.com/onflow/flow-js-sdk/blob/master/packages/sdk/TRANSITIONS.md#0005-deprecate-start-end-get-events-builder
============================
`,
"font-weight:bold;font-family:monospace;"
)
logger.log({
title: "FCL/SDK Deprecation Notice",
message: `Passing a start and end into getEnvents has been deprecated and will not be supported in future versions of the Flow JS-SDK/FCL.
You can learn more (including a guide on common transition paths) here: https://github.com/onflow/flow-js-sdk/blob/master/packages/sdk/TRANSITIONS.md#0005-deprecate-start-end-get-events-builder`,
level: logger.LEVELS.warn,
})
}

return pipe([
Expand Down

0 comments on commit 1654ebb

Please sign in to comment.