Feat: Acorn 5 - #47
Conversation
There was a problem hiding this comment.
Pull request overview
This PR upgrades Nutshell to support Roots Acorn v5 (and its newer Illuminate/Laravel stack), replacing the previous “bootloader helper + custom kernel/handler overrides” approach with an Application subclass that configures middleware, routing, paths, and exception handling via Acorn’s newer configuration builder API.
Changes:
- Upgrade runtime/dev dependencies (Acorn v5, PHP >= 8.2, and associated Illuminate/Symfony ecosystem updates).
- Replace the old
bootloader()helper and customHttp\Kernel/ exception handler wiring withYard\Nutshell\Application::configure(...). - Update provider replacement logic and refresh README bootstrapping instructions.
Reviewed changes
Copilot reviewed 8 out of 9 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/Http/Kernel.php | Removed old custom HTTP kernel (CSP middleware injection previously lived here). |
| src/helpers.php | Removed old bootloader() helper and container bindings/aliases. |
| src/Exceptions/Handler.php | Removed old Sentry exception reporting hook via custom handler. |
| src/DefaultProviders.php | Switch to using replace(...) for provider substitution after Acorn default provider setup. |
| src/Assets/Vite.php | Removed custom Vite asset path override. |
| src/Application.php | New Acorn Application subclass configuring middleware, WordPress routing, public path, and Sentry integration. |
| README.md | Update bootstrap instructions to use the new Application::configure(...) entry point. |
| composer.json | Bump PHP requirement and Acorn major version; update dev tooling versions. |
| composer.lock | Lockfile refresh for the upgraded dependency graph. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| ```diff | ||
| -\Roots\bootloader()->boot(); | ||
| +define('ACORN_BASEPATH', __DIR__); | ||
| +\Yard\Nutshell\bootloader()->boot(); | ||
|
|
||
| add_action('after_setup_theme', function () { | ||
| - Application::configure() | ||
| - ->withProviders([ | ||
| - App\Providers\ThemeServiceProvider::class, | ||
| - ]) | ||
| + Yard\Nutshell\Application::configure(__DIR__) | ||
| ->boot(); | ||
| }, 0); | ||
|
|
||
| ``` |
Composer package changes
|
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 8 out of 9 changed files in this pull request and generated no new comments.
Suppressed comments (3)
src/Application.php:45
- In a namespaced file, call WordPress global functions with a leading backslash to avoid namespace shadowing and improve lookup performance.
do_action(Log::WP_ACTION_SET_LOGGER, $application->make('log'));
src/Application.php:37
- In a namespaced file, unqualified WordPress global function calls rely on fallback resolution at runtime. Prefixing with a leading backslash avoids any accidental namespace shadowing and is slightly faster for function lookup.
This issue also appears on line 45 of the same file.
->withPaths(public: get_theme_file_path('public'))
README.md:75
- This section heading still refers to the Acorn "Bootloader", but the PR removes the bootloader helper and switches the documented approach to
Yard\Nutshell\Application::configure(). Renaming the heading will keep the docs consistent with the new bootstrapping mechanism.
2. **Update Acorn Bootloader**
This pull request introduces significant updates to the project to support Acorn v5, modernize dependencies, and simplify the codebase. The most notable changes include upgrading core dependencies, refactoring the application bootstrapping process, and removing custom integrations that are now handled natively or elsewhere.
Dependency and Compatibility Updates:
composer.json.Application Bootstrapping and Structure:
Yard\Nutshell\Applicationclass to encapsulate application configuration and bootstrapping, replacing the previous bootloader-based approach. This includes middleware, Sentry integration, custom providers, and logger setup.README.mdto reflect the new bootstrapping method usingYard\Nutshell\Applicationand removed references to the old bootloader helper.Codebase Simplification and Cleanup:
Yard\Nutshell\Assets\Viteclass and related documentation, as asset management is now handled natively. [1] [2]Yard\Nutshell\Exceptions\Handler) and HTTP kernel (Yard\Nutshell\Http\Kernel), as their functionality is now integrated into the new application structure. [1] [2]Yard\Nutshell\bootloaderhelper and its associated logic, consolidating all bootstrapping into the new application class.Internal Refactoring:
DefaultProvidersby using a dedicatedreplacemethod for provider mapping.