Fragments were answered with the whole document on Cloudflare Workers. If you
deploy there, this is the release to take.
Both packages move together: @transclude/core and @transclude/create are
0.8.0.
npm install @transclude/core@latestFixed
?fragment= returned the whole page on workerd. Every config default was
applied by loadProject, which reads a disk, so only Node ever applied them. A
worker imports transclude.config.js and hands the app exactly what the author
wrote, so a config that did not name fragmentParam left it undefined. That
reads as "no parameter configured", and the request falls through to the
document.
The visible symptom is a swap writing a second copy of the page into the element
it was meant to replace. It looks like a compiler bug and it was a missing
default.
// this was enough to be affected
export default {
appDir: 'app',
stylesheet: 'app/styles/global.css',
};createApp applies the defaults now, on its first line, so no runtime and no
hand-written entry can miss them. A key you wrote still wins, including a falsy
one, so fragmentParam: null turns the parameter off as it always did.
Nothing changes for Node, Bun or Deno, which were reading the same defaults
already. On workerd, a fragment request that was answered with a document is
answered with the fragment. If you worked around this in a client, take the
workaround out.
A cookieSecret set to an empty string now says so. It said "needs a
secret", which sends you through the wiring while looking at a secret that is
plainly set. Every typeof along the way says string, because '' is one.
On a worker the usual cause is a wrangler secret put that took a blank line.
New
workerFrom is the worker entry, minus the wiring. Parsing the manifest,
wrapping each byte map and building the app on the first request is the same in
every app, so it moved into the package.
// worker.js
import { workerFrom } from '@transclude/core/worker';
import * as bundle from './dist/server/assets.js';
import * as entry from './dist/server/entry.js';
import manifest from './dist/routes.json';
import config from './transclude.config.js';
export default workerFrom({ config, manifest, entry, bundle });The imports stay in your file, because a bundler needs a literal path to follow.
cookieSecret comes from env.COOKIE_SECRET when there is one, since that is
the only piece of config a worker cannot read at import time. For anything else,
call createApp from @transclude/core/app yourself: the long form still works
and is what this replaced.
Existing entries keep working. There is nothing to change.
Also
Every example runs on the web now, one per subdomain, each built from the same
source you would clone. todomvc.transclude.dev
ships zero bytes of JavaScript, which is easier to believe when you can open it.
The examples page links all nine.
Compared to other tools is new: Astro,
Enhance, htmx, Eleventy, Nue and the client frameworks, each with a paragraph on
where it is the better answer.
Decisions and limits gained a
Before 1.0 section, splitting what is settled from what may still move.
Full documentation at transclude.dev.
A note on the version
Below 1.0, a minor may break something. This one does not. It adds an export
and fixes a default that was only ever missing on one runtime.
Full changelog: v0.7.0...v0.8.0