Skip to content

Comment on Show HN: Reflame – Deploy your React web apps in millisecondsparent

Comments

Having worked on a similar system in the past - it’s a trade-off.

On one hand, all your domains match across all environments/deployments and you can set a cookie and refresh to switch versions fast. Only 1 HTTPS cert and no subdomains to manage. You could invisibly do a slow rollout of deployments by slowly changing cookies. Fun stuff like that.

On the other hand, you have to have special links to set the cookies, and you end up building some kind of environment/version indicator somewhere or else you’ll lose your mind when debugging. And buckle up for when you accidentally switch versions in a different tab instead of using Incognito and screw up some debugging. Or try explaining to a confused marketing person that they’re looking at the wrong version of your landing page because a cookie they don’t know about is set wrong.

It’s all trade-offs. Personally having used both approaches I think the cookie method sounds better than it ends up being in practice. Different domains is uglier, but more clear.

Yep, definitely a tradeoff. Really awesome to hear others have explored this in the past!

I wanted to err on the side of _enabling_ an identical-to-production development workflow, because AFAIK nothing else really offered this. So the cookies approach is what I ended up starting with, and I also built a UI to help make the difference abundantly obvious: https://reflame.app/~r/start-preview/?mode=production&varian...

Even still, subdomains are definitely less confusing though, and doesn't lead to the same kind of strange behaviors that you could only make sense of if you understood exactly how cookies work and how Reflame makes use of them (a tall order, I'm not even sure if I do 100% today). I may eventually also offer a subdomain version of these previews, for those who might be collaborating with less technical folks who are more likely to be confused by the cookie-based implementation.

Love the widget!

Assuming an app handles it correctly, unique domains-per-deployment give me the warm fuzzies when debugging. When tracking down a problem, I want there to be no doubt I'm looking at the correct version. Vercel's approach here is nice.

Thanks for the explanation, that makes sense. I think I prefer the more explicit version over the seemingly more elegant version.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.