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

Extract platform code #99

Closed
16 tasks done
bwindels opened this issue Sep 17, 2020 · 0 comments
Closed
16 tasks done

Extract platform code #99

bwindels opened this issue Sep 17, 2020 · 0 comments
Assignees

Comments

@bwindels
Copy link
Contributor

bwindels commented Sep 17, 2020

  • Move ui/web into platform folder, so things now in ui/web/dom can go into platform/web/dom and ui/web/... can go into platform/web/ui
  • move all things we inject into the session container into a platform object. This is both platform specific things and non-deterministic global state things like the random function:
    • clock
    • cryptoDriver
    • olm
    • olmWorker
    • onlineStatus
    • storageFactory
    • session info storage
    • request function (xhr.js and fetch.js will be moved out of matrix/net and into platform/web/dom/net/)
    • random function
    • textencoder/decoder as encoding.{toBytes, toUTF8}
    • base64/base58 encoding/decoding?
    • given that Uint8Array is universally supported, it can be used everywhere and not just in platform specific code.
  • for web, both the modern and legacy bundle export a Platform class next to the main. Dependencies that should only be in either bundle should be exposed through this platform class (e.g. AES-CTR not being natively supported on legacy). E.g. there will be a platform/web/LegacyPlatform.js and a platform/web/ModernPlatform.js which will export a Platform symbol.
  • the main function receives a platform argument, an instance of the exported Platform class, which it will pass to the session container.
  • platform also creates the root view given the root view model
@bwindels bwindels added the feature New feature or request label Sep 22, 2020
@bwindels bwindels added maintenance and removed feature New feature or request labels Oct 5, 2020
@bwindels bwindels self-assigned this Oct 26, 2020
bwindels added a commit that referenced this issue Feb 12, 2021
sandhose pushed a commit to sandhose/hydrogen-web that referenced this issue May 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant