Releases: inpsyde/assets
Releases · inpsyde/assets
1.4
New
- Added
OutputFilter\InlineAssetOutputFilter
to allow printing the Asset inline.
Automatically discovering Asset version
Added new automatic version handling based on the filemtime
. This can be enabled/disabled via
BaseAsset::enableAutodiscoverVersion
BaseAsset::disableAutodiscoverVersion
By default, this is enabled. When no Asset::withFilePath
or filePath
configuration is given, the BaseAsset
tries to solve the path to the file automatically.
Added new methods:
Asset::withFilePath
- set a filePath which s used in automatic discovering the versionAsset::filePath
- will automatically discover the filePath if not set
AssetManager
- Added
AssetManager::asset(string $handle, string $type)
to access registered assets.
PHP Version
- Moved to PHPUnit 7.*.
- Moved PHP min version to 7.1.
Style/Script mutable
Script
andStyle
are now mutable. See Assets.md.
Style/Script new API features
Script
now supports ...- inline append/prepend scripts.
- translations for Gutenberg Blocks.
- set directly
Script::useAsyncFilter()
orScript::useDeferFilter()
to attach filter.
Style
now supports ...- append inline styles
- set directly
Style::useAsyncFilter()
to attach filter.
Breaking Change
Script::localize()
now does not accept anymore a single closure, instead you can add multiple $objectValues
which can contain a closoure. For migration have a look at Migration from 1.3 to 1.4.
1.3.1
1.3
New
- Moved
AssetManager::currentHooks
intoAssetHookResolver::resolve
. - Added new constants for available hooks to
Asset
. - This project has now GPL-2.0-or-later as license.
Fixes
- Added missing check for hooks with "New Post" (post-new.php) for Gutenberg available styles/scripts.
- Fixed AssetManager::currentHooks by returning now an array of hooks to support also Gutenberg enqueues.
1.2
1.1.1
1.1
Improvements
- Renamed
Inpsyde\Assets\Asset::type
toInpsyde\Assets\Asset::location
to be more clear. Inpsyde\Assets\AssetFactory
- changed configuration keys...type
tolocation
class
totype
Inpsyde\Assets\AssetFactory
- added migration to new configuration keys to avoid breaking change for now.
1.0
Breaking changes
- Removed
Inpsyde\Assets\assetManager()
-function. Function is replaced by a WordPress hook to setup assets. See [Migration](./docs/99 - Migration.md). - Renamed all flags in
Inpsyde\Assets\Asset
to match the different locations.
Improvements
- Added
inc/bootstrap.php
to setup theAssetManager
not to early and allow Plugins/Themes to start with a hook instead of using a function. - Setup of default handlers are now in the callback hook and only if at least one asset is found.
- Added
'class'
-option to configuration forInpsyde\Assets\AssetFactory::create
. - Added
Inpsyde\Assets\Asset::handler
which now allows to implement custom Handlers. - Added support for multiple
Asset::type()
via bitwise|
(OR) to register Assets in different locations only once.
Fixes
- Fix wrong hook returned for customizer.
0.2
Breaking changes
- Removed
Inpsyde\Assets\assetFactory()
-function. TheInpsyde\Assets\AssetFactory
has now static methods. - Renamed
inc/bootstrap.php
toinc/functions.php
.
Improvements
- Move
OutputFilter
to specificAssetHandler
. - Added new type of
Asset
:TYPE_ADMIN_STYLE
TYPE_LOGIN_STYLE
TYPE_CUSTOMIZER_STYLE
TYPE_ADMIN_SCRIPT
TYPE_LOGIN_SCRIPT
TYPE_CUSTOMIZER_SCRIPT
- Added now detection of current "screen" to display new types of
Asset
. - Moved
AssetManager::processFilters
to own interfaceOutputFilterAwareAssetHandler
and into specificHandler
viaOutputFilterAwareAssetHandlerTrait
to avoid wrong usage of Style-/Script-OutputFilters.
First release
- First Release.