Skip to content

Bump Electron to latest Electron #89

@mauricioszabo

Description

@mauricioszabo

Have you checked for existing feature requests?

  • Completed

Modifications

Originally, this was to bump Electron to 13. But considering the effort it took and that it almost worked out of the box for Electron 19, I'm bumping this to move the further we can before other things break down.

Summary

Electron 19 is not working yet. Superstring is the library we need to port to make the editor at least not crash.

I had some luck with Superstring compiled with WASM, but we have some APIs that we need to reimplement (for now, I know of TextBuffer.load) probably on Node (as WASM doesn't have support for native FS unless you do some weird things)

So far, what needs to be done:

  • Either port Superstring to NAPI (work in progress here: Migrate to N-API superstring#2) or implement WASM feature that are missing (work in progress here: https://github.com/pulsar-edit/superstring-wasm)
  • With superstring compiled to WASM, Autocomplete works but I can't actually SELECT the suggestion with TAB or ENTER. Not sure if it's because of something WASM-related or some breaking change on Electron, needs to investigate
  • With WASM, we're not being able to open files (again, because of the missing APIs). We need to fix this
  • With WASM, we can save files but they don't appear as modified or saved (missing APIs on superstring)
  • Bump TextBuffer to use the newer version of Superstring (either with N-API or with WASM)
  • Tree sitter also doesn't work. There, again is some work on porting tree-sitter to N-API but the problem is that all grammars also need to be ported or become context-aware. Maybe a better idea is to just rewrite all of tree-sitter stuff to either use WASM or to simply move to a different implementation
  • If we disable tree-sitter for now, we'll need to disable to all packages too, because they open a big red warning about context-aware functions on Pulsar when we boot (even if we DO NOT use them)
  • Pathwatcher is also failing. There is a new version that is able to use Pulsar's "watch API" instead, but we need more tests to see if it's working
  • Fuzzy-finder is also broken because the API is not context-aware. I removed binary dependencies and drafted a PR to at least make it work on Electron 19
  • Git-utils is also broken. This may be a non-issue if we make it context-aware, but it's a good idea to see if we can move git-utils to Isomorphic GIT (a pure JS implementation) and just add a breaking change that the API for atom.repository will become async
  • Need to update PPM (and see if its dependencies will also be broken)
  • Test the editor, fix tests, etc

Enter your response below:

Ability to keep bumping Electron versions

Any alternatives?

None that I know of

Other examples:

WASM support have trade-offs compared with NAPI. Both are slower than the Nan version Superstring uses, and there's nothing we can actually do - newer Electron versions are context-aware, and superstring uses memcpy to copy text and this will not work anymore;

WASM is better because we just need to compile once, then every place can use the same WASM. It's also worse because WASM requiring is asynchronous, meaning we need to "await" until Superstring is ready to be consumed. Pulsar does not use ESM (which are async) so all requires are synchronous.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions