Acorn v4.0.0 released

acorn v4.0.0 released

What’s new

From the blog: What’s New in Acorn v4? | Roots

Upgrade Guide

See the Upgrading Guide for information on upgrading from v3 to v4.

What’s Changed

  • :sparkles: Add Livewire support :tada: by @broskees and @Log1x in #291
  • :sparkles: Automatically expose public properties and methods on View Composers by @Log1x in #320
  • :sparkles: Add relativePath() to Asset contract by @joshuafredrickson in #268
  • :sparkles: Bundle::enqueueJs() support for registering scripts with async and defer by @ouun in #313
  • :globe_with_meridians: add Bundle::translate() by @Dathix in #274
  • :adhesive_bandage: Update ViewFinder.php by @tommica in #319
  • :technologist: Improve the Laravel router implementation by @broskees in #291 and #334
  • :technologist: add route:cache and route:clear commands by @QWp6t in #298
  • :technologist: Implement the key:generate command
  • :arrow_up: Laravel v10 by @log1x in #299
  • :bug: Exit parse_request to short circuit WordPress during custom routes. by @eavonius in #301

New Contributors

  • @eavonius made their first contribution in #301
  • @szepeviktor made their first contribution in #312
  • @tommica made their first contribution in #319
  • @joshf made their first contribution in #268
  • @broskees made their first contribution in #291
  • @czernika made their first contribution in #303
  • @ukeloop made their first contribution in #329
  • @Dathix made their first contribution in #274

Full Changelog:


Thank you to everyone involved in this release and an extra thank you to the core Roots team that just keeps pushing things forward :blue_heart:

Not sure if this is the right place/thread for this but I have listed below the extra steps that I had to take when upgrading.

I imagine that there are more setups similar to mine since the packages listed below are basically add-ons recommended, or made, by Roots. So maybe my findings help others with the upgrade process. If this should be moved to a dedicated thread, just let me know.

I upgraded from Acorn 3.2.

  • When updating config/app.php, i also had to add use Roots\Acorn\ServiceProvider;.

  • I was running v1.x of spatie/laravel-ignition. That had to be updated to 2.x to not clash with Acorn v4s required version of illuminate/support. I hadn’t been able to upgrade to v2 earlier due to its requirement of Laravel 10 which Acorn now supports.

  • log1x/navi had to be updated to v2.0.5.

  • log1x/sage-svg had to be updated to v1.1.2

  • log1x/acf-composer had to be updated to dev-master#70d17315e78e95a75e76f3d7eecd99cfa6b5b30b. This is since I couldn’t find a release where the required change in the linked commit was included.


Thank you for sharing the steps that you took and also calling out the packages conflicts! I updated the Upgrading Acorn docs with a note about removing and re-requiring packages that @Log1x had called out on our Discord server when the first beta was released

Anyone else having an issue with cookies after the Router update in Bootloader? I’m currently running into issues using the latest main and a (updated) sage, where a login into admin is not working. Reverting to #82ed8b9 will fix this.

I’m not sure yet, if this is caused by customization in the sage repo but somehow the wordpress_test_cookie won’t be set.

After debugging it leads me to the installed livewire/livewire package - if present I get errors on setting cookies. And thus the login won’t work.

Opened an issue.

Confirmed the issue exists even without using Livewire, thanks for reporting it!

Edit: Fix is ready and can be tested by running composer require roots/acorn dev-router-wp-login

1 Like

I am getting a weird error that I think may be Acorn 4 related - it started after I merged the upstream changes in a Radicle installation. I figured perhaps that there was something I had made changes to that was the culprit, so I did a completely new install of Radicle 1.3.0, and I still have the problem. The error looks to me that it could be Acorn 4.0 related?

I get the following at the bottom of every page:

Fatal error: Uncaught Carbon\Exceptions\InvalidTimeZoneException: Unknown or bad timezone () in /Users/xxxx/Sites/radicle.test/vendor/nesbot/carbon/src/Carbon/CarbonTimeZone.php:109 Stack trace: #0 
/Users/xxxx/Sites/radicle.test/vendor/nesbot/carbon/src/Carbon/Traits/Date.php(626): Carbon\CarbonTimeZone::instance('', NULL) #1 
/Users/xxxx/Sites/radicle.test/vendor/nesbot/carbon/src/Carbon/Traits/Date.php(1631): Carbon\Carbon::safeCreateDateTimeZone('') #2 
/Users/xxxx/Sites/radicle.test/vendor/roots/acorn/src/Illuminate/Foundation/Http/Kernel.php(221): Carbon\Carbon->setTimezone('') #3 
/Users/xxxx/Sites/radicle.test/vendor/roots/acorn/src/Roots/Acorn/Bootloader.php(299): Illuminate\Foundation\Http\Kernel->terminate(Object(Illuminate\Http\Request), Object(Illuminate\Http\Response)) #4 
/Users/xxxx/Sites/radicle.test/vendor/roots/acorn/src/Roots/Acorn/Bootloader.php(283): Roots\Acorn\Bootloader->handleRequest(Object(Roots\Acorn\Http\Kernel), Object(Illuminate\Http\Request)) #5 
/Users/xxxx/Sites/radicle.test/public/wp/wp-includes/class-wp-hook.php(324): Roots\Acorn\Bootloader->Roots\Acorn\{closure}('') #6 
/Users/xxxx/Sites/radicle.test/public/wp/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters('', Array) #7 
/Users/xxxx/Sites/radicle.test/public/wp/wp-includes/plugin.php(517): WP_Hook->do_action(Array) #8 
/Users/xxxx/Sites/radicle.test/public/wp/wp-includes/load.php(1260): do_action('shutdown') #9 [internal function]: shutdown_action_hook() #10 {main} thrown in 
/Users/xxxx/Sites/radicle.test/vendor/nesbot/carbon/src/Carbon/CarbonTimeZone.php on line 109

this is on a brand-new Radicle installation, nothing changed. I am using MAMP hosting locally, PHP 8.1.13, Mac OS Sonoma

:thinking: I’m not yet able to reproduce that

Can you try making this change? 🩹 Fix `timezone_string` sometimes returning an empty string · roots/acorn@680b820 · GitHub

Fixed in Radicle just now at

oh man, that’s got it.

thanks so much; it was such a weird error and I wasn’t exactly sure which package (if any) was the cause

Thank you for pointing it out!

I’ll try to push a release for ACF Composer this weekend.