Skip to content

Releases: inpsyde/assets

2.9.0

28 Nov 12:06
2b2d2ac
Compare
Choose a tag to compare

Important

As part of the PHP 8.2 compatibility improvements (#52), the AttributesOutputFilter class was changed to use the WP_HTML_Tag_Processor class instead of DOMDocument under the hood. WP_HTML_Tag_Processor was introduced in WordPress 6.2, so packages using AttributesOutputFilter MUST use WordPress 6.2 or newer.

What's Changed

  • Update getting-started.md by @sovetski in #50
  • test: fix library directory detection by @shvlv in #51
  • fix: mb_convert_encoding PHP 8.2 deprecation by @shvlv in #52

New Contributors

Full Changelog: 2.8.3...2.9.0

2.8.3

16 Dec 13:24
f198d7d
Compare
Choose a tag to compare

This release is just a QoL release with some improvements on Github Workflows and adding PHP 8.1 and PHP 8.2 into testing routine.

  • ScriptHandler // allow $path to be null for wp_set_script_translations().
  • composer.json // make use of worpdress-stubs for pslam.
  • github/workflows // add support for PHP 8.1 and 8.2. Make use of inpsyde/reusable-workflows.
  • phpunit.xml.dist // upgrade config.
  • Run CI on PR-s
  • Add explicit "WordPress plugin" to README

2.8.2

30 Jun 07:43
116ff4c
Compare
Choose a tag to compare
  • Deprecated Script::useDependencyExtractionPlugin().
  • Improved Script::resolveDependencyExtractionPlugin() by setting earlier the "loaded" state to avoid calling logic multiple times.
  • docs/assets.md // update documentation.

2.8.1

04 Mar 13:02
1721dec
Compare
Choose a tag to compare

Improvements

  • Change AssetHookResolver::$context visibility to protected to make the class extendable.

Fixes

  • Psalm and PHPCS.

props @nlemoine

2.8

11 Nov 09:16
6383ccc
Compare
Choose a tag to compare
2.8

New feature "custom CSS properties (vars)"

inpsyde/assets now supports via Inpsyde\Assets\Style() to register custom CSS properties (vars).

The new API looks like following:

use Inpsyde\Assets\Style;

$style = new Style('foo', 'www.example.com/style.css');

// to a specific selector/element.
$style->withCssVars(
	'.some-element', 
	['white' => '#fff', 'black' => '000']
);
// or to :root
$style->withCssVars(
	':root', 
	['grey' => '#ddd']
);

The StyleHandler will automatically check if there are CSS vars available via Style::cssVars() and add them via wp_add_inline_style() to your handle.

Registered CSS vars will be automatically prefixed with -- if not present. The example from above will generate following output (prettified for the sake of readability):

<style id="foo-inline-css">
.some-element {
	--white:#fff;
	--black:#000;
}
:root {
	--grey:#ddd;
}
</style>

2.7

06 Aug 06:50
5eedca1
Compare
Choose a tag to compare
2.7

New Features

Asset now supports registration/enqueuing styles and scripts in wp-activate.php via Asset::ACTIVATE. Also the default Asset::location() was changed to Asset::FRONTEND | Asset::ACTIVATE.

Props @websupporter & @gmazzap


Documentation

inpsyde/assets now uses Github Pages for documentation. Check out the documentation here: https://inpsyde.github.io/assets/

You can also checkout our Inpsyde Jekyll Theme - which is based on Just the docs here: https://github.com/inpsyde/jekyll-inpsyde-theme

Thanks to @tangrufus and @judy-inpsyde for the awesome work! 💪

2.6

19 Jul 11:40
83ce23d
Compare
Choose a tag to compare
2.6

Improvments

Most of the time we relied on WordPress functions wp_register_*()- and wp_enqueue_*() to set a $version which is for example based on the filemtime of the Asset. Webpack and @wordpress/dependency-extraction-webpack-plugin are allowing to add hashes for easier cache handling. This broke the loading of generated dependency extraction files due a different format of file names.

With this release of inpsyde/assets we will add support for generated dependency extraction files with and without hashes in following format:

  • {fileName}.asset.json
  • {fileName}.{hash}.asset.json
  • {fileName}.asset.php
  • {fileName}.{hash}.asset.php

Quality

  • Set theme jekyll-theme-slate. You can now read the documentation on https://inpsyde.github.io/assets/
  • psalm & phpcs.
  • Improve .gitattributes
  • testing.yml // run steps in parallel instead of depending on "quality".

Props @tangrufus @judy-inpsyde and myself ;)

2.5.3

01 Apr 08:03
4af9e2b
Compare
Choose a tag to compare

Bugfixes

  • Add handling for localize parameter in AssetFactory #26
  • Add handling for translation parameter in AssetFactory #26

Improvements

  • Split AssetFactory::validateConfig() into separate methods
  • Add .phpunit.result.cache to .gitignore

props @dnaber-de @retrorism

2.5.2

26 Mar 08:05
c14c733
Compare
Choose a tag to compare

Bugfix

  • AssetFactory // Add support for inline scripts.

props @nlemoine

2.5.1

25 Mar 14:51
e69eda8
Compare
Choose a tag to compare

Bugfix

  • AssetFactory // fix method call for Asset::withDependencies() to use spread operator on array input.

props @cristianobaptista