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

WebWriter in the browser #70

Open
salmenf opened this issue Aug 30, 2024 · 0 comments
Open

WebWriter in the browser #70

salmenf opened this issue Aug 30, 2024 · 0 comments
Assignees
Labels
cloud enhancement New feature or request

Comments

@salmenf
Copy link
Member

salmenf commented Aug 30, 2024

Idea

To offer WebWriter in the browser, an environment needs to be created as an adapter between WebWriter Core and the browser. This has several challenges:

  1. Saving/Loading: The file system API can be leveraged - A file opened by the user can be overwritten without user input by the application, the rest is accomplished with the built-in file pickers.
  2. Bundling: Esbuild has a WebAssembly version which can be loaded. The issue is in resolving dependencies as the file system cannot be accessed. There are two possible solutions: A) npm-in-browser can be used to fully install packages in the OPFS, but this requires an adapter for both npm-in-browser and esbuild to access the OPFS. B) Alternatively, dependencies could be loaded by the browser by creating an importmap out of all packages' package.json files. Then, in editing mode, all dependencies are directly fetched from esm.run. For bundling, dependencies can be fetched for esbuild. Bundles could be cached in the OPFS. This second solution would eliminate the need for an NPM client, but depend on an external CDN.
  3. Local Packages: Use the File System API to poll permitted directories periodically.
  4. Settings: Store in LocalStorage?

Implications

  • No more installing or maintenance of desktop versions -> instant support of all platforms through current browsers.
  • Updates are automatic.
  • WebWriter itself could be referenced in each WebWriter document (esbuild-wasm + webwriter-core.js + webwriter-core.css) and documents could be edited on the fly. This is powerful for adoption since the tool spreads with the documents.
@salmenf salmenf added enhancement New feature or request cloud labels Aug 30, 2024
@salmenf salmenf self-assigned this Aug 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cloud enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant