Conversation
🦋 Changeset detectedLatest commit: 27ca0dd The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
oscb
left a comment
There was a problem hiding this comment.
just a very minor comment, every thing else looks good!
|
|
||
| await this.action[methodName]!(transformedContext) | ||
| try { | ||
| ctx.stats.increment('analytics_js.action_plugin.invoke', 1, [ |
There was a problem hiding this comment.
This will let us easily aggregate these on datadog??? Sweet
|
|
||
| await this.action[methodName]!(transformedContext) | ||
| } catch (error) { | ||
| ctx.stats.increment('analytics_js.action_plugin.invoke.error', 1, [ |
There was a problem hiding this comment.
We are repeating these strings / args . Can we save on bundle size through helper functions? Ditto elsewhere
There was a problem hiding this comment.
gzip is extremely good at handling repeating strings, I've verified it - sometimes placing the strings inline yields a smaller size than storing it in a variable.
There was a problem hiding this comment.
Even so, I still think DRY would be an improvement here for the usual reasons (eg less code/ease of update)?
There was a problem hiding this comment.
It's like this all across the codebase, we should refactor them all at once so that the declaration and usage is standardized all across, and not fragment it even further.
There was a problem hiding this comment.
I see the benefit of storing in a variable more that we have 1 place to update/less chance of a typo/forgetting to update the value if we change it in the future. Won't block, but that would be my general guidance when we've got a string value that acts as a key in downstream.
| @@ -0,0 +1,5 @@ | |||
| --- | |||
| '@segment/analytics-next': minor | |||
There was a problem hiding this comment.
Should this be a patch, since it's not a user-facing feature?
There was a problem hiding this comment.
I saw it more as a "non-breaking enhancement" than a bug fix - so went with it
There was a problem hiding this comment.
Would vote for patch since it isn't a user-facing change to any API/API behavior.
Just like how we capture metrics relating to performance of classic integrations, this patch now enables capturing of metrics related to action destinations as well.