feat: convert @telegram-apps/analytics to a no-op deprecation shim#83
Open
Nikitozz13 wants to merge 2 commits into
Open
feat: convert @telegram-apps/analytics to a no-op deprecation shim#83Nikitozz13 wants to merge 2 commits into
Nikitozz13 wants to merge 2 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The Telegram Analytics backend is being sunset on 2026-06-24. This PR converts
@telegram-apps/analyticsinto a no-op deprecation shim: the public API is preserved so existing apps keep compiling and running with no behaviour change, but no data is collected and no network calls are made. A one-timeconsole.warninforms developers that the SDK is deprecated and can be safely removed. Bumps the package to1.6.5.Why
With the backend shutting down, the SDK no longer has anything to collect or send. Rather than hard-breaking consumers (throwing, or forcing an immediate removal), we ship a drop-in no-op so integrations stay green while teams migrate off the dependency on their own schedule.
What changed
src/index.tsrewritten as a no-op shim.init()resolves immediately andregisterInvoice()returns silently — both are no-ops that never throw and never touch the network. The default export{ init, registerInvoice }and the globalwindow.telegramAnalyticsare kept.app/constants/errors.@telegram-apps/sdk,@tonconnect/uiand@innerworks-me/iw-auth-sdk. The package now installs nothing transitive into consumers.http-servermoved todevDependencies(it is only used by the localservescript, never at runtime — it was previously a runtime dependency by mistake).vite-plugin-static-copyandwasm-pack.Backwards compatibility
Backwards-compatible by design — no consumer code changes required:
init(...)/registerInvoice(...)signatures and thewindow.telegramAnalyticsglobal are unchanged; consumer code type-checks and runs as before.registerInvoice()is now slightly more lenient: it no longer throws when called beforeinit().windowglobal is now also set in the ESM/CJS builds (previously only the CDN/IIFE build exposed it) — additive, nothing breaks.Testing
npm run typecheck— passes.npm run build— passes; emits the obfuscated CDN bundle (dist/) and the package builds (lib/es,lib/cjs,lib/types).package-lock.jsonentry has nodependencies).npm run serve:init/registerInvoicerun without throwing, the deprecation warning logs once, and no network requests are issued.Notes
Sunset details: https://docs.tganalytics.xyz/sunset