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

Local gateway + Hot Reload using WebSocket #16

Merged
merged 22 commits into from
Dec 7, 2023
Merged

Local gateway + Hot Reload using WebSocket #16

merged 22 commits into from
Dec 7, 2023

Conversation

sekaiking
Copy link
Collaborator

No description provided.

@sekaiking sekaiking self-assigned this Dec 5, 2023
This was linked to issues Dec 5, 2023
@sekaiking sekaiking marked this pull request as ready for review December 5, 2023 08:44
@sekaiking
Copy link
Collaborator Author

sekaiking commented Dec 5, 2023

@elliotBraem I think this is done for now, I've tested it but I appreciate if you can test it again to see if anything breaks.

bw dev launches the bos loader server, after few seconds it starts the local gateway with hot reload enabled by default.

Some things that need to be addressed in future PR:

Copy link
Contributor

@elliotBraem elliotBraem left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The experience is awesome.

It does take a very long time to npm install for the gateway -- I'm over at least 3 minutes right now, maybe more.
May be a future improvement, but we should explore ways to cut this down. Maybe we can deploy bundles that it uses.

Have you taken any influence from near-social-local-viewer? I haven't used this project in a long time, I'll have to give it a shot and see if it boots up faster, there may be some take aways.

To maintain support for existing bos-workspace workflows that are setting flags and not using a local gateway, we may want default behavior to not start a gateway and enable it with a flag, or vice versa.

gateway/src/index.js Outdated Show resolved Hide resolved
gateway/package.json Outdated Show resolved Hide resolved
gateway/src/index.scss Outdated Show resolved Hide resolved
import io from "socket.io-client";
import { flags } from "../config/flags.js";

function useRedirectMap() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is sick.

Can you explain more the decision of full local gateway vs near-bos-webcomponent? (it was related to websockets, right?)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

near-bos-webcomponent is really great for quickly launching a consumer gateway, but my vision is to have a gateway for developers, and to implement it we need to have direct access to the gateway code.

Some dev features I think will be useful on a local gateway but not needed in normal gateways:

  • Hot reload
  • SocialDB/API mocking
  • Debuging Tools like this

@elliotBraem elliotBraem merged commit 47a002c into main Dec 7, 2023
10 checks passed
@sekaiking sekaiking deleted the gateway branch December 8, 2023 00:37
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

Successfully merging this pull request may close these issues.

Add support for hot reload Add a gateway for local development
2 participants