Skip to content

Plan for low resource devices #40

Description

@lastmjs

Looks like a tentative plan is still to use jsdom on low resource devices. Getting Node.js to run on those devices looks hard, but if we can compile jsdom to C, we should hopefully be able to run it straight on those devices. This project looks promising for compiling JS to C: https://github.com/andrei-markeev/ts2c/blob/master/README.md

The project is planning on having 95% of ES3 capabilities by the end of the year. We could go from jsdom, which is probably written in ES5, to ES3, and then to C. I'm not sure if jsdom uses any node APIs, we would have to somehow port those over. That looks like a good path. This means we still need to implement custom elements in jsdom. That seems like a solid solution to eventually getting web components to work on all devices.

Now, another possibility is to wait for a good web assembly interpreter that can run on low resource devices. Then we could compile jsdom to wasm, and run it right on the device like that. We'll have to watch the landscape to see how low resource wasm code can run.

So, the conclusion is, implementing custom elements in jsdom looks like the next best step to getting web components onto devices that cannot run Electron or Node.js. In order of resources needed: Electron -> Node.js -> wasm -> C. JSDOM should work for all devices in this spectrum.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions