Skip to content
This repository has been archived by the owner on Mar 27, 2019. It is now read-only.

Can I use non-component based libraries? #624

Open
shobhitg opened this issue Feb 13, 2015 · 4 comments
Open

Can I use non-component based libraries? #624

shobhitg opened this issue Feb 13, 2015 · 4 comments

Comments

@shobhitg
Copy link

This is super basic question.

I am new to component and trying to use dc-js/dc.js.

From what I understand is that it isn't registered in the component's registry.
What would it take for me to be able to use it as a component.

Would you guys recommend to use it directly from CDN locations?
http://cdnjs.cloudflare.com/ajax/libs/dc/1.7.0/dc.js
http://cdnjs.cloudflare.com/ajax/libs/dc/1.7.0/dc.css

Or what steps should one take to make this library registered into component's registry?

Thanks for help.

@timaschew
Copy link
Member

there is no real component registry, all the components are just on github.
the important thing is that the repository needs to include a component.json file.
If your project you're looking for has no component.json you can fork it and add the file (and send a pull request)

@shobhitg
Copy link
Author

Thanks a lot for explaining.

I forked and added component.json file.

Can you please glance and see if it looks right before I make a pull request: https://github.com/shobhitg/dc.js/blob/develop/component.json

Also I have a question, is there a way I can tell component to use "dc.js" for development mode and "dc.min.js" for production mode?

@timaschew
Copy link
Member

You can test it just by run
component install shobhitg/dc.js
Am 14.02.2015 01:05 schrieb "Shobhit Gupta" notifications@github.com:

Thanks a lot for explaining.

I forked and added component.json file.

Can you please glance and see if it looks right before I make a pull
request: https://github.com/shobhitg/dc.js/blob/develop/component.json

Also I have a question, is there a way I can tell component to use "dc.js"
for development mode and "dc.min.js" for production mode?


Reply to this email directly or view it on GitHub
#624 (comment)
.

@timaschew
Copy link
Member

Also I have a question, is there a way I can tell component to use "dc.js" for development mode and "dc.min.js" for production mode?

component have two main features:

  • package manager (component-install)
  • build tool (component-build)

If you define dependencies via the copmonent.json you using it as a package manager. In this scope you should never provide minified files.

To distinguish between your enviroments: dev and prod you can use component as a build tool. In you process flow this step is after the part of managing the dependencies.

Component has no built-in minify features if you using it via the CLI (,yet)
If you're using component via the API resolver and build(er) you can use this one for instance: https://github.com/ianstormtaylor/minify

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

No branches or pull requests

2 participants