fxpio / composer-asset-plugin

NPM/Bower Dependency Manager for Composer
MIT License
893 stars 156 forks source link

Question about "option is deprecated" #293

Closed schmunk42 closed 6 years ago

schmunk42 commented 7 years ago
The "extra.asset-installer-paths" option is deprecated, use the "config.fxp-asset.installer-paths" option
The "extra.asset-pattern-skip-version" option is deprecated, use the "config.fxp-asset.pattern-skip-version" option
The "extra.asset-vcs-driver-options" option is deprecated, use the "config.fxp-asset.vcs-driver-options" option

Does this mean I should switch ASAP, but it's still recognized - or doesn't it have any affect all now?

francoispluchino commented 7 years ago

See the section Dreprecated options in the release page.

  1. The deprecated options are not removed to keep the compatibility
  2. All the options in the extra section are functional, and a warning will appear in the console if they are used
  3. All the options in the config.fxp-asset section will override the options still defined in the extra section
schmunk42 commented 7 years ago

All the options in the config.fxp-asset section will override the options still defined in the extra section

What if I have defined "old" options in extra, like vcs-driver-options and "new" ones in config like git-skip-update, will they get merged?

francoispluchino commented 7 years ago

Only the first key, like the behavior of the array_merge function, and not like the array_merge_recursive function, so no.

But if you interested to add this behavior, It's in the method Fxp\Composer\AssetPlugin\Config\ConfigBuilder::injectDeprecatedConfig() that it happens.

schmunk42 commented 7 years ago

It's related to https://github.com/fxpio/composer-asset-plugin/issues/292 - I refactored some composer.json files and noticed, that the asset-plugin started to do API requests again, although I've disabled them in the (extra) config.

Maybe it would be an option to enforce configuration either via extra (with a warning) or via config - but if both are specified the plugin would exit with an error. WDYT?

francoispluchino commented 7 years ago

I think it would be better to merge the sub-options between extra and config.