Giter Club home page Giter Club logo

Comments (9)

justinmk avatar justinmk commented on June 25, 2024 2

If there is something Nvim core can add which would eliminate the need for the rust component, that would very much be something we would try to support.

from firenvim.

glacambre avatar glacambre commented on June 25, 2024 2

I see, the rust binary can probably be replaced with a plugin then, thanks :)

from firenvim.

glacambre avatar glacambre commented on June 25, 2024

I haven't tried to run firenvim in windows yet but it should work, it just requires adding a few keys to the registry. I plan on adding this functionality to the rust component.

The rust component is just a really simple program which translates firefox's native messaging protocol into "raw" messages. Removing it would require adding a way for neovim to automatically detect the messages it's receiving are using firefox's protocol (this could probably be achieved by checking whether the two arguments neovim was started with are the ones Firefox gives to programs it starts) but I'm not sure this belongs in neovim (although I'll admit I'd love to have less code to maintain :p). Is there any support on neovim's side to specify "preprocessing" actions that would be applied to messages received on stdin?

Sorry this repo hasn't been updated in a while, I've been very busy. I do plan on getting back to this and making it actually usable on all three platforms and all webextension-supporting browsers.

from firenvim.

justinmk avatar justinmk commented on June 25, 2024

Is there any support on neovim's side to specify "preprocessing" actions that would be applied to messages received on stdin?

stdin can be processed arbitrarily by starting Nvim with --embed --headless and calling stdioopen() to create a channel on stdin/stdout. See :help stdioopen()

from firenvim.

glacambre avatar glacambre commented on June 25, 2024

I have added proper windows support to the native binary, built it and uploaded it to the releases pages (this is temporary - I still plan on turning it into a plugin that wouldn't require a native executable).

@justinmk I've been wondering, is it possible to open ports in vimscript/lua? Currently the main problem with firenvim is latency (up to 10ms to send a message and get an answer!). This happens because messages go through several layers of IPC. Thus I believe that the optimal architecture would be to have firenvim talk with neovim through a websocket, without going through a remote plugin. I can write the websocket code myself/steal it from somewhere but I need to have nvim listen on a port to do that.

from firenvim.

justinmk avatar justinmk commented on June 25, 2024

is it possible to open ports in vimscript/lua?

@glacambre serverstart() starts a msgpack-RPC server. And Nvim always has at least one of these running at startup (v:servername).

If you don't want to use msgpack-rpc we could maybe add that as a feature-request. But it's probably a good idea to use msgpack-rpc, since one needs some sort of protocol.

from firenvim.

glacambre avatar glacambre commented on June 25, 2024

@justinmk I do want to use msgpack-rpc but over websockets, which have their own protocol. So this is what sending a message would look like:

Browser sends a msgpack-rpc message over a websocket
                                      |
                                      v
Lua plugin running inside neovim receives the request on the socket it opened in neovim,
translates the websocket-msgpack-rpc message into a regular msgpack-rpc message and writes
it to a neovim channel
                                      |
                                      v
neovim processes the msgpack-rpc message and replies on the same channel
                                      |
                                      v
Lua plugin receives the answer, wraps in into a websocket request and sends it on its TCP
socket
                                      |
                                      v
Browser receives the message and does whatever it wants with it

That's why I would need to be able to open "normal" TCP sockets.

from firenvim.

justinmk avatar justinmk commented on June 25, 2024

@glacambre would you mind creating a feature-request?

from firenvim.

glacambre avatar glacambre commented on June 25, 2024

I'm going to close this since Firenvim now works on windows. If you want to follow progress on removing the native binary, please subscribe to #22.

from firenvim.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.