nodejs / CTC

Node.js Core Technical Committee & Collaborators
80 stars 27 forks source link

Improve relationship and collaboration with Electron #8

Closed rvagg closed 8 years ago

rvagg commented 8 years ago

Electron is growing in popularity and we share a user-base. We've had some collaboration between the two projects, including trying to bring in some of the things that they have to float on top of Node to make it work for them. It's still clear that there are problems faced by Electron users that are a result of a disconnect between the two projects. For example ABI incompatibilities because of the way the Electron ships V8 vs how we handle it. I'm starting to chat more with the Electron crew about how we might better work together but I'd like to collect thoughts here from any @nodejs/collaborators who have experience with the cross-over or understanding of the pain between the two projects. An ideal outcome might be for Node.js and Electron to share the pain that is currently forced on to users, so that users don't have to care. What are the areas ripe for improvement?

indutny commented 8 years ago

You have my 👍 on this. I deeply believe that we should merge our efforts, and find a common ground in terms of requested build/API functionality.

Some existing efforts: https://github.com/nodejs/node/pull/6994

eljefedelrodeodeljefe commented 8 years ago

@rvagg happy to help actively, since I have some investment in the technology. I think it needs some change on their side too to attach to node update cycle. They have a history of forking out the major dependencies and manually patching them. Which then is bad when personnel is on vacation for a few weeks (happened earlier this year).

There is an additional problem with the above strategy: their downstream then does the same. E.g. there is the brave browser who fork (or used to?) their electron then. Also, no semver compliance, afaik.

saghul commented 8 years ago

That would be great. I started to use Electron lately and it's really amazing, so closer collaboration can onyl be a good thing.

With my libuv hat on, we should probably see how to suit their needs without this: https://github.com/electron/node/commit/061f4bf40f3528c7ff04a5247b90804c3a029e98

mhdawson commented 8 years ago

One thing that would be good to understand (@indutny maybe you already know) is why they don't use the bundled version of v8.

bnoordhuis commented 8 years ago

They use the copy that is bundled with Chromium.

MylesBorins commented 8 years ago

There was a discussion this weekend that included @maxogden around how core could better serve Electron, perhaps we has some ideas to toss in here as well.

As mentioned above, one of the biggest pains I've seen is that electron needs to peg itself to the version of v8 that works with the version of Chromium they are using. One idea I passed around, which likely has tons of flaws, was that we could perhaps vendor chromium in a similar way we handled ICU (behind a flag and not included in the repo).

--> https://bugs.chromium.org/p/chromium/issues/detail?id=546953#c54

It looks like chromium is going to be shipping with an embedded headless browser in the near future, I could imagine this being a very desirable feature for those doing testing.

As a caveat... I also see this as massive feature creep and the opposite of small core... mostly an idea to build on

Fishrock123 commented 8 years ago

I've been trying to get a better connection for a long time, I used to semi-regularly check what commits they were floating on node and sometimes comment to zcbenz about them.

Until recently getting feedback wasn't easy because they were only 1-2 people and very busy.


About how electron ships V8, my feeling is that work would probably need to be done to separate V8 from chromium so that it could run on node's v8. I don't see a great option otherwise for supporting native modules.

Trott commented 8 years ago

It seems that this was largely opened as information-gathering and it seems to have fulfilled its purpose and run its course. I'm going to close, but feel absolutely free to re-open if you think that is misguided of me.

zeke commented 8 years ago

It looks like chromium is going to be shipping with an embedded headless browser in the near future

@TheAlphaNerd any news on this?

MylesBorins commented 8 years ago

@zeke it looks like it landed Sept 22

Design doc I found: https://docs.google.com/document/d/1VTcYz4q_x0f1O5IVrvRX4u1DVd_K34IVUl1VULLTCWw/edit#heading=h.ndv831lc9uf0

It looks like they introduced the headless directory in v50 The version shipped with the latest v54 (the same release line as v7 of node for V8) is much more mature

It looks like the screen shot functionality didn't make it until v56... which would mean it is about 12 weeks out from becoming stable.

You can use the API to attach a debugger and get screenshots in v56 today though... which is getting me thinking about some cool stuff that could be made.

edit: this slide show is very informative --> https://docs.google.com/presentation/d/1gqK9F4lGAY3TZudAtdcxzMQNEE7PcuQrGu83No3l0lw/edit#slide=id.g14ebf0ab58_0_0