🐛 Let --base decide where the built site lives - #1248
Merged
Merged
Conversation
commit: |
Merging this PR will improve performance by 10.13%
|
| Mode | Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|---|
| ⚡ | Memory | effection-inline.recursion |
5.4 KB | 4.9 KB | +10.13% |
Tip
Curious why performance improved? Comment @codspeedbot explain why performance improved on this PR, or directly use the CodSpeed MCP with your agent.
Comparing tm/staticalize-base (85804a6) with v4 (61a2219)
Contributor
|
🚀 Deploy Preview Ready!
|
taras
force-pushed
the
tm/staticalize-base
branch
from
September 27, 2026 19:01
ecd4624 to
5068508
Compare
cowboyd
approved these changes
Sep 27, 2026
taras
added this pull request to stack #1251
September 27, 2026 19:21
taras
force-pushed
the
tm/staticalize-base
branch
from
September 27, 2026 19:36
5068508 to
317cbe5
Compare
taras
removed this pull request from stack #1251
September 27, 2026 19:42
taras
force-pushed
the
tm/staticalize-base
branch
from
September 27, 2026 19:45
317cbe5 to
3f18cde
Compare
taras
added this pull request to stack #1254
September 27, 2026 19:46
taras
force-pushed
the
tm/staticalize-base
branch
from
September 27, 2026 19:52
3f18cde to
10d2858
Compare
taras
force-pushed
the
tm/staticalize-base
branch
from
September 27, 2026 19:59
10d2858 to
334d3aa
Compare
llms.txt and feed.xml hardcoded https://frontside.com/effection, so every copy advertised production no matter where it was served from: locally llms.txt sent agents away from the dev server they were reading it on, and a preview sent reviewers to production. They now emit the origin that served them, and staticalize 0.3.0 rewrites them on the way out — it honours the path of --base and rewrites textual bodies, neither of which it could do before. That makes --base the only place a deployment says where it lives: the canonical url in production, and its own alias url in a preview, which also settles the html, since previews have been rewriting theirs to production all along. The crawl now passes --concurrency and --retries explicitly. 0.3.0 rejects the invocation without them, where 0.2.6 applied its documented defaults. The pagefind crawl stays on 0.2.7: its base is its own origin, so it has nothing to rewrite, and pinning it forward would make the dev server wait out deno's minimum dependency age on the day of a release.
taras
force-pushed
the
tm/staticalize-base
branch
from
September 27, 2026 21:51
334d3aa to
85804a6
Compare
This was referenced Sep 28, 2026
taras
added a commit
to thefrontside/interactors
that referenced
this pull request
Sep 28, 2026
The deploy staticalized with `--base=https://interactors.netlify.app`, so every page told Google the canonical copy was the Netlify one: frontside.com/interactors/docs/quick-start <link rel="canonical" href="https://interactors.netlify.app/docs/quick-start"> frontside.com proxies this site and serves the same pages, so the two are duplicates of each other, and the canonical pointed at the copy nobody links to. The site frontside.com serves was disclaiming its own content. The base is now the url readers actually visit. `useAbsoluteUrl` already builds the canonical from the crawl origin, so staticalize rewrites it along with `og:url` and every internal link; 0.3.0 is what honours the path in `--base`, which is why this rides with that upgrade rather than going first. thefrontside/effection#1248 did the same for Effection. Graphgen is still to do, and emits no canonical at all.
This was referenced Sep 28, 2026
Merged
Closed
Merged
taras
added a commit
that referenced
this pull request
Sep 28, 2026
#1248 pointed the production `--base` at frontside.com/effection to get the canonical right. That moved every other url with it, including the sitemap, and frontside.com prefixes `/effection` onto a proxied sitemap whose entries now already carried it. 519 urls 404'd and its deploys have failed since. staticalize 0.3.1 separates the two. `--base` is where the bytes are again, so the Netlify copy is readable on its own and its sitemap says so; `--canonical` is the address readers arrive at, and only the urls that name the page follow it. That makes the site's own copy of the idea redundant. `canonical()` had been rebasing onto a configured origin, which is exactly what staticalize now does, so it is gone along with the `base` field and the `--base` option — which also ends this project having two different flags by that name. What `app.html.tsx` needs is the url of the page being served, so that is what it asks for: `currentUrl()`, a plain operation rather than a member of the api. Calling it `canonical` would have named it after what the crawl does to it. Dropping the member also drops the `Api<UrlApi>` annotation, which only existed because a member reached back through the api for another. Verified against the real site: canonical, og:url and both hreflang alternates name frontside.com; og:image and the sitemap name Netlify; the sitemap has no doubled paths; and llms.txt still names the published site, which is what #1248 wanted. 0.3.1 also restored the default for `--retries`, so the flag 0.3.0 forced us to pass goes away with it.
taras
added a commit
that referenced
this pull request
Sep 28, 2026
#1248 pointed the production `--base` at frontside.com/effection to get the canonical right. That moved every other url with it, including the sitemap, and frontside.com prefixes `/effection` onto a proxied sitemap whose entries now already carried it. 519 urls 404'd and its deploys have failed since. staticalize 0.3.1 separates the two. `--base` is where the bytes are again, so the Netlify copy is readable on its own and its sitemap says so; `--canonical` is the address readers arrive at, and only the urls that name the page follow it. That makes the site's own copy of the idea redundant. `canonical()` had been rebasing onto a configured origin, which is exactly what staticalize now does, so it is gone along with the `base` field and the `--base` option — which also ends this project having two different flags by that name. What `app.html.tsx` needs is the url of the page being served, so that is what it asks for: `currentUrl()`, a plain operation rather than a member of the api. Calling it `canonical` would have named it after what the crawl does to it. Dropping the member also drops the `Api<UrlApi>` annotation, which only existed because a member reached back through the api for another. Verified against the real site: canonical, og:url and both hreflang alternates name frontside.com; og:image and the sitemap name Netlify; the sitemap has no doubled paths; and llms.txt still names the published site, which is what #1248 wanted. 0.3.1 also restored the default for `--retries`, so the flag 0.3.0 forced us to pass goes away with it.
taras
added a commit
that referenced
this pull request
Sep 30, 2026
* 🐛 Name the published site with --canonical instead of --base #1248 pointed the production `--base` at frontside.com/effection to get the canonical right. That moved every other url with it, including the sitemap, and frontside.com prefixes `/effection` onto a proxied sitemap whose entries now already carried it. 519 urls 404'd and its deploys have failed since. staticalize 0.3.1 separates the two. `--base` is where the bytes are again, so the Netlify copy is readable on its own and its sitemap says so; `--canonical` is the address readers arrive at, and only the urls that name the page follow it. That makes the site's own copy of the idea redundant. `canonical()` had been rebasing onto a configured origin, which is exactly what staticalize now does, so it is gone along with the `base` field and the `--base` option — which also ends this project having two different flags by that name. What `app.html.tsx` needs is the url of the page being served, so that is what it asks for: `currentUrl()`, a plain operation rather than a member of the api. Calling it `canonical` would have named it after what the crawl does to it. Dropping the member also drops the `Api<UrlApi>` annotation, which only existed because a member reached back through the api for another. Verified against the real site: canonical, og:url and both hreflang alternates name frontside.com; og:image and the sitemap name Netlify; the sitemap has no doubled paths; and llms.txt still names the published site, which is what #1248 wanted. 0.3.1 also restored the default for `--retries`, so the flag 0.3.0 forced us to pass goes away with it. * 📦 Take staticalize from npm rather than jsr Deno's minimum dependency age refuses a jsr version for its first 24 hours, which is why the pagefind route sat on 0.2.7 while the deploy moved on: the comment on that pin says pinning it forward would make the dev server wait out the policy on the day of a release. npm resolution is not subject to it, so both callers can name the version the deploy uses. `npm:staticalize@0.3.1` is the same program — the package publishes a `bin` rather than a `/cli` export, so the specifier loses its subpath. Verified both callers against the running site: the deno task and the exact command the pagefind route execs each crawled 505 pages and 21 assets with no errors. --------- Co-authored-by: Taras Mankovski <74687+taras@users.noreply.github.com>
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
llms.txtandfeed.xmlhardcodedhttps://frontside.com/effection, so every copy advertised production no matter where it was served from. Locally that meantllms.txtpointed agents away from the dev server they were reading it on; in a preview it pointed reviewers at production.They hardcoded it because staticalize could not rewrite them: it only touched HTML, and
--basedropped its path component, so a site published under/effectioncould not be expressed at all. staticalize 0.3.0 fixes both (#12, #13, #14).Approach
llms.txtandfeed.xmlemit the origin that served them, through theuseAbsoluteUrlFactory()the site already has. No new helper and no environment variable: the build rewrites them.--baseis now the only place a deployment says where it lives. Production passeshttps://frontside.com/effection, the canonical url, which 0.3.0 can express. A preview passes its own alias url, computed before the server starts — fork PRs deploy anonymously to a url nobody knows in advance, so they fall back to the netlify site.--base=https://effection.netlify.appall along, so every rewritten absolute url in a preview pointed at production. Now a preview points at itself.environment.urlpoints at the alias deploy, so the link in the checks panel is the one the build's urls were written for. The per-commit snapshot url is still in the sticky comment.--concurrency=75 --retries=3. It has to: see below.0.2.7. Its base is its own origin, so it has nothing to rewrite, and pinning it forward would make the dev server wait out Deno's 24-hour minimum dependency age on the day of a release.Verification
Ran the actual site with no
SITE_URLof any kind and built it with the 0.3.0 binary and the production base — 513 pages, 21 assets:llms.txtfeed.xml<guid>values identical to the live feed, so no subscriber sees a re-flagged postsitemap.xml<url>entries with canonical<loc>, valid schema at lastindex.htmlog:imagenowhttps://frontside.com/effection/assets/…rather than the netlify hostlocalhostleft in any of the 528 filesServed without the build,
llms.txtsayshttp://localhost:8130/api/, which is the original complaint.deno fmt --check(238 files),deno lint(198 files) anddeno task test(37 passed, 241 steps) are clean.A regression to be aware of
The v0.3.0 release binary rejects the arguments this workflow has always used:
v0.2.6 accepts the same command and applies the defaults its
--helpdocuments. Passing--concurrency=75 --retries=3works around it, which is what this PR does; the flags can come out once the defaults are restored upstream.Supersedes
Replaces #1246, which solved the same problem with a
SITE_URLenvironment variable because staticalize could not. This is smaller — no helper, no env var, no dev-task wiring — and it fixes preview HTML, which #1246 did not.