Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not make plugin.version mandatory #1128

Merged
merged 5 commits into from
Sep 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .changeset/ninety-fireants-explain.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@segment/analytics-core': minor
'@segment/analytics-next': minor
'@segment/analytics-node': minor
---

Do not make plugin.version required
12 changes: 11 additions & 1 deletion packages/core/src/plugins/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,18 @@ export interface CorePlugin<
Analytics extends CoreAnalytics = any
> {
name: string

/**
* A concatenation of the current destination name and the specific action. This field is only relevant for destination plugins.
* @example ['Braze Web Mode (Actions) updateUserProfile'] // (and the plugin name would be 'Braze Web Mode (Actions)')
*/
// This is only used for disabling action plugins. An action destination plugin name used to be the concatenation of the current destination name, and the specific action (like 'Braze Web Mode (Actions) updateUserProfile'. Which meant customers had to set that individual action to false to disable it before. Then with the destination filter route, we created a new wrapper around actions to make it easy to disable based on the creationName, which is when we added creationName to the objects in remotePlugin. However, to preserve backwards compatibility, we still needed to support disabling based on the concatenation since customers were doing that in the wild, so we can filter based on checking both name fields.
alternativeNames?: string[]
version: string
/**
* The version of the plugin.
* @example '1.0.0'
*/
version?: string
type: PluginType
isLoaded: () => boolean
load: (ctx: Ctx, instance: Analytics) => Promise<unknown>
Expand Down
Loading