segmentio / analytics-next

Segment Analytics.js 2.0
https://segment.com/docs/connections/sources/catalog/libraries/website/javascript
MIT License
385 stars 128 forks source link

Rename @segment/analytics-node to @segment/analytics-javascript #1039

Open gajus opened 4 months ago

gajus commented 4 months ago

Based on @silesky 's comments in this thread, looks like @segment/analytics-node is perfectly fine to be used in browser.

https://github.com/segmentio/analytics-next/issues/771#issuecomment-1386987317

We want to minimize tracking impact on our website and we are considering several things:

We will try to replace @segment/analytics-next with @segment/analytics-node for these reasons, but I wanted to flag that the current package name is causing confusion as we are adding this to React application.

silesky commented 4 months ago

@gajus Thanks for your comment. This is good feedback and a good future data point, and is actually something we thought about. I totally understand the ugliness. (FTR also considered analytics-fetch). Ultimately, here is what drove us to retain the node label was practical considerations:

Ultimately, this is something that we're still open to. I've even mulled the idea of retaining analytics-node and adding another library like 'analytics-javascript' (like a base library) or 'analytics-web-worker' (maybe just a thin wrapper around analytics node).

gajus commented 4 months ago

I've even mulled the idea of retaining analytics-node and adding another library like 'analytics-javascript' (like a base library) or 'analytics-web-worker' (maybe just a thin wrapper around analytics node).

This would be the preferred option overall. However, also the biggest overhead. So just being respectful of the effort when composing my suggestions/asks.

gajus commented 4 months ago

Also used this post as sort of sanity validation to ensure that we are not way off-course by adopting this in browser. Seems like not the case.