github maizzle/framework v4.0.0-alpha.9

latest releases: v5.0.0-beta.25, v5.0.0-beta.24, v5.0.0-beta.23...
pre-release2 years ago

New features

Default Filters

The "Transform Content" Transformer has been renamed to "Filters".

When importing Transform Content as a standalone Transformer, you now need to import withFilters instead:

- const {transformContents} = require('@maizzle/framework')
+ const {withFilters} = require('@maizzle/framework')

const html = withFilters('<div uppercase>test</div>')

We've added some default filters, inspired by Shopify's Liquid filters.

Only string-related filters are available, and they currently do not work on tags that contain other tags.

This works:

<div uppercase>test</div>

This doesn't (yet):

<div uppercase>test <span>text</span></div>

These are the filters currently available:

  • append="text"
  • prepend="text"
  • uppercase
  • lowercase
  • capitalize
  • ceil
  • floor
  • round
  • escape
  • escape-once
  • lstrip
  • rstrip
  • trim
  • minus="2"
  • plus="2"
  • times="2" or multiply="2"
  • divide="2" or divide-by="2"
  • modulo="2"
  • newline-to-br
  • strip-newlines
  • remove="text"
  • remove-first="text"
  • replace="this|withthis"
  • replace-first="this|withthis"
  • size
  • slice="startIndex"
  • slice="startIndex,endIndex"
  • truncate="20"
  • truncate="20, ..."
  • truncate-words="3"
  • truncate-words="3, ..."
  • url-decode
  • url-encode

Bundled executable

The Maizzle CLI is now available locally in your project.

The framework now includes a maizzle executable which means you no longer need to install the CLI globally and commands like npm run dev will work out of the box. This means getting started with Maizzle is now as easy as:

# Clone the Starter
npx degit maizzle/maizzle my-project

# Install dependencies
cd my-project

npm install

# Start local development
npm run dev

# Build emails for production
npm run build

Default prettify config

Maizzle will use a default config for the prettify Transformer.

We've tested this to make sure it does the best possible job at indenting your HTML.

These are the defaults, which you can of course override should you need to:

const defaultConfig = {
  space_around_combinator: true, // Preserve space around CSS selector combinators
  newline_between_rules: false, // Remove empty lines between CSS rules
  indent_inner_html: false, // Helps reduce file size
  extra_liners: [] // Don't add extra new line before any tag
}

Bugfixes

  • Fixed an issue where the baseURL Transformer only replaced the first VML src="" it encountered (#684, dd3621b)
  • Fixed an issue where Maizzle was compiling files with extensions that were not included in build.templates.filetypes 44a9864
  • Fixed an issue with the beforeCreate event not running at the very start of maizzle serve 9f9f7e4
  • Fixed an issue with the global watched Browsersync paths array 83c0c15

v4.0.0-alpha.8...v4.0.0-alpha.9

Don't miss a new framework release

NewReleases is sending notifications on new releases.