Open schomery opened 7 years ago
Is it possible to provide support for the use case in #86 e.g. the ability to open&watch an arbitrary existing file?
We have it now on https://github.com/openstyles/stylus-external-editor/commit/9057f6054ce35ddbe0796adf498c659a43950348
It is now possible to call observeFile
to only observe an existing file or call openTmpFile
to create a new tmp file and observe its changes.
Wow, this sounds too good to be true. What interface is used between the extension and node?
Here is the summary on how the stylus-external-editor extension can be tested on Chrome/Opera:
install.sh
or install.bat
You should get an empty style file in your default text editor (Mac and Windows are tested). Whenever a change is made, you will get a notification in the background console of stylus-external-editor
What interface is used between the extension and node
hmmm, nothing! See https://github.com/openstyles/native-client/blob/master/host.js#L61-L66
Here is the summary on how the stylus-external-editor extension can be tested on Firefox:
install.sh
or install.bat
You should get an empty style file in your default text editor (Mac and Windows are tested). Whenever a change is made, you will get a notification in the background console of stylus-external-editor
I got this working, and I see it has potential to be awesome!
Would you still implement this method if @tambry's C++ solution in #86 works out?
Would you still implement this method if @tambry's C++ solution in #86 works out?
I don't mind if we go with the C++ version. I personally like how the entire native side is written in our extension side for NodeJS version. Anyway, if the C++ works as expected and can be compiled for all major operation systems, we can drop the NodeJS client.
@tambry I thought this was supposed to be a small C application? When did it turn into bloatware holding not 1 but 2 Node EXEs?
@svnpenn I didn't implement that. I would never implement such a bloated solution. I'm unable to implement my solution yet, as I'm waiting on this Chromium issue (Firefox equivalent). You can try staring the Chromium issue. The issue has been assigned for Chromium 62, which will release on 17th October. Only one more month of waiting!
So I am working on a new extension that brings the power of external editing to Stylus. We can integrate it directly to Stylus when the project is usable.
For now here is the summary:
{method: 'spec'}
{permissions:[], script: "/*NodeJS script here*/"}
Notes: