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

using community components via npm? #6

Open
jsierles opened this issue Apr 24, 2015 · 3 comments
Open

using community components via npm? #6

jsierles opened this issue Apr 24, 2015 · 3 comments

Comments

@jsierles
Copy link

I know one target of this project is to avoid npm, but there's a huge growing list of useful components. Would it be possible to use npm to at least pull these in for use until they are also supported by cocoapods?

An alternative would be finding a way to require symlinked copies of components. Maybe I'm missing something - is there an easy way to require a js file from Opal?

@zetachang
Copy link
Owner

Actually you can put whatever js file downloaded in the manifest file https://github.com/zetachang/opal-native/blob/master/app/bundle.js, and sprockets will package them. But since sprockets don't know about module system of JS, webpack or browserify maybe useful when integrating other JS libraries.

As far as I know, there is currently no easy way to require a js file from Opal. And I am still looking for better solution too. 😉

@jsierles
Copy link
Author

I saw node's require was added, maybe it will help. I'll try afew things this week.

https://github.com/opal/opal/blob/5fca5b1c7c2b6c6e657507decb79a44ee501c044/stdlib/nodejs/kernel.rb

@zetachang
Copy link
Owner

I am working https://github.com/zetachang/opalrb-loader, which let you integrate opal to webpack rather than current Sprockets setup.

The good part is that webpack know how to resolve require statement in the JS.

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

2 participants