-
-
Notifications
You must be signed in to change notification settings - Fork 193
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
Eliminate js/window for nodejs compatibility #209
Comments
Hi Terje, thanks for this. Would ideally like to wait on a response from @theasp first at taoensso/encore#21 since he submitted the Node stuff and it's currently my understanding that he might already used Sente in this way without the need for any changes (?). As I mentioned, I don't use Node myself so can't provide any guidance here. If any changes do turn out to be necessary, they'll likely need to come in the form of a PR. In principle would be happy to make this as smooth as possible for Node users, would just like some confirmation before we adopt a particular plan. Cheers :-) |
Also pinging @whamtet - any advice on this? Thanks! |
Thanks Peter. Also note |
Um, okay- something odd definitely going on. All trace of both issues seems Perhaps he deleted his account and GitHub auto-kills all issues a deleted Let's give it some time, maybe they're just having a temporary problem. Will open a fresh issue so long. On Sat, Mar 5, 2016 at 12:54 PM, Terje Norderhaug notifications@github.com
Peter Taoussanis |
Mysterious, ok. Could try again in the morning. From what I can tell the js/window Matt On 6 March 2016 at 21:24, Peter Taoussanis notifications@github.com wrote:
|
Ok, sure. Would you like me to put in a pr for it?
|
@TerjeNorderhaug Hi Terje, could you please clarify: you're trying to use Sente from Node as a server (not client), and you're running into errors with Please note that Sente currently supports Node on the server end but not the client end. Does that make sense? |
The Terje's GitHub page is 404'ing related issues was caused by a github bot flagging me as a bot, for no obvious reason. |
Quick! The bots are revolting! What was the problem you had with js/
|
This isn't just a node.js thing ; it effects slimerjs and phantomjs and interferes with using those systems for unit testing. Likewise, it would be convenient if node.js could be a client, too.... |
Just to clarify: Sente was initially a :clj server + :cljs client since that's what I needed myself, and it was a place to start. The node.js client work prompted a small refactor which added support for :cljs servers too. So as of today we have support for #{:clj :cljs :node} servers and #{:cljs} clients. Some further refactoring will be necessary to add support for :clj clients and/or :node clients. Does that make sense? I don't have a particular need for either of these myself and have some other priorities, so won't be able to handle these myself - but PRs would be welcome :-) |
Sure; but I was just saying that there's other headless javascript environments besides node that don't have js/window besides node. Personally, I don't have any pressing need for a :clj client (or a headless :cljs client beyond merely unit testing). IMO, a refactor for headless :cljs would be easier than a :clj refactor ; I have admittedly been scared to refactor this code in the past, since without unit tests I wasn't sure if I was breaking things. |
Hey guys, I've submitted a PR to allow nodejs clients. It might also enable nodejs servers, but I haven't tested that. |
Resolved with #243 |
As
js/window
is specific for browsers, for better compatibility with clojurescript on nodejs, consider usinggoog.global
rather thanjs/window
as ingoog.global/WebSocket
instead of(aget js/window "WebSocket")
- or alternatively justjs/WebSocket
.The text was updated successfully, but these errors were encountered: