v0.3.0
A project needs one fewer config file, your editor checks the JavaScript it was
already reading, and the types the compiler writes compile for the first time.
Both packages move together: @transclude/core and @transclude/create are
0.3.0.
npm install @transclude/core@latestBefore you upgrade
npm run check now reads transclude-env.d.ts for real. It never did. Every
context type in that file named __Cookies and the file declared it nowhere, in
every project, from the first check anyone ran. A .d.ts is the one kind of file
skipLibCheck skips, and both things that could have reported it passed that
option: bin/check.js passed it to the program written to catch exactly this,
and a jsconfig.json implies it. So the check ran and read nothing.
The compiler emits those declarations now, so a project that was fine stays fine.
A project using a type the emitter cannot express will see an error where there
was silence. That is the fix working.
New
A page can write attributes onto <body>.
<body class="docs" data-theme="${theme}">Same rule <html> already had: the chain merges by name, and the innermost level
wins per attribute.
Changed
A project does not need a vite.config.js. Both templates ship without one.
The bins hand Vite the compiler themselves, so the file only existed to repeat
what they already do.
Keeping yours is fine and changes nothing: a second registration of the plugin is
ignored. Deleting it is worth doing, because Vite merges the two lists rather than
deduping them, and the second copy scanned your app again on every build and added
a second dev watcher that reloaded the browser twice for one edit.
Write one when you want another Vite plugin, and put only that in it:
import { defineConfig } from 'vite';
import tailwind from '@tailwindcss/vite';
export default defineConfig({
plugins: [tailwind()],
});A new project's jsconfig.json turns on checkJs. Your editor reported
nothing about the app's .js files while transclude-check ran the same files
with checking on. Two answers to one question, and the quiet one was the one you
saw. It also excludes app/public, which holds files you did not write, and sets
maxNodeModuleJsDepth to 0 so a dependency's own JavaScript is not checked.
An existing project keeps its own jsconfig.json. Adopting the new one is three
keys.
Fixed
A worker entry no longer drags the build output into your editor.
worker.js imports dist/server/entry.js, which put twenty errors about
generated code in front of anyone with checkJs on. The build writes a
@ts-nocheck banner on that file.
dev works in a project with no Vite config. It passed no plugins at all and
took the whole compiler from the app's own file, so removing that file answered
every page with a 500 while the build carried on working.
Also
The compiler had one rule written down three times: the expression that parses
each="item, i of items" lived in three files that each do something different
with the answer. The list of void elements, the compile-time escaper and the
substitution that turns /people/:name into a URL were each written twice. They
have one home now.
Merging them is how three gaps in the tests turned up. Deleting br from the
void list broke nothing, and neither did dropping any of the four escape
replacements. Both are covered now.
Full documentation at transclude.dev.
A note on the version
Below 1.0, a minor may break something. This one should not: an existing
project keeps its config files and its behavior. The one place it can surprise
you is the check above, which now reports a file that was never being read.
Full changelog: v0.2.0...v0.3.0