Reference
Upgrading from 1.x
Sites written for YASSB 1 build with YASSB 2 without changes, and produce the same pages. What changes is around them.
Steps
npm install --save-dev yassb-web@2
npx yassb checkyassb check lists what needs attention, starting with undeclared dependencies.
What changed
- Node.js 20+ or Bun is required.
- Fewer dependencies. YASSB no longer installs packages it does not need: react, react-dom, fs-extra, cheerio, lodash, moment, webpack, ts-node, typescript and others. If your code imports one of them without declaring it in
package.json, the build stops withCONFIG_MODULE_NOT_FOUNDand tells you what to install;yassb checkreports them in advance asUNDECLARED_DEPENDENCY. - esbuild instead of webpack for scripts: same file name, no separate
.LICENSE.txtfile. AwebpackConfigstill works if webpack is installed in your site. - TypeScript without ts-node: configuration and site code are compiled with esbuild, faster, with the same
__dirnamebehaviour. - Watch mode rebuilds in a fresh process, watches the whole project and shows errors in the browser.
Fixed
optionscontaining arrays ({"order":["a","b"]}) were silently ignored and the block disappeared.$$and$&in content were altered when inserted into pages.basicElementwrote<undefined>elements without atagoption; it now writesspan, as documented.- An element with both
data-attr-tanddata-tlost its text translation. - Watch mode reloaded the browser before the rebuild was finished.
New
yassb inspect, yassb check, yassb docs, --strict, --clean, --json, sourcePath in renderer props, nested translation keys, i18n.allowHtml, sitemap: false, cleanOut, beforeBuild and afterBuild hooks, esbuildOptions, defineConfig, the error overlay and CSS hot swap in watch mode, and the feature catalogue.