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

wasm support #380

Open
fr-an-k opened this issue Jun 6, 2024 · 2 comments
Open

wasm support #380

fr-an-k opened this issue Jun 6, 2024 · 2 comments

Comments

@fr-an-k
Copy link

fr-an-k commented Jun 6, 2024

It doesn't appear to be currently possible due to linebender/parley#70 (fontique's dependency on SystemFonts).

I'm guessing there is currently no easy way to work around this or use an alternative fontstack.

I also had to add this to Cargo.toml:

[dependencies.getrandom]
features = ["js"]

I intend to use this for (new) production software, so I already assumed I need my own heavily modified fork and then reconcile later. I'll probably use mcsdf for 2D + 3D font rendering.

But WASM support (without or without javascript host) will be very important so there should be a case (and example) for it:

  • Most target audiences prefer using the browser over playstores, installers or executables
  • WASM (+wgpu/winit) provides sandboxed native performance in the browser
  • App developer's DOM and javascript exodus will continue growing since they have more downsides than upsides
  • WASM will be the basis of many plugin systems

Accessibility would be nice but is non-essential at this stage.

@DJMcNab
Copy link
Member

DJMcNab commented Jun 6, 2024

#47 covers some of our thinking on this; it is not plausible to support running Masonry on the web for any production application. This is because the web does not allow text input, accessibility, scrolling and text actions (among others, I'm sure) to work as users expect without using the DOM (which Masonry would not use). We do intend to make Masonry work on the web, for those demo use-cases. But we will absolutely make this same message clear; that the use cases for that support necessarily exclude "production software".

If you wish to use Xilem on the web, I would recommend using xilem_web, which is included in this repository, and does properly support the web by controlling DOM nodes. Please note however that xilem_web development is entirely community driven, you'd be welcome to contribute.

As an addendum:

Accessibility would be nice but is non-essential at this stage.

I would encourage you to rethink this position; the use of canvas/wgpu based drawing does not just make accessibility impossible "at this stage", it makes it implausible in the future. In my opinion, it is not possible to develop a "production" application with no possible path to accessibility, so the path you are intending to take might not be viable.

@fr-an-k
Copy link
Author

fr-an-k commented Jun 6, 2024

Ok.
A WASM target just needs to be compilable, not support everything.
For that users can install the native app.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants