Skip to content

Releases

v0.41.1

Choose a tag to compare

@github-actions github-actions released this 10 Nov 04:17
Immutable release. Only release title and notes can be modified.
8062861

Fixed: a filter argument followed by a colon, such as where_exp: 'a', 'a0': or append: a.b:, now returns ErrUnsupported. liquidjs reads it as a keyword argument, and mist used to drop the colon and render it as a positional argument, which could disagree with liquidjs.

Upgrading: no API changes. Templates with that malformed syntax that rendered before now bail; nothing else changes. SPEC is v0.41.x.

Changelog

Fixes

  • 8062861: fix: bail on any filter argument followed by ':', which liquidjs reads as a keyword argument. (#167) (@hownowstephen)

Other

v0.41.0

Choose a tag to compare

@github-actions github-actions released this 10 Nov 03:53
Immutable release. Only release title and notes can be modified.
e6851c4

New: Engine.Reads reports which variables a template can read, and which keys of each, so a caller that stores data granularly (one snippet or attribute per row) can load only those before rendering. A nil key list means the template reads the whole value: bare use, a computed first index such as customer[customer.attr], size, a range bound or a counter. all is true when a custom tag is used, and an error is Check's; load everything in either case. Names are over-reported (assigns and loop variables), never under-reported.

Upgrading: no breaking API changes; rendering is unchanged. SPEC is v0.41.x.

Changelog

Features

  • e6851c4: feat: Engine.Reads reports which variables and keys a template reads, for loading only those (#164) (@hownowstephen)

v0.40.0

Choose a tag to compare

@github-actions github-actions released this 06 Nov 19:09
Immutable release. Only release title and notes can be modified.
7fa4918

mist now lives at github.com/customerio/mist. This is the first release under that module path.

Changed: the module path is github.com/customerio/mist (formerly github.com/hownowstephen/mist). where, reject, find, find_index, has and group_by now bail with where-computed-key on a property path starting with size, first or last when the item lacks that key, where liquidjs reads its globals. String escape digits stop at control characters 0x10-0x19, as in liquidjs.

Upgrading: replace the import path github.com/hownowstephen/mist with github.com/customerio/mist and run go mod tidy. There are no other API changes since v0.39.0. Templates using the newly bailing paths now return ErrUnsupported instead of output that differed from liquidjs. SPEC is v0.40.x.

Changelog

Fixes

  • 9b50ded: fix: string escape digits stop at control characters 0x10-0x19, as in liquidjs (#156) (@hownowstephen)
  • 30fcc11: fix: bail on property paths starting with size, first or last when the item lacks that key, which liquidjs reads from its globals (#161) (@hownowstephen)
  • 42c9fec: fix: corpus test compares undefined errors as oracle.mjs records them (#162) (@hownowstephen)

Other

v0.39.0

Choose a tag to compare

@github-actions github-actions released this 24 Oct 00:06
Immutable release. Only release title and notes can be modified.
e55c04f

New: Filter.InputUndefined and Filter.ArgUndefined report whether a nil input or argument is JavaScript's undefined or null, so a registered filter can print them as String() does. Undefined is a missing variable, a property of undefined, or a built-in filter's undefined result such as find_exp with no match; a property of null is null.

Upgrading: no breaking API changes. Input and Args are still nil for both. SPEC is v0.39.x.

Changelog

Features

v0.38.0

Choose a tag to compare

@github-actions github-actions released this 22 Oct 18:30
Immutable release. Only release title and notes can be modified.
1a3f121

New: Filter.Now is the engine's clock, Engine.Now or time.Now when that's nil, so a registered filter that reads the current time sees the same clock as date, including a pinned or wrapped one.

Upgrading: no breaking API changes. date reads the same clock as before. SPEC is v0.38.x.

Inside: allocation checks still pass.

Changelog

Features

v0.37.0

Choose a tag to compare

@github-actions github-actions released this 22 Oct 03:44
Immutable release. Only release title and notes can be modified.
340297d

New: Location loads an IANA zone name as the date filter does, for dialects and filters that take zone names. It rejects the names Go loads but JavaScript's Intl rejects (Local, Factory and zoneinfo's support files), and caches what it loads.

Upgrading: no breaking API changes. date uses Location, and its bail codes are unchanged. SPEC is v0.37.x.

Changelog

Features

v0.36.0

Choose a tag to compare

@github-actions github-actions released this 22 Oct 02:48
Immutable release. Only release title and notes can be modified.
2513a4c

New: Dialect.RubyLookups looks variables up as Ruby Liquid does. A nil or false first segment is the whole lookup's value, so {{ c.x }} with c false prints false, and past the first segment a property or index of nil or false is undefined, so it's an ErrUndefined under strict variables.

Upgrading: no breaking API changes. RubyLookups is off by default, and liquidjs parity is unchanged. SPEC is v0.36.x, and also describes the malformed-number, string-type and same-value-type bails.

Inside: the PR drift check runs when the package's Go files change. Allocation checks still pass.

Changelog

Features

Other

  • 6b2bd14: docs: describe the malformed-number, string-type and same-value-type bails in SPEC, and add an if/unless row. (#149) (@hownowstephen)
  • d37cf7c: chore: run the PR drift check when the package's Go files change, since they decide which renders mist accepts. (#148) (@hownowstephen)

v0.35.2

Choose a tag to compare

@github-actions github-actions released this 21 Oct 01:43
Immutable release. Only release title and notes can be modified.
03a2075

Fixed: an undefined variable inside a where_exp, reject_exp, find_exp, find_index_exp, has_exp or group_by_exp expression counts its Line and Col from the expression string, which liquidjs parses as its own input. Before, they were counted against the outer template, so the error didn't match liquidjs's message. Pos still points at the filter.

Upgrading: no API changes. SPEC is v0.35.x; its strict undefined error row now says how these count.

Inside: scripts/latest/drift.txt lists two cases that differ under the newest liquidjs, and the PR drift check also runs when cases.json or corpus.json changes.

Changelog

Fixes

  • 7b9a8df: fix: an undefined variable inside a *_exp expression counts its Line and Col from the expression, as liquidjs does. (#146) (@hownowstephen)

Other

  • 03a2075: chore: rewrite drift.txt for two new cases, and run the PR drift check when cases.json or corpus.json changes. (#147) (@hownowstephen)

v0.35.1

Choose a tag to compare

@github-actions github-actions released this 20 Oct 20:42
Immutable release. Only release title and notes can be modified.
9a6f372

Fixed: an error from a template a custom tag renders with Tag.Render keeps the Line, Col and Path its own render set, so they count from the inner template, as liquidjs's do. Before, they were recomputed against the outer template at the inner error's offset. Pos still points at the tag.

Upgrading: no API or SPEC changes. SPEC is v0.35.x.

Inside: every SPEC.md rule links to the cases.json cases that test it, and TestSpecLinks fails on a rule or bail code with no case; testdata/codes.txt loses a false CODE entry; SPEC's corpus regenerate steps reuse the committed generated cases.

Changelog

Fixes

Other

v0.35.0

Choose a tag to compare

@github-actions github-actions released this 19 Oct 17:00
Immutable release. Only release title and notes can be modified.
77c1d05

New: an ErrUndefined carries liquidjs's own error. Error.Path is the keys liquidjs's message names, up to and including the first undefined one, with bracket indexes as their values' JavaScript strings and forloop's property included. Error.Line and Error.Col are Pos as liquidjs counts it: lines split on \n, columns in UTF-16 code units, both from 1. So liquidjs's message is "undefined variable: " + strings.Join(Path, ".") + ", line:Line, col:Col". Path is nil where mist can't vouch for that message, including a template that doesn't pass Check, since liquidjs parses the whole template first and may report a later error instead.

Upgrading: no breaking API changes. ErrUndefined is returned exactly where it was, and Msg still names the whole path as written. Line and Col are set on every *Error. SPEC is v0.35.x.

Inside: TestCorpus requires liquidjs's exact message wherever Path is set, and all 898 undefined errors in the corpus match. Append stays allocation-free.

Changelog

Features