NPM Resource Changed ? ? ? Failure

User tests: Successful: Unsuccessful:

avatar Fedik
Fedik
2 Feb 2019

Summary of Changes

I want to suggest an idea.
The WebAsset can have a custom class. Actually it already possible, but was not possible while loading assets from json.

Additionally introduce WebAssetAttachBehaviorInterface, this can be useful when Asset need to have a Script options with a values that depend from environment. Example of old: 'behavior.core', 'behavior.keepalive'.
This also allow to leave in the past old JHtmlBehavior, at least in the part for loading a scripts.

Look for example
https://github.com/Fedik/joomla-cms/blob/be02eea44e9d5cd4aebbba12d98ec8bacf50ebbd/libraries/src/WebAsset/AssetItem/CoreAssetItem.php#L36-L49
and
https://github.com/Fedik/joomla-cms/blob/be02eea44e9d5cd4aebbba12d98ec8bacf50ebbd/libraries/src/WebAsset/AssetItem/KeepaliveAssetItem.php#L24

ping @wilsonge @dgrammatiko
@mbabker I think it will be cooler than WP_Dependencies no? 😉

Testing Instructions

run npm install and
make sure everything works as before.

Documentation Changes Required

as part of #22435

avatar Fedik Fedik - open - 2 Feb 2019
avatar Fedik Fedik - change - 2 Feb 2019
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 2 Feb 2019
Category Repository Libraries
avatar Fedik Fedik - change - 2 Feb 2019
The description was changed
avatar Fedik Fedik - edited - 2 Feb 2019
avatar dgrammatiko
dgrammatiko - comment - 2 Feb 2019

It's a YES from me 😉

avatar Fedik Fedik - change - 2 Feb 2019
Labels Added: ? ?
avatar franz-wohlkoenig franz-wohlkoenig - change - 19 Apr 2019
Title
[4.0][RFC] WebAsset custom class per asset, and asset behavior
[4.0] [RFC] WebAsset custom class per asset, and asset behavior
avatar franz-wohlkoenig franz-wohlkoenig - edited - 19 Apr 2019
avatar joomla-cms-bot joomla-cms-bot - change - 19 Apr 2019
Category Repository Libraries Repository NPM Change Libraries
avatar Fedik Fedik - change - 5 May 2019
Labels Added: NPM Resource Changed ?
Removed: J4 Issue ?
avatar wilsonge wilsonge - change - 5 May 2019
Status Pending Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2019-05-05 13:40:43
Closed_By wilsonge
Labels Added: ?
avatar wilsonge wilsonge - close - 5 May 2019
avatar wilsonge wilsonge - merge - 5 May 2019
avatar wilsonge
wilsonge - comment - 5 May 2019

Please can you add docs for this on the web asset docs page

avatar Fedik
Fedik - comment - 6 May 2019

@wilsonge I have added a new chapter https://docs.joomla.org/J4.x:Web_Assets
please check, for my english 😉

avatar wilsonge
wilsonge - comment - 7 May 2019

Tweaked english. Was really good. Thanks!

Add a Comment

Login with GitHub to post a comment