Skip to content

v0.21.0

Latest

Choose a tag to compare

@github-actions github-actions released this 29 Aug 22:16
Immutable release. Only release title and notes can be modified.

Writing down what was already true.

Both packages move together: @transclude/core and @transclude/create are
0.21.0.

npm install @transclude/core@latest

No behavior changed. What changed is that the promises this project makes are
now written in one place, and each one has a test holding it to the code.

Added

VERSIONING.md
is the compatibility policy
, and it is the only copy. What a patch, a minor
and a major each mean. The three tables covered — the config keys, the loader
context, the exports subpaths — with the test that pins each one.

And what is not covered, which is the half worth reading: a deep import past
exports, the wording of a refusal, and the shape of dist/. Those move.

The config has a type. createApp and withDefaults describe it as
Config rather than object, so an editor completes a config key and a typo in
one is an error rather than a silent no-op.

// transclude.config.js
export default {
  trailingSlash: 'never',   // 'never' | 'always' | 'ignore'
  csrf: true,
  onError: (error, at) => report(error, at.route),
};

Changed

The exports map is frozen to a list. It was the one promise nothing
pinned: the documentation already said the config keys and the loader context
were settled and held to the code, and both were, while a subpath could have
been renamed in a manifest edit that nobody read as the major it is. Twelve
subpaths, and the test fails in both directions.

Nothing was renamed. The list is what 0.20.0 shipped.

Fixed

onError is documented with the arguments it actually receives. It is
called with the error and a second object describing where — the request, the
URL, the method, the route and the phase. The first type written for it said one
argument, and the framework's own gate caught that on the way in.

Worth knowing

Writing the config type took app.js from 54 type errors to 28, and the
framework's own source from 430 to 403. Those numbers are not on their way to
zero and are not meant to be: a curated set of error codes that cannot be false
positives already fails the build, and most of what sits under that is the shape
of an HTML parser's node, which the compiler walks loosely on purpose.

The work is typing the tables this project promises, not making a number
smaller.