Comments (6)
Typescript support is incredibly minimal. It would be really nice if we had types for things that are already well documented. Like traits and context for starters.
Is there a reason why the types are not included in the library by default? This has become commonplace for most modern libraries and even benefits Javascript code bases since most IDEs will still use type information for context tips/autocomplete. When the types and js code are in separate libraries it adds the hassle of ensuring that the type library version is for the same version of code in the Javascript library.
We're trying out Segment and having to switch clients from Amplitude to Segment and the developer experience in this space is much better from Amplitude.
from analytics-node.
@agyimr @yujidude @Jackman3005
Types are still a WIP (I am currently working on improving our current Context and Traits type FYI, see this PR), but if you or anyone in this issue is interested, I'd like to invite you guys to try out the analytics.js typescript SDK (BETA), written 100% in typescript. If you use the new SDK and have feedback, please leave it in the analytics-next repo, rather than this one.
from analytics-node.
The TypeScript definition in the DefinitelyTyped project is either currently (or originally) for analytics-node 3.1 which may have resulted in some of your issues @agyimr. Given that the project is already following JSDoc for documentation it might make sense to generate .d.ts files directly to avoid maintaining multiple sets of documentation.
More information on generation can be found here: https://www.typescriptlang.org/docs/handbook/declaration-files/dts-from-js.html
from analytics-node.
Hi @agyimr thanks for your report, we start looking into this
from analytics-node.
@silesky thanks for getting back to us. Will take a look at the PR and the new TS library.
Is the new library where most of the energy is going for Segment? I've noticed some other issues getting lackluster response in this repo, hopefully the next iteration brings nice improvements.
Cheers,
Jack
from analytics-node.
@Jackman3005 Correct. As far as I'm aware, no new features are going to be added to this library (barring security vulnerabilities, etc), and it will be deprecated as soon as the new library goes into GA.
There are already significant improvements to the lib in the new SDK (mainly, graceful shutdown and the fixing of long-standing bugs), and, while it hasn't had an official release, I would recommend using our beta over this library today.
I am sorry you had to deal with poor responsiveness in this repo -- for historical reasons, this library was not build or managed 'in-house'. I think you'll find much better responsiveness once all activity / issues are confined to the analytics-next
monorepo, as our full-time team is generally quite quick when it comes to triaging issues, especially when it comes to critical behavior.
from analytics-node.
Related Issues (20)
- Bad Request (400) when batching HOT 1
- Flush on first message should be explicit configurable HOT 1
- analytics-node might cause an unhandledRejection HOT 13
- Should we switch to the `@segmentio/analytics-next` package? HOT 2
- Unhandled Promise Rejection Can Crash App HOT 10
- What does calling identify on the server actually do? HOT 5
- Areas for Performance Improvements
- Chrome extension background service worker + analytics-node = fail HOT 1
- Resolve vulnerability axios 0.21.4 HOT 2
- Including sentAt in the event payload of /v1/batch request makes specified timestamp ignored
- Not all sent 'track' events receive to the debugger tab of the source HOT 4
- Npm version update for Axios Version update HOT 1
- Support for other backend JS runtimes (Web Workers, Deno) HOT 6
- Support middleware functions HOT 8
- Cross-Domain Misconfiguration HOT 6
- `Analytics` intialization doesn't catch invalid/non-existent write key HOT 2
- Update axios to `1.6.0` to make it possible to get a security fix HOT 2
- Track call fails when property has bigint attribute
- context.device.token ignored HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from analytics-node.