

Or rather - it does that unless the file is static, in which case it just calls send_file.īut regardless - the underlying Rack server in the Middleman preview server has the capability to dynamically render pages. That render call dynamically renders through the data and templates and returns a response - all in memory, rather than acting as just a static file server. Then it queries the for the resource that matches, using by_destination_path.Īt that point, it calls render on the Resource object that the sitemap gives back. Process_request runs on all call requests, and it builds a request_path from the Rack environment. In that Rack file, Middleman preview server is doing something like this (as far as I can estimate): It is actually acting as a dynamic server and doing something similar to server-side rendering. Turns out, that's not exactly what it's doing. I thought it was running the equivalent of bundle exec middleman build and then acting as an HTTP server from the generated public/ dir. I had some initial misunderstandings about what the Middleman preview server is doing behind the scenes.
Middleman build environment full#
Full MR here.īut even targeting specific destination paths or resources was still taking longer than I think we would like. My first thought was to do something like Chad Wooley's OnlyDebuggedResources extension. In depth details for the interested Initial intuitionĪfter my day off on Friday, and some space away from Middleman, I woke up on Saturday with some inspiration about how we could pick up a lot of efficiency.

This MR provides an opt-in monkeypatch to two internal Middleman methods, which will allow a developer to make changes to Middleman template files without triggering a full sitemap rebuild. Right now the digital experience is exploring these challenges. There have been many epics, issues, MRs, and meetings about it. Developing templates in Middleman with the preview server is exceedingly slow.
