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

Publish to NPM #18

Open
akinnee-gl opened this issue Jun 6, 2016 · 13 comments
Open

Publish to NPM #18

akinnee-gl opened this issue Jun 6, 2016 · 13 comments

Comments

@akinnee-gl
Copy link

It would be awesome if this were published to NPM!

@mstefaniuk
Copy link
Owner

It is published in Bower. Could you convince me to publish to NPM in addition?

@akinnee-gl
Copy link
Author

akinnee-gl commented Jun 6, 2016

I had to do a lot of extra work to get it working in Browserify or Webpack. Lots of developers use those tools. Also, NPM is the largest module repository.

@mstefaniuk
Copy link
Owner

mstefaniuk commented Jun 7, 2016

It looks not so complicated. Now dependencies of the component are managed by Bower and they are:

  "dependencies": {
    "requirejs": "2.1.15",
    "d3": "3.5.3",
    "requirejs-web-workers": "~1.0.1",
    "viz.js": "~1.3.0"
  }

Should I put these in package.json? As I checked there is no require.js worker plugin so some changes may be needed.

@akinnee-gl
Copy link
Author

Installing those via npm should work. I also had to use a worker loader to make it work in webpack instead of the requirejs loader you have in your repo. https://www.npmjs.com/package/worker-loader

@mstefaniuk
Copy link
Owner

Could you create a pull request for that?

@akinnee-gl
Copy link
Author

Worker-loader is something the developer would add to their build process. Would you like me to add that to the documentation?

@mstefaniuk
Copy link
Owner

My component uses worker plugin to load parsing and rendering WebWorker. Do you suggest to replace one plugin with another by component end developer?

@akinnee-gl
Copy link
Author

Yes. You are using the requirejs web worker plugin. Webpack and Browserify have a similar module called worker-loader.

Here is a list of the changes I had to make to get this module working with Webpack:

  • change all require statements to relative paths
  • install dependencies via npm: d3, viz.js, worker-loader

After these changes, no dependency paths need to be added to a config file.

@mstefaniuk
Copy link
Owner

Do it, please. Current build and test process relies on Bower so take it also into account.

@quiasmo
Copy link

quiasmo commented Jun 19, 2016

Hey, an NPM package to use with webpack sounds good to me too. @akinnee-gl Is there anything you need besides encouragmenent to get that pull request? Perhaps you could share your branch?

@akinnee-gl
Copy link
Author

Actually, because this doesn't support all of the functionality of Viz.js, I ended up just using Viz.js directly.

@tedwong
Copy link

tedwong commented Oct 25, 2016

@akinnee-gl Would you kindly share your webpack.config.js? I have a hand time on deploy it using webpack. Thanks.

@akinnee-gl
Copy link
Author

Personally I would recommend you just use Viz.js. It's less complicated and it's already on npm. If you really need to animate your svg, you can still do that using D3 separately.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants