Releases: Log1x/acf-composer
Release list
v3.0.8
v3.0.7
Change log
Enhancements
- 🧑💻 Add block construct replacements to
acf:upgrade - 🧑💻 Do not retrieve the existing cache when recaching (#203)
- 🎨 Tidy up the
acf:ide-helperscommand - 🙈 Add
_ide-helpers.phpto the.gitignorefile
Bug fixes
- 🩹 Use
$composerin the Block construct stub (#202)
New Contributors
- @tombroucke made their first contribution in #202
Full Changelog: v3.0.6...v3.0.7
v3.0.6
v3.0.5
v3.0.4
v3.0.3
v3.0.2
v3.0.1
v3.0.0
🎉 ACF Composer v3 has arrived!
💥 Breaking Change
If you generated Blocks using the --construct option, you will need to manually update the block __construct()'s with a find & replace:
- use Roots\Acorn\Application;
+ use Log1x\AcfComposer\AcfComposer;
- public function __construct(Application $app)
+ public function __construct(AcfComposer $composer)
- parent::__construct($app);
+ parent::__construct($composer);Once done, continue to the upgrade guide below.
🧑💻 Upgrade Guide
- Make sure ACF Composer is installed in the same
composer.jsonas Acorn. - Run
composer require log1x/acf-composerto upgrade to^3.0. - Update your class references using
wp acorn acf:upgrade.
Going forward, it is recommended to use the new Builder class:
- use StoutLogic\AcfBuilder\FieldsBuilder;
+ use Log1x\AcfComposer\Builder;
- $listItems = new FieldsBuilder('listItems');
+ $listItems = Builder::make('listItems');When using the new Builder class, you can now use ->addPartial() to add field partials:
- $listItems->addFields($this->get(Partial::class));
+ $listItems->addPartial(Partial::class);Inside of Blocks, enqueue() has been changed to assets($block):
- public function enqueue()
+ public function assets($block)Running wp acorn acf:upgrade should do all of the above for you automatically.
Config Changes
There are 2 new entries to the acf.php config if you have it published:
/*
|--------------------------------------------------------------------------
| Custom Field Types
|--------------------------------------------------------------------------
|
| Here you can define custom field types that are not included with ACF
| out of the box. This allows you to use the fluent builder pattern with
| custom field types such as `addEditorPalette()`.
|
*/
'types' => [
// 'editorPalette' => 'editor_palette',
// 'phoneNumber' => 'phone_number',
],
/*
|--------------------------------------------------------------------------
| Cache Manifest Path
|--------------------------------------------------------------------------
|
| Here you can define the cache manifest path. Fields are typically cached
| when running the `acf:cache` command. This will cache the built field
| groups and potentially improve performance in complex applications.
|
*/
'manifest' => storage_path('framework/cache'),Field Group Caching
ACF Composer now includes field group caching. It may be a good idea to add this to your deployment script:
$ wp acorn acf:cacheYou can view the status of the cache by running wp acorn acf:cache --status or wp acorn about.
Custom Field Types
Seen in the config changes above is support for adding custom field types to the Builder. This should help tidy up code a bit when using custom types like ACF Phone Number and ACF Editor Palette.
Once defined in config/acf.php, you can generate IDE helpers for them using wp acorn acf:ide-helpers.
- $fields->addField('mobile_number', 'phone_number');
+ $fields->addPhoneNumber('mobile_number');Please open an issue if you experience any problems.
Change log
Enhancements
- 💥 Pass
$blockdata toenqueue()(#154) - ✨ Add an
acf:cachecommand for caching built field groups (Fixes #176) - ✨ Implement a
FieldsBuilderwrapper for improved builder support (Fixes #173) - ✨ Add an
acf:upgradecommand to upgrade classes to v3 - ✨ Add a
acf:clearcommand to clear the ACF Composer cache - ✨ Add support for registering individual Composers (Fixes #180)
- ✨ Add support for InnerBlocks templates (#159)
- ✨ Add support for Acorn v4 (#183)
- 🧑💻 Allow for non-static example data (#152)
- 🧑💻 Add option to toggle option page visibility (#116)
- 🧑💻 Add
$settingsproperty to pass additional settings toacf_add_options_page()(#156) - 🧑💻 Register paths on
acf/init(#163) - 🧑💻 Add Ancestor allow list to block settings (#142)
- 🧑💻 Add support for block
uses_contextandprovides_context(#153) - 🧑💻 Add support for block text and background colors (#145)
- ➕ Add
laravel/pintto the project - ➕ Add
roots/acornto the project - ➖ Remove
squizlabs/php_codesnifferfrom the project - 🎨 Improve class syntax and add types
- 🎨 Improve the block stub docblocks
- 👷 Tidy up the Dependabot configuration
- 👷 Update CI workflow (#166)
- 📝 Update the README for v3
- 📝 Update docs to convey that ACF Pro is required (#158)
- 📝 Add notes about block widgets (#172)
- 🔧 Add
typesandmanifestconfiguration to the ACF Composer config - 🔧 Change the Options
$redirectproperty default value tofalse - 🔧 Change the publish tag to
acf-composerto make publishing assets easier - 🔧 Comment out default configuration values
- 🔧 Remove unnecessary
suggestandscriptsconfiguration - 🗑️ Deprecate the
get()Partial method - 🗑️ Drop PHP 7.x Support
- 🧑💻 Improve the ACF Composer lifecycle
- 🧑💻 Add a
--statusoption to theacf:cachecommand - 🧑💻 Add a warning when fields are generated without ACF being enabled
- 🧑💻 Update generation stubs to utilize the new
Builderclass - 🧑💻 Add ACF Composer to
acorn about - 🙈 Add
composer.lockto.gitignore - 🚨 Run Pint
Bug fixes
- 🐛 Fix children option page registration (Fixes #93)
New Contributors
- @ASDWcodes made their first contribution in #116
- @JUVOJustin made their first contribution in #163
- @broskees made their first contribution in #152
- @rleecrewmp made their first contribution in #142
- @pat-flew made their first contribution in #153
- @GianlucaCesari made their first contribution in #158
- @chrillep made their first contribution in #166
- @aon21 made their first contribution in #145
- @kupoback made their first contribution in #154
Full Changelog: v2.1.0...v3.0.0
v2.1.0
Change log
Enhancements
- enhance(block): Add missing block render callback properties (#135)
- enhance(block): Add
$contextparam to block render callback (Fixes #130) - enhance(block): Add
$wp_blockparam to block render callback - enhance(block): Add
$block->contextproperty to access$context - enhance(block): Add
$block->instanceproperty to access$wp_block - chore(block): Add missing
$post_idproperty definition