Releases: inpsyde/assets
2.9.0
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
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 forwp_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
2.8.1
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
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
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
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
2.5.1
Bugfix
- AssetFactory // fix method call for
Asset::withDependencies()
to use spread operator on array input.
props @cristianobaptista