-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Devtools for swift applications #288
Comments
Hi and thanks for the interest! Sure, AFAIK, there are integrations already with F#, Python, and Closure. So it's more than possible. You just have to send data via sockets to I've posted a draft of the API you can follow. Basically, you need a client for socketcluster. You could adapt the one for Objective-C. Or write a similar one for Swift, which would be much appreciated by the community. Let me know if you need any further information. |
So basically I'd have
The app sends messages to the browser using sockets and the remote/local dev-server is used to a the "master server" for the socket connection. Is it correct? |
Exactly. It can interact with Redux Extension or with other monitor apps listed here. All of them (including this extension) have The bridge server ( |
Amazing, I'll take a look as soon as I have some free time :) |
I'm trying to implement this in Objc (I'm using that library for now..) socket.emit('login', 'master', (error, channelName) => {
if (error) { console.log(error); return; }
channel = socket.subscribe(channelName);
channel.watch(handleMessages);
socket.on(channelName, handleMessages);
}); self.client = SCSocket.client()
self.client.initWithHost("localhost", onPort: 8000, securely: false)
self.client.delegate = self
self.client.connect()
let message = SCMessage.init(eventName: "login", andData: "master".data(using: .utf8))
message.send(success: {
print($0)
}, withFail: {
print($0)
}) I've the remove-dev server running in my console Test|⇒ node index.js
[RemoteDev] Start server...
--------------------------------------------------------------------------------
[Busy] Launching SocketCluster
[Active] SocketCluster started
Version: 5.2.1
Environment: dev
WebSocket engine: uws
Port: 8000
Master PID: 82596
Worker count: 1
Broker count: 1
[Done] Migrations are finished But nothing happens.. I've also http://remotedev.io/local/ in a tab in my chrome |
As far as I see, you didn't send anything to the monitor yet. Whether you use http://remotedev.io/local/ or other app, you should click on Here's a simple snippet from NodeJS I've tried recently: zalmoxisus/remotedev-server#34 (comment). Unfortunately, I don't know much about ObjectiveC. |
I guess we need more advanced logs for |
Uhm yes, that would be useful. |
Yes, right. You should get the channel name as a response. |
It seems that the problem is the connection
prints true (it is evaluated a couple of seconds after It is so weird |
So, you get that error even with just self.client = SCSocket.client()
self.client.initWithHost("localhost", onPort: 8000, securely: false)
self.client.delegate = self
self.client.connect() Maybe @abpopov or @jondubois could tell if that lib can be used with |
Alright I found the problem EDIT: this one I don't know how to fix it :D |
That's confusing indeed, added a note in zalmoxisus/remotedev-server@0c007bc. |
Success! For future reference let message = SCMessage.init(eventName: "login", andData: ["data": "master"]) I'll continue to experiment. If it makes sense to use this monitor I think we will create a swift implementation of ws library |
@zalmoxisus Your note (without patching the library as I did) leads to this URL
Which doesn't work. I haven't found a way to create the proper url without changing the lib |
Weird, according to the example from there, it should work. |
It may be that I'm doing something wrong.. |
Personally, I haven't used the native iOS client and I don't manage that repo. @bolismauro Feel free to fork the repo and makes changes if there are any issues - Then I guess you can make a PR for @abpopov to review. |
Hi.. I didn't have much time to work on this project.. But I finally managed to create a proof of concept :D Thanks for your help guys :) |
@bolismauro looks great. Feel free to submit a PR to add it to the integrations links. |
Hi everyone,
First of all, this project is amazing :)
I'm one of the creators of a Swift version of React+Redux named Katana.
I'm planning to create a dev tools similar to this one but for Katana.
I was wondering if it is possible to avoid to create a brand new software and use instead this project.
I saw that React Native is supported too, so I guess that is should be doable. What do you think? Can you suggest to me some directions on how to approach the problem?
The text was updated successfully, but these errors were encountered: