Skip to content

Commit

Permalink
feat: add legacy sdk deprecation warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
saikumarrs committed Feb 11, 2025
1 parent d7df880 commit 2d1f9be
Showing 1 changed file with 9 additions and 13 deletions.
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(

Check warning on line 1663 in packages/analytics-v1.1/src/core/analytics.js

View check run for this annotation

Codecov / codecov/patch

packages/analytics-v1.1/src/core/analytics.js#L1663

Added line #L1663 was not covered by tests
'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(

Check warning on line 1667 in packages/analytics-v1.1/src/core/analytics.js

View check run for this annotation

Codecov / codecov/patch

packages/analytics-v1.1/src/core/analytics.js#L1667

Added line #L1667 was not covered by tests
'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 2d1f9be

Please sign in to comment.