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

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

Open
gajus opened this issue Feb 15, 2024 · 3 comments
Open

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

gajus opened this issue Feb 15, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@gajus
Copy link

gajus commented Feb 15, 2024

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

#771 (comment)

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

  • disabling loading of device-mode destinations (looks like this would be the default with @segment/analytics-node)
  • adopting Partytown (looks like this @segment/analytics-node is better designed for this)

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
Copy link
Contributor

silesky commented Feb 20, 2024

@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:

  • we were deprecating the OG 'analytics-node', so the path of least resistance was to use a similar name (SEO, support). Overwhelmingly, people use this lib in node.
  • From the outset, we were mainly thinking about CF workers and server-environments. There are certain features that are server specific, like OAuth, and the 'batch-by-default' is a server convention. Node is still 'synonymous' with js on the server (even though that's changing, as it's got many competitors).
  • Some other companies like stripe folded support for non-node runtimes into their node SDK, so I didn't feel like it was totally off-base.

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
Copy link
Author

gajus commented Feb 20, 2024

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
Copy link
Author

gajus commented Feb 20, 2024

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.

@silesky silesky added the enhancement New feature or request label Mar 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants