Skip to content

feat: convert @telegram-apps/analytics to a no-op deprecation shim#83

Open
Nikitozz13 wants to merge 2 commits into
masterfrom
feature/deprecate-analytics-noop
Open

feat: convert @telegram-apps/analytics to a no-op deprecation shim#83
Nikitozz13 wants to merge 2 commits into
masterfrom
feature/deprecate-analytics-noop

Conversation

@Nikitozz13

Copy link
Copy Markdown

Summary

The Telegram Analytics backend is being sunset on 2026-06-24. This PR converts @telegram-apps/analytics into 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-time console.warn informs developers that the SDK is deprecated and can be safely removed. Bumps the package to 1.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.ts rewritten as a no-op shim. init() resolves immediately and registerInvoice() returns silently — both are no-ops that never throw and never touch the network. The default export { init, registerInvoice } and the global window.telegramAnalytics are kept.
  • Removed all collection logic: controllers, observers, services, repositories, validators, compress/UUID utils, and app/constants/errors.
  • Zero runtime dependencies: dropped @telegram-apps/sdk, @tonconnect/ui and @innerworks-me/iw-auth-sdk. The package now installs nothing transitive into consumers.
  • http-server moved to devDependencies (it is only used by the local serve script, never at runtime — it was previously a runtime dependency by mistake).
  • Removed two unused build-only devDependencies: vite-plugin-static-copy and wasm-pack.

Backwards compatibility

Backwards-compatible by design — no consumer code changes required:

  • init(...) / registerInvoice(...) signatures and the window.telegramAnalytics global are unchanged; consumer code type-checks and runs as before.
  • registerInvoice() is now slightly more lenient: it no longer throws when called before init().
  • The window global 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).
  • Verified in a sample React app that installing the tarball pulls zero extra dependencies (package-lock.json entry has no dependencies).
  • No-op behaviour confirmed via npm run serve: init/registerInvoice run without throwing, the deprecation warning logs once, and no network requests are issued.

Notes

Sunset details: https://docs.tganalytics.xyz/sunset

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant