Skip to content

Fixes for ws isomorphism #47

@tegefaulkes

Description

@tegefaulkes

Specification

While we have some isomorphism working to some degree, we're still running into issues with the deployed version of PKE. Otherwise it currently works when hosting locally.

The main issue is that some node modules are being included in the bundled client code. Even if these are not used the very existence of these imports in the client on the browser results in CORS errors trying to import them. We need to remove any chance of these imports when using the WebsocketClient entirely.

To fix this we just need to ensure that no node imports are done within any imports used by the client side code. The client side needs to be fully isomorphic however the server will not be supported within browsers.

Just skimming through the code I can see that utils.ts and WebsocketStream.ts has imports to node modules. These are also common to server and client code. We'll need to look into isomorphic wrappers for these node modules.

Additional context

Tasks

  1. Review Isomorphic changes from Pull feature: isomorphic WebSocket support #32
  2. Look into Isomorphic wrappers for node modules
  3. Look into isolating node imports from client related code.
  4. Remove polyfills from Polykey-Enterprise when this has been resolved.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions