peer-base / peer-pad

📝 Online editor providing collaborative editing in really real-time using CRDTs and IPFS.
https://peerpad.net
MIT License
678 stars 56 forks source link

chore: better config when in dev vs prod #253

Closed victorb closed 5 years ago

victorb commented 5 years ago

This commit basically changes the config depending on if we're in development or production (npm start vs npm build), basically so we don't have to manually change src/config.js every time and then reset before/avoid to commit.

Affected values are the swarm address + bootstraps

License: MIT Signed-off-by: Victor Bjelkholm git@victor.earth

jimpick commented 5 years ago

I like this, but it's a bit head scratching if the developer skipped the part where they have to run npm run start:rendezvous in a separate terminal on their localhost.

I wonder if either npm start could run that, or the UI could throw up a message that says "i can't find the rendezvous server at ..." ?

victorb commented 5 years ago

@jimpick good point, thanks.

We could leverage something like run-p from npm-run-all on npm start that would starts both the webpack dev server + a rendezvous server. Docs here https://github.com/mysticatea/npm-run-all/blob/master/docs/run-p.md

Sounds good?

jimpick commented 5 years ago

I like the plan.

I can merge this one as is ... i'm just about to do a short shinkansen train to Tokyo, so I'll do it when I arrive.

parkan commented 5 years ago

I kind of like manually running start:rdv to make sure the user is aware of the need for a signaling server. Being required to run that makes you aware of a part of the system that is kind of opaque right now -- you can easily be forgiven for thinking the peer discovery "just happens" otherwise, which is not quite the case yet 😄

On the other hand, running it every time can be a pain. I feel like the most teachable and convenient thing would be to have npm start just run the app, and another script run everything, though maybe I'm overthinking it.

Let's merge this and open a separate PR for orchestration.

jimpick commented 5 years ago

Okay, I've created issue #258 to track ideas for indicating to the developer that they need to run the rendezvous server manually in another terminal.