Skip to content

Releases: noelforte/eleventy-plugin-vento

v4.0.1

06 Nov 00:06
Compare
Choose a tag to compare

Patch Changes

  • hotfix - include types field in package.json to declare bundled types

v4.0.0

05 Nov 23:54
ab495b2
Compare
Choose a tag to compare

Major Changes

  • fc80b5f: Removed ignore tag {{! ... }} syntax. As mentioned in the 3.3.0 release notes, the now preferred way to "pass through" tags is with string literals.

    You should update code with {{! ... }} to be {{ '{{ }}' }} like so:

    - {{! if condition }}
    + {{ '{{ if condition }}' }}
        do something
    - {{! /if }}
    + {{ '{{ /if }}' }}

    While more verbose, this change ensures that there isn't any ambiguity between a tag that needs ignoring and JS negation expressions.

Minor Changes

  • 2b5f337: Rewrite project in Typescript and add a build/packaging step for releases and testing.

    These changes also include .d.ts generation as part of the build step. If you're using 11ty.ts's defineConfig function, it will pick the types from this plugin up automatically. (resolves #22)

v3.4.0

05 Nov 01:26
Compare
Choose a tag to compare

Minor Changes

  • 8c6b8a2: Update ventojs to v1.12.11

v4.0.0-beta.0

31 Oct 20:10
d136718
Compare
Choose a tag to compare
v4.0.0-beta.0 Pre-release
Pre-release

Major Changes

  • fc80b5f: Removed ignore tag {{! ... }} syntax. As mentioned in the 3.3.0 release notes, the now preferred way to "pass through" tags is with string literals.

    You should update code with {{! ... }} to be {{ '{{ }}' }} like so:

    - {{! if condition }}
    + {{ '{{ if condition }}' }}
        do something
    - {{! /if }}
    + {{ '{{ /if }}' }}

    While more verbose, this change ensures that there isn't any ambiguity between a tag that needs ignoring and JS negation expressions.

Minor Changes

  • 2b5f337: Rewrite project in Typescript and add a build/packaging step for releases and testing.

    These changes also include .d.ts generation as part of the build step. If you're using 11ty.ts's defineConfig function, it will pick the types from this plugin up automatically. (resolves #22)

v3.3.0

30 Oct 18:23
Compare
Choose a tag to compare

Minor Changes

  • 387eb48: ⚠️ DEPRECATION NOTICE: Ignore tag {{! ... }} syntax is now deprecated and will be removed in 4.0.0.

    This change comes in favor of using string literals to "pass through" tags without rendering them, like so:

    - {{! if condition }}
    + {{ '{{ if condition }}' }}
        do something
    - {{! /if }}
    - {{ '{{ /if }}' }}

    While more verbose, this change ensures that there isn't any ambiguity between a tag that needs ignoring and JS negation expressions:

    <!-- These are functionally equivalent and can lead to collisions in rendering functionality -->
    
    {{! conditionStatementToIgnore }}
    
    {{ !conditionStatementToIgnore }}

    If an improved syntax for deferred rendering scenarios ever makes its way to Vento, it will be made available in this plugin.

v3.2.0

30 Oct 03:13
36a9942
Compare
Choose a tag to compare

Minor Changes

  • f9388e1: Further refine caching between Eleventy and Vento: commit ec02a76 deferred all caching to Vento and turned off Eleventy's cache (released in 3.1.0). This release allows Vento to cache only the templates that Eleventy can't cache (permalinks, includes, etc.), and Eleventy caches everything else.

    A performance oversight has also been resolved by this change. Now, template functions are pre-compiled and saved by Eleventy, only running the template on render without having to go through a re-compile or get a template from the cache.

Patch Changes

  • 693e1a2: Refactored the following features internally:

    • Reverts 2c3548c for modularity: The compatibility check has moved back to modules/utils.js
    • Revises caching further: Instead of deferring to Vento for everything, permalink templates and templates loaded by Vento (like includes) are cached by Vento. Everything else is cached by Eleventy.
    • Rename some internal variables to help with readability (_11ty.ctx => _11Ctx)
    • DEBUG key Eleventy:Vento:Template renamed to Eleventy:Vento:Render
    • Declare engine functions separately and return as an object after everything has been declared.

v3.1.0

24 Oct 23:27
bb128ce
Compare
Choose a tag to compare

NOTE: This release replaces the (now-unpublished) pre-release version 3.0.3-next.0. Users of this plugin should use 3.1.0.

Minor Changes

  • 7e6ba68: Separate shortcodes and pairedShortcodes into seperate object namespaces. Prior to this version, Eleventy shortcodes and paired shortcodes were merged into a single object keyed as _11ty.functions which allowed for naming collisions between shortcodes and their paired counterparts.

  • b8f0a03: Adds new dependency on debug package, to help out with testing and getting more verbose logs. The following DEBUG namespaces are implemented:

    • Eleventy:Vento:Setup - Logs initial setup of the plugin, loading features, pre-page compile setup steps (like changing page and eleventy objects)
    • Eleventy:Vento:Cache - Logs updates to Vento's own internal cache, which is used in tandem with Eleventy's cache.
    • Eleventy:Vento:Template - Logs rendered templates and other template related actions

    Because it is a child of the Eleventy: namespace, the following command will include output from this plugin as well:

    $ DEBUG='Eleventy:*' npx @11ty/eleventy

    Alternatively, use a finer grained namespace to see only the output generated by eleventy-plugin-vento.

    $ DEBUG='Eleventy:Vento:*' npx @11ty/eleventy
    $ DEBUG='Eleventy:Vento:Template' npx @11ty/eleventy

    See the docs on 11ty.dev as well as the debug package README for more information.

  • ec02a76: Further caching improvements to e811123 and e46ce6e. Eleventy now defers all template caching to Vento.

    Templates are now compiled directly instead of using Vento's .runString method which reduces overhead and enables this plugin to manage the Vento cache in a more direct manner.

  • 494b184: Permalink compilation optimizations:

    • Permalinks now short-circuit to raw strings if they don't contain Vento template syntax, avoiding compilation entirely.
    • Permalinks are now assigned (fake) pathnames in Vento's cache. If you change template content but don't change a dynamic permalink in development, Vento will reuse the compiled permalink template. Note that any modifications to a template file will always cause it to be recompiled (see 19c352fa) — this improvement just optimizes recompiling dynamic permalinks that haven't changed.

Patch Changes

  • 4b4b387: Entries for changed files are now deleted from Vento's cache when running the Eleventy Dev server. (fixes #38)

v3.0.2

14 Oct 20:29
f6273e4
Compare
Choose a tag to compare

Patch Changes

  • e46ce6e: Integrate eleventy and vento caching.

    There have been a few issues around managing Vento's cache that have yielded uninteded results when compiling templates (ie #10, #34). This update integrates Vento's cache with Eleventy's custom extension API.

    This means that whether running Eleventy in --serve mode or compiling dynamic permalinks, stale cache data actually gets removed so Vento can compile the template from source again.

    Raise any issues if caching behavior continues to be an issue!

v3.0.1

29 Sep 21:55
f82da47
Compare
Choose a tag to compare

Patch Changes

  • 9f5a90f: Various Refactors - These changes shouldn't have any observable effect on your templates or usage.

    • Replaced class based approach for a closure implementation instead. Since there was only 1 Vento env object ever instanced in this plugin, steering away from using class removes some complexity and overhead.

    • DATA_KEYS (used internally) moved into utils file alongside other utilities (like compatibility checks) and renamed to CONTEXT_DATA_KEYS.

    • Moved internal Vento/11ty data from env._11ty => env.utils._11ty. Previous versions mutated the Vento env object by adding an _11ty key with everything that needed accessing from within a template compile (shortcodes, filters, etc.). This was moved this back to env.utils._11ty since it's probably a more appropriate place to store these functions.

v3.0.0

21 Sep 04:12
6d47fd2
Compare
Choose a tag to compare

A massive thank you to @oscarotero for helping me understand the Vento engine, this release would not have been possible without him. There may be a few latent bugs, so be sure to raise issues as they come up.


Major Changes

  • 668700c: Enforce new minimum version — Eleventy v3.0.0-alpha.15 or later is now required for this plugin to function.

    Although this goes against the backwards compatibility ethos of Eleventy, the addition of the getShortcodes() and getPairedShortcodes() functions that were added in alpha.15 are now utilized in this plugin to bring even more goodness to your templates.

    Thanks @zachleat for making this possible!

  • 9d8eb8a: Adds complete support for Eleventy shortcodes and filters within Vento. Shortcodes are now loaded by default as Vento tags and will no longer be exposed as functions in your page data.

    The implementation of single shortcodes remains largely similar, just replace function-like calls with Vento tags.

    - {{ nametag('Noel', 'Forte') }}
    + {{ nametag 'Noel', 'Forte' }}

    Of course, the big news is that paired shortcodes are now officially supported by this plugin!! Prior to this release, paired shortcodes were exposed just like regular shortcodes, but were plain JS functions. With this release you can now use paired shortcodes just like any other tag.

    <!-- Before: everything is jammed into the function call :( -->
    {{ blockquote("<p>Call me Ishmael. Some years ago—never mind how long precisely—having little or no money in my purse, and nothing particular to interest me on shore, I thought I would sail about a little and see the watery part of the world.</p>\n<p>It is a way I have of driving off the spleen and regulating the circulation.</p>", "Herman Melville", "1851") }}
    
    <!-- After: opening and closing tags with arguments separated :) -->
    {{ blockquote 'Herman Melville', '1851' }}
      <p>Call me Ishmael. Some years ago—never mind how long precisely—having little or no money in my purse, and nothing particular to interest me on shore, I thought I would sail about a little and see the watery part of the world.</p>
      <p>It is a way I have of driving off the spleen and regulating the circulation.</p>
    {{ /blockquote }}

    Because these changes removed direct dependence on Eleventy JavaScript functions, the addHelpers option has been replaced with 3 new options: shortcodes, pairedShortcodes and filters. All of them are enabled by default but can be disabled in your plugin config like so.

    eleventyConfig.addPlugin(VentoPlugin, {
    - addHelpers: false,
    + shortcodes: false,
    + pairedShortcodes: false,
    + filters: false,
    });
  • 516cd2f: Modifications to auto_trim functionality

    Starting with this release the way the auto_trim plugin is implemented is a bit different.

    The plugin option trimTags is now autotrim. Be sure to update your plugin options object accordingly:

    eleventyConfig.addPlugin(VentoPlugin, {
    - trimTags: true
    + autotrim: true
    });

    Additionally, the eleventy plugin no longer re-exports defaultTags from ventojs. Be sure to remove any imports from your config:

    - import { ventoDefaultTrimTags } from 'eleventy-plugin-vento';

    To extend the default tags list, this plugin now provides a 2 placeholder values for your array of tags, @vento and @11ty. When the plugin executes, @vento will be expanded to the default vento tags list, and @11ty will be expanded to the names of all paired shortcodes.

    eleventyConfig.addPlugin(VentoPlugin, {
      autotrim: ['@vento', '@11ty', 'tag1', 'tag2'],
    });

    Setting autotrim: true is the same as autotrim: ['@vento', '@11ty'].

Minor Changes

  • ff75e09: Add option to explicitly enable tag ignore syntax.

    Prior to this release this feature was referred to as the "SSR" or "hybrid-rendering" syntax. It's purpose was to skip over processing a tag like Vento's built-in {{ echo }} tag, but with a much shorter syntax: {{! ... }}. Any code following a ! in your markup is wrapped in {{ }} and output as-is.

    {{!> console.log('Hello world'); }} <!-- tag remains in output -->

    In this release, this behavior is now explicitly opt-in. To enable it, include ignoreTag: true in the plugin options:

    eleventyConfig.addPlugin(VentoPlugin, {
      ignoreTag: true,
    });
  • b9e8232: Update ventojs to 1.12.10