Releases: Elderjs/elderjs
Releases · Elderjs/elderjs
v1.0.0
Elder.js v1.0.0
Elder.js is now used on 4 flagship properties. Major features will slow down, main focuses will be on supporting plugin development, improving / adding options to rollup.config.js
, polishing the build
functionality, and bugfixes as needed.
Upgrading to v1.0.0:
Below are the breaking changes between v1 and earlier versions:
link
helper is removed from templates. You can access it athelpers.permalinks
the same way as before solink.blog({slug: "foo"})
becomeshelpers.permalinks.blog({slug: "foo"})
routeHtml
orrouteHTML
in the Layout.svelte in the Elder.js template has been changed totemplateHtml
. If your getting no output from your templates this is your issue. Rename this variable and things should work again.- The order of stacks and hook priorities have been reversed. This may cause hooks to run out of order. Please look at your hooks. Before this update, hooks with a priority of 1 where the highest priority, now they are the lowest.
process.browser
replacements in rollup.config are now 'process.env.componentType' which will returnbrowser
orserver
. Remember process.env variables are strings. soprocess.env.componentType === 'server'
is the correct way to check if a component is rendering on the server.- There was a major rework to the
elder.config.js
. If you defined anything in theelder.config.js
under thelocations
key you'll need to rework those into thedistDir
,srcDir
, androotDir
. siteUrl
in elder.config.js was changed toorigin
and you'll get an error if you don't set it.- Remove automatic checking for a tsconfig. If you want to use typescript, please set your
srcDir
to the build folder found in yourtsconfig
.
File / Hook Changes:
- The
./src/assets/
folder has been moved to./assets/
(project root). - You'll need to update your
copyAssetsToPublic
hook as shown below. - You'll need to update your
rollup.config.js
to be updated as shown below.
// hooks.js
// replace your old copyAssetsToPublic
{
hook: 'bootstrap',
name: 'copyAssetsToPublic',
description:
'Copies /src/assets/ to the assets folder defined in the elder.config.js. This function helps support the live reload process.',
run: ({ settings }) => {
// note that this function doesn't manipulate any props or return anything.
// It is just executed on the 'bootstrap' hook which runs once when Elder.js is starting.
// copy assets folder to public destination
glob.sync(path.join(settings.rootDir, '/assets/**/*')).forEach((file) => {
const parsed = path.parse(file);
// Only write the file/folder structure if it has an extension
if (parsed.ext && parsed.ext.length > 0) {
const relativeToAssetsArray = parsed.dir.split('assets');
relativeToAssetsArray.shift();
const relativeToAssetsFolder = `.${relativeToAssetsArray.join()}/`;
const p = path.parse(path.resolve(settings.distDir, relativeToAssetsFolder));
fs.ensureDirSync(p.dir);
fs.outputFileSync(
path.resolve(settings.distDir, `${relativeToAssetsFolder}${parsed.base}`),
fs.readFileSync(file),
);
}
});
},
},
// replace your old rollup.config.js
const { getRollupConfig } = require("@elderjs/elderjs");
const svelteConfig = require("./svelte.config");
module.exports = [...getRollupConfig({ svelteConfig })];
v0.1.5
v0.1.0
- Integrated data.js into route.js and began deprecating data.js.
- Added helper function to inline Svelte Components into html.
- Refactor of ejs hydration signature under the hood so that if it changes in the future it won't impact users.
- Added siteUrl to the config as it will be needed by plugins.