-
Notifications
You must be signed in to change notification settings - Fork 0
Description
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
- Previous work: feature: isomorphic
WebSocket
support #32 - Previous work: Isomorphic js-ws #6
Tasks
- Review Isomorphic changes from Pull feature: isomorphic
WebSocket
support #32 - Look into Isomorphic wrappers for node modules
- Look into isolating node imports from client related code.
- Remove polyfills from
Polykey-Enterprise
when this has been resolved.