3 ms·
Yeah, it does depend on your requirements of course, the sites I’ve used it for are freelance sites for small companies for whom waiting a minute or two isn’t a
by tomduncalf 7y ago
Yeah, it does depend on your requirements of course, the sites I’ve used it for are freelance sites for small companies for whom waiting a minute or two isn’t a big problem. Should also note that I don’t think Cockpit has versioning or draft states so probably not suitable for a “big” site with lots of editors etc.
Like I say, the dev server route may be a way to make this more dynamic. Another possibility is that it seems like react-static can now do incremental builds for only a subset of routes, so you could just republish a given route I’d it’s easy to map from CMS entity to affected route(s).
One other thing to keep in mind is that for some categories of site, moving away from the “managing pages” CMS model to the “managing content models” often makes the site much easier to manage (e.g. you can’t break the layout by editing the wrong thing in a wysiwyg editor) so there may be less need for frequent previewing.
But I agree, not a solved problem yet. Running the preview on the dev server is the best I can think of for now. You can imagine some kind of site-aware CMS that understood how entities mapped to components and could show inline previews in a React Storybook kind of style, that could be neat!
- tomduncalf 7y agoFor the record, I did go with the route of running react-static in dev mode on the server for preview (using Phusion Passenger to run it, as this was set up on the server, which required an app.js file to start the server: https://gist.github.com/tomduncalf/00070fecb68a6cf35c0102c75f166a8a https://gist.github.com/tomduncalf/00070fecb68a6cf35c0102c75...). Seems to work really well. I've got another simple server at "/restart" running which touches "tmp/restart.txt" when hit which forces Phusion Passenger to restart the dev server, which forces it load the content again. Takes like 10-15 seconds to be ready to preview, client is very happy compared to the old setup which required a few mins of building to preview!