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

actually do some maintenance #1697

Open
NullVoxPopuli opened this issue Oct 25, 2022 · 4 comments
Open

actually do some maintenance #1697

NullVoxPopuli opened this issue Oct 25, 2022 · 4 comments

Comments

@NullVoxPopuli
Copy link
Owner

As far as gjs/gts and v2 addons are concerned, a lot can be done to improve this repo' including adding turborepo to speed up ci.

I should do some of this and modernize this codebase.

Thankfully, it's not tooooo big.

@NullVoxPopuli
Copy link
Owner Author

Also, update networking code?
https://docs.holepunch.to/

@NullVoxPopuli
Copy link
Owner Author

Standard auth: https://webauthn.guide

@NullVoxPopuli
Copy link
Owner Author

Something that might help with long-term maintenance,

  • Swap out the design system away from custom + shoelace to Toucan
  • Swap out custom form stuff for headless-form (also improves a11y)

@NullVoxPopuli
Copy link
Owner Author

Use MessageChannels instead of worker-bi

¹ https://developer.mozilla.org/en-US/docs/Web/API/AbortController
² https://developer.mozilla.org/en-US/docs/Web/API/Channel_Messaging_API

from @sukima:
For workers I used MessageChannel to convert the postMessage into a promise async/await version

function asyncPostMessage<t = unknown>(worker: Worker, message: unknown, transfers: Transferable[] = []): Promise<T> {
  let { port1, port2 } = new MessageChannel();

  return new Promise<T>((resolve) => {
    port1.onmessage = ({ data }: MessageEvent<T>) => resolve(data);
    worker.postMessage(message, [port2, ...transfers]);
  });
}

and in the worker:

self.addEventListener('message', ({ data, ports: [port] }: MessageEvent<>) => {
  // Do stuff with data
  port.postMessage(result);
});

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

1 participant