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

require in npm modules/packages not checking node_module folder #167

Closed
emmanuelbuah opened this issue May 15, 2015 · 18 comments
Closed

require in npm modules/packages not checking node_module folder #167

emmanuelbuah opened this issue May 15, 2015 · 18 comments

Comments

@emmanuelbuah
Copy link

@valentinstoychev Per comments at #103, I started work on integrating meteor and nativescript via npm modules. I run into an issue where require(..) doesn't check the node_modules folder relative to the calling script (similar to node), but rather only checks tns_module.

It this a bug?

@ligaz
Copy link
Contributor

ligaz commented May 15, 2015

Hey @emmanuelbuah we are already working on this. You can check our progress here

@valentinstoychev
Copy link

@emmanuelbuah as @ligaz said - npm out of the box will be available soon - initial support in June. You can require the JS files manually. Please check this blog post. Please let us know if you need help.

@emmanuelbuah
Copy link
Author

@ligaz @valentinstoychev Thanks for the update. I have about 3 dependency level deep (x requires y, y which requires z,..). I will try to resolve the issue by modifying each to reference the js file. If it proves to be unproductive, I will wait for the initial support and go from there. Thanks for the update.

@emmanuelbuah
Copy link
Author

@ligaz @valentinstoychev Failed to communicate this. Meteor integration requires websocket which JSCore (iOS) doesn't support. I don't know if there is current a socket nativescript implementation/polyfill. If not, would I be right to create a module than exposes https://github.com/socketio/socket.io-client-swift for iOS socket support, similar to native-script implementation here https://github.com/kirkness/react-native-swift-socketio

@RangerMauve
Copy link

@emmanuelbuah I've also been thinking of doing a Websocket polyfill for NativeScript, but I was going to do Android first. As well I've been waiting for the NPM integration to get finalized before getting too much into it.

@emmanuelbuah
Copy link
Author

@RangerMauve if the websocket implementation is just a wrapper to the os (android) socket implementation, you should be able to create a tns modules (in the tns_module folder) to provide the nativescript js api. Same here, with the socket io client, i should be able to create a tns_module and have it work.

In general, I think we should be able to expose ios/android websocket api via a tns websocket modules without having to wait till June. If you are interested, we can collaborate on a nativescript websocket module project with the follow struct in mind

tsn_modules/
 |--socket/
 |   |--- socket.ios.js (implement ios specific wrapper for socket)
 |   |--- socket.android.js (implement android specific wrapper for socket)
 |   |---  socket.common.js (define nativescript socket api/protocals + helper func)
 |   |--- package.json 

@RangerMauve
Copy link

@emmanuelbuah I'd definately be interested. My only real caveat is that I was planning to rely on the java-websocket library for the websocket implementation, and I'm not 100% sure how I would be integrating the dependency with everything else.

@ligaz
Copy link
Contributor

ligaz commented May 15, 2015

It will be great if we can collaborate on a WebSocket implementation for NativeScript. I have provided a guidance how this can be implemented for Android in this issue.

For iOS there is well known library that we can reuse as well SocketRocket. @fealebenpae what do you think?

@fealebenpae
Copy link
Contributor

SocketRocket is a good choice, although I'd go with PocketSocket myself.

Ideally I'd like to see if some of the WebSocket code within WebKit can be reused in order to have a true W3C-conforming WebSocket implementation, but we have a long ways to go before we can comfortably reuse WebKit code in NativeScript. I suppose a custom WebSocket API is a good first step, though.

@RangerMauve
Copy link

Well, that's the main reason that I was interested in java-websocket.. It's API is very similar to what exists in Browsers, so doing a NativeScript wrapper would be very simple.

@NathanaelA

This comment was marked as abuse.

@emmanuelbuah
Copy link
Author

Cool. Do you need any help? More implementation details will be great.

On Thu, Jul 23, 2015, 4:07 PM Nathanael Anderson notifications@github.com
wrote:

At least on WebSockets -- I have the Android side done; I'm currently
working on the IOS side... Hopefully released in a couple days. [image:
😀]


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

@valentinstoychev
Copy link

@NathanaelA - this is great! Now we should try to run Firebase JS SDK on top of NativeScript. This was one of the showstoppers.

BTW: Make sure to work with @kiril-stanoev, he can help you get maximum visibility by including these on http://plugins.telerik.com. We will launch it soon for {N}.

@NathanaelA

This comment was marked as abuse.

@kshitizrimal
Copy link

Hi @NathanaelA I am just starting to use nativescript and I am from Meteor Background.. After reading the thread.. I feel very optimistic and I am anxiously waiting to use it on my project.. Thanx :)

@NathanaelA

This comment was marked as abuse.

@NathanaelA

This comment was marked as abuse.

@enchev enchev closed this as completed Oct 5, 2015
@lock
Copy link

lock bot commented Aug 30, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked and limited conversation to collaborators Aug 30, 2019
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

8 participants