Closed calebjacob closed 1 month ago
The latest updates on your projects. Learn more about Vercel for Git ↗︎
Name | Status | Preview | Comments | Updated (UTC) |
---|---|---|---|---|
bos-web-engine | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Apr 17, 2024 11:10pm |
bos-web-engine-docs | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Apr 17, 2024 11:10pm |
bos-web-engine-sandbox | ✅ Ready (Inspect) | Visit Preview | 💬 Add feedback | Apr 17, 2024 11:10pm |
Hey everyone, I was tasked this sprint with getting my team set up to start developing RoC components. I got the repo set up and the workflow is actually really nice! https://github.com/near/near-roc-components
Anyways, I started thinking it would be super cool if we could see our changes instantly in the browser when modifying a component without having to do a manual, full page refresh each time. I chatted quickly with @mpeterdev about it and we decided it made sense for me to take a stab at it.
Here's where I ended up:
packages/hot-reload-server
andpackages/hot-reload-client
pnpm dev:components
apps/web
to allow configuration of a new feature flag config forhotReloadWebsocketUrl
in the Dev Tools drawer.packages/hot-reload-client
exposes a reusableuseHotReload()
hook to initialize the websocket connection. ThehotReloadWebsocketUrl
is passed into the hook. When it's set, it will initialize the websocket connection and listen for aHOT_RELOAD
event.packages/hot-reload-server
to explain context and usageThe intent behind
pnpm dev:components
is giving component authors a quick way to call a single command to get everything up and running for local component development (in this case, it's booting upapps/web
andpackages/hot-reload-server
).Please give the README a glance and let me know what you think!