-
Notifications
You must be signed in to change notification settings - Fork 22
Install as a NPM module #24
Comments
@henrikbjorn Right now our Analytics.js will load each client side JS library (if a given integration has one) at the time of a.js's initialization so I'm not sure this is something we'll do? |
@henrikbjorn Our hosted version is the recommended way to use Segment, I'd recommend using your own fork hosted on NPM if the hosted version doesn't work for you. |
I am running into the same problem as @henrikbjorn – I too want to avoid using the hosted version in favor of the npm package. @f2prateek Do I really have to fork the library just to add the (otherwise mandatory) version to package.json to get the package install? Does not sound sensible to me at all and creates maintenance overhead – it kind of defeats the purpose of using Segment altogether. Please consider making the package installable using the standard npm method. Thanks Peter |
unfortunately b/w the 100+ analytics.js integrations (and some of which are being maintained by partners) we don't have the resources to publish all of them (outside of providing the segment hosted version). I'm not as familiar with the fronted packaging ecosystem, so I'll let @ndhoule and @sperand-io chime in to confirm what our plan of action will be. |
This issue has not much to do with webpack - the issue is that the package.json file does not validate: http://package-json-validator.com/ The below PR has a fix for the missing "version" field – and the missing dependencies which are another issue (though these aren't critical). Without having installable npm packages projects using webpack/browserify/etc won't be able to use your modules and using the hosted library is not an option for many. |
@peterzen could you explain why using the hosted version is not an option? I think that the hosted version should be easier to use, because instead of having to updated the version every time one of your integrations is updated, our hosted version can pull in the latest snippet of that integration without you needing to redeploy your app for updates. |
@f2prateek Performance considerations – I have many external libraries which I want to bundle into one single build, instead of loading them on demand from many third party services that I don't control the uptime of. |
@peterzen That sounds reasonable, but I'm not sure if using Segment integrations via a npm module helps with that. Most of our integrations are using dynamically loaded scripts. e.g. Just in the Google Analytics integrations, these are all the dynamically loaded scripts https://github.com/segment-integrations/analytics.js-integration-google-analytics/blob/master/lib/index.js#L58-L61 that might get updated/or be down at any time. |
@peterzen I just occupied the repo https://www.npmjs.com/package/analytics.js-integration-google-analytics in case. As you've already found that, the package.json has problems and so does the deps. I'm working on a migration because I want it too. Any help official/non-official is welcomed. And a bite-you I met yesterday. npm does not accept publish of the same version. I just published 1.4.3, and then found it did not work. After fixing the bug, I could not publish a 1.4.3 again. That means accidents will make the npm version not match the official version. |
Hi @henrikbjorn, as part of the monorepo migration, this issue has been moved to new issue. Our engineers have been notified and will prioritize and work on it ASAP. Thank you! For more information, see README.md. |
Hey. We are using Webpack to bundle our JS files in our React project. For that reason i am using analytics.js directly from npm, and would like to install each integration from npm as well.
So would you mind publishing the integrations to npm?
The text was updated successfully, but these errors were encountered: