Skip to content
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

Using solid as the main DOM engine in Atom (replacing etch) #77

Open
aminya opened this issue Aug 4, 2020 · 6 comments
Open

Using solid as the main DOM engine in Atom (replacing etch) #77

aminya opened this issue Aug 4, 2020 · 6 comments

Comments

@aminya
Copy link
Member

aminya commented Aug 4, 2020

Plan

I plan to use solid for Atom projects. Atom has its own DOM library called etch, which is used in the core of Atom as well as many of its packages. etch has some limitations, it has an average performance, and forces a certain style of programming.
https://github.com/atom/etch

Implementation

To make the transition seamless, I want to make a drop-in replacement library that uses solid as its backend but has the same API as etch.

The documentation of etch gives an overview of the API
https://github.com/atom/etch
These are the source code of the API (initialize, update, destroy):
https://github.com/atom/etch/blob/master/lib/component-helpers.js
and here the dom function:
https://github.com/atom/etch/blob/9b90d6ad88b90b8a273992c540879b915d9967a2/lib/dom.js#L4

P.S: The other approach is to use meta-programming to transpile etch code to solid code. However, this can be complex, but I am open to that approach too. Something like this babel plugin or this transformer

Benchmarks

In the benchmarks, etch is behind solid so this can be beneficial in general (~25% improvement). This can enhance the responsiveness of the editor.
https://krausest.github.io/js-framework-benchmark/2020/table_chrome_84.0.4147.89.html

image

The last dramatic change for improving the performance happened back in 2017 by introducing etch. Now it is the time to replace that with a faster modern framework. Even if we do not use it for text rendering, other parts of the Atom can benefit from it.
https://blog.atom.io/2017/06/22/a-new-approach-to-text-rendering.html
https://blog.atom.io/2018/01/10/the-state-of-atoms-performance.html

P.S:

@aminya
Copy link
Member Author

aminya commented Aug 5, 2020

I have made a demo of this etch-solid library:
https://codesandbox.io/s/etch-solid-pwonz?file=/src/index.jsx

@DeeDeeG
Copy link
Member

DeeDeeG commented Aug 6, 2020

I want to register that I've seen this PR issue but feel unqualified to give proper technical feedback or input. If somebody more versed with JS could take a look, they'd have my appreciation.

As with any performance increasing change, if this is faster and not buggy, then I don't see why not.

@aminya if you can direct me to some specific things to test, I should be able to contribute testing if/when I get the time. (Probably not this week!)

@aminya
Copy link
Member Author

aminya commented Aug 12, 2020

The discussion is being followed here: solidjs/solid#206

@aminya
Copy link
Member Author

aminya commented Aug 23, 2020

I made a repository to make the ideas more solid :)
https://github.com/atom-ide-community/etch-solid

@aminya aminya added this to In progress in New enhancements Aug 29, 2020
@aminya aminya added this to In progress in Runtime Performance Oct 21, 2020
@jeff-hykin
Copy link

I'm very picky about my frontend frameworks, but no-vdom + jsx ❤️ I'm basically already sold on the switch.

@aminya
Copy link
Member Author

aminya commented Nov 5, 2020

etch solid is written and if you notice it is a tiny wrapper around solid. I have made etch-solid to be as backward compatible as possible.
https://github.com/atom-ide-community/etch-solid/blob/master/src/index.ts

The remaining are these:
https://github.com/atom-ide-community/etch-solid/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc

etch-solid also does not have manual scheduling like etch does.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
New enhancements
  
In progress
Development

No branches or pull requests

3 participants