Skip to content

Releases: Elderjs/elderjs

v1.0.0

22 Sep 18:31
Compare
Choose a tag to compare

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:

  1. link helper is removed from templates. You can access it at helpers.permalinks the same way as before so link.blog({slug: "foo"}) becomes helpers.permalinks.blog({slug: "foo"})
  2. routeHtml or routeHTML in the Layout.svelte in the Elder.js template has been changed to templateHtml. If your getting no output from your templates this is your issue. Rename this variable and things should work again.
  3. 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.
  4. process.browser replacements in rollup.config are now 'process.env.componentType' which will return browser or server. Remember process.env variables are strings. so process.env.componentType === 'server' is the correct way to check if a component is rendering on the server.
  5. There was a major rework to the elder.config.js. If you defined anything in the elder.config.js under the locations key you'll need to rework those into the distDir, srcDir, and rootDir.
  6. siteUrl in elder.config.js was changed to origin and you'll get an error if you don't set it.
  7. Remove automatic checking for a tsconfig. If you want to use typescript, please set your srcDir to the build folder found in your tsconfig.

File / Hook Changes:

  1. The ./src/assets/ folder has been moved to ./assets/ (project root).
  2. You'll need to update your copyAssetsToPublic hook as shown below.
  3. 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

09 Sep 18:28
Compare
Choose a tag to compare
  • Fixes stacks being processed backwards.
  • Allows for full customization of the head by moving hardcoded elements to hooks. #13

v0.1.0

02 Sep 14:32
Compare
Choose a tag to compare
  • 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.

v0.0.24

25 Aug 22:40
Compare
Choose a tag to compare
chore(version bump): version Bump