Skip to content

Releases: Stillat/blade-parser

1.10.1

17 Oct 15:46
7d0180b
Compare
Choose a tag to compare
  • Restores support for PHP 8.1

1.10.0

16 Oct 23:15
163130b
Compare
Choose a tag to compare

This release adds a few new helper methods:

  • toDocument() on DocumentParser simplifies the process of converting an existing DocumentParser to a Document instance
    • toDocument will resolve structures on the document by default. To prevent this, simply supply false when calling (i.e., toDocument(false))
  • parseTemplate on DocumentParser parses the input like the existing parse method, but will return the DocumentParser instance instead of a node array

New AttributeCompiler

The AttributeCompiler is a new compiler service that can be used to compile attributes/parameters on a parsed ComponentNode. The AttributeCompiler implementation will use the core Laravel compiler for content that contains interpolated values.

Usage:

<?php

use Stillat\BladeParser\Parser\DocumentParser;
use Stillat\BladeParser\Compiler\CompilerServices\AttributeCompiler;

$template = <<<'TEMPLATE'
<prefix:component
  parameter="content"
  :binding="$theVariable"
/>
TEMPLATE;

$params = (new DocumentParser)
        ->onlyParseComponents()
        ->registerCustomComponentTags(['prefix'])
        ->parseTemplate($template)
        ->toDocument()
        ->getComponents()
        ->first()
        ->parameters;

$compiler = new AttributeCompiler;
$result = $compiler->compile($params);

After compilation, $result would contain the following:

['parameter'=>'content','binding'=>$theVariable]

1.9.0

13 Oct 21:24
Compare
Choose a tag to compare
  • Bumps the minimum PHP version to 8.2
  • Migrates the test suite to Pest
  • Code cleanup/formatting 🧹
  • Improves parsing of HTML fragments and attributes/parameters

1.8.0

16 Apr 23:16
ea05ebf
Compare
Choose a tag to compare
  • Adds new helper methods to determine the type of an EchoNode
    • EchoNode::isRaw(), EchoNode::isTriple(), and EchoNode::isRegular()

1.7.2

15 Mar 01:46
de29c22
Compare
Choose a tag to compare
  • Improves validation of @parent directive. Thanks @ernix 🥳

1.7.1

04 Mar 01:06
4cb4888
Compare
Choose a tag to compare
  • Corrects an issue with directory cleanup #29 (thanks @ernix !)

1.7.0

22 Feb 00:00
fc42f29
Compare
Choose a tag to compare
  • Updates dependencies to allow Laravel 11
  • Refactors some tests

1.6.1

11 Feb 01:47
650c1a8
Compare
Choose a tag to compare

This release improves the out-of-box experience with the document validator:

  • Resolves an issue where custom Blade component compilers would not be used when compiling documents
  • Corrects an issue preventing some component tag parameters from being compiled successfully

In addition, this PR makes the following changes:

  • The ignore_directives validation configuration option will now be used to disable parsing and compilation across all validators, for consistency (#25)
  • Adds the livewire directive to the list of ignored directives to prevent users from having to add it each time (due to some lifecycle items)

1.6.0

10 Dec 18:22
Compare
Choose a tag to compare
  • Updates the component tag compiler to have parity with latest Laravel changes
  • Adds compiler support for the @use directive

1.5.1

21 Nov 02:16
Compare
Choose a tag to compare

Update PHP version constraint to match language features used