Skip to content

Commit

Permalink
feat: add legacy sdk deprecation warnings (#2038)
Browse files Browse the repository at this point in the history
* feat: add legacy sdk deprecation warnings

* chore: bump size limits
  • Loading branch information
saikumarrs authored Feb 12, 2025
1 parent d7df880 commit 2be4b83
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 14 deletions.
2 changes: 1 addition & 1 deletion packages/analytics-v1.1/.size-limit.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ module.exports = [
name: 'Core (Content Script - v1.1) - NPM (UMD)',
path: 'dist/npm/content-script/index.js',
import: '*',
limit: '30 KiB',
limit: '30.5 KiB',
},
{
name: 'Core (v1.1) - Legacy - CDN',
Expand Down
22 changes: 9 additions & 13 deletions packages/analytics-v1.1/src/core/analytics.js
Original file line number Diff line number Diff line change
Expand Up @@ -1658,19 +1658,15 @@ const startSession = instance.startSession.bind(instance);
const endSession = instance.endSession.bind(instance);
const setAuthToken = instance.setAuthToken.bind(instance);

// TODO: Need to remove this in the next release
// eslint-disable-next-line sonarjs/no-gratuitous-expressions, no-constant-condition
if (false) {
// eslint-disable-next-line no-constant-condition
if ('__MODULE_TYPE__' === 'npm') {
logger.error(
'This RudderStack JavaScript SDK package is deprecated and no longer maintained. While your events are still being tracked and delivered, we strongly recommend you to migrate to the latest [@rudderstack/analytics-js](https://www.npmjs.com/package/@rudderstack/analytics-js) package for enhanced features, security updates, and ongoing support. For more details, visit the migration guide: https://www.rudderstack.com/docs/sources/event-streams/sdks/rudderstack-javascript-sdk/migration-guide/.',
);
} else {
logger.error(
'This version of the RudderStack JavaScript SDK is deprecated and no longer maintained. While your events are still being tracked and delivered, we strongly recommend you to migrate to the latest version (v3) for enhanced features, security updates, and ongoing support. For more details, visit the migration guide: https://www.rudderstack.com/docs/sources/event-streams/sdks/rudderstack-javascript-sdk/migration-guide/.',
);
}
// eslint-disable-next-line no-constant-condition
if ('__MODULE_TYPE__' === 'npm') {
logger.warn(
'This RudderStack JavaScript SDK package is deprecated and no longer maintained. While your events are still being tracked and delivered, we strongly recommend you to migrate to the latest [@rudderstack/analytics-js](https://www.npmjs.com/package/@rudderstack/analytics-js) package for enhanced features, security updates, and ongoing support. For more details, visit the migration guide: https://www.rudderstack.com/docs/sources/event-streams/sdks/rudderstack-javascript-sdk/migration-guide/.',
);
} else {
logger.warn(
'This version of the RudderStack JavaScript SDK is deprecated and no longer maintained. While your events are still being tracked and delivered, we strongly recommend you to migrate to the latest version (v3) for enhanced features, security updates, and ongoing support. For more details, visit the migration guide: https://www.rudderstack.com/docs/sources/event-streams/sdks/rudderstack-javascript-sdk/migration-guide/.',
);
}

export {
Expand Down

0 comments on commit 2be4b83

Please sign in to comment.