Releases: evo-mark/inertia-wordpress
v0.6.2
- Feature: Added
Inertia::redirect(string $url)
function - Feature: Added links to support the open-source project
- Improvement: Moved documentation to dedicated website
- Improvement: New NPM scripts added to bootstrapped
package.json
files fornpm run ssr:stop
andnpm run ssr:restart
.
v0.6.1
- Feature: Page Templates now available (see README for more details)
- Improvement: Added REST and AJAX nonces to global shares
- BugFix: Documentation fixes
Internal
- Improvement: Added Husky/Lint-Staged for pre-commit linting
- Improvement: Github Action caching for PHP dependencies and extensions
- BugFix: Remove
dist
build for now
Breaking Change
The function signature for inertiaResolvePage
has been changed.
Previously, the third argument was a layoutCallback
function, now it is an args
object
createInertiaApp({
resolve: resolveInertiaPage(
import.meta.glob("./pages/**/*.vue", { eager: false }),
DefaultLayout,
{
layoutCallback: (resolvedName, resolvedPage, resolvedTemplate) =>
SomeLayout,
templates: import.meta.glob("./templates/**/*.vue"),
},
),
// ...
});
Note that the third argument is optional still
v0.5.0
- Feature: New module for The SEO Framework
- Improvement: (internal) Build to dist branch to allow Packagist release
- Improvement: Full table-of-contents added to readme
v0.4.0
- Feature: New Contact Form 7 module
- Feature New
Inertia::flash($key, $value)
method for sending flash data to the frontend - Feature: New module pages for ACF and Contact Form 7
- Feature: New module registration feature available via
Inertia::addModule($class)
(see below); - Improvement: Scope flash data to users by a temporary ID to prevent collisions
- Improvement: Added free version of ACF as a valid entry file for the module
- BugFix: Revised package.json dependency for @evo-mark/inertia-wordpress to a
file
install
Breaking Change
In your theme's package.json
, change the dependency for @evo-mark/inertia-wordpress
to the following:
"@evo-mark/inertia-wordpress": "file:../../plugins/inertia-wordpress/resources/plugins",
and then run install from your package manager again.
Custom Modules
You can now add custom modules to the Inertia Wordpress adapter.
First create a class like so:
namespace YourProject;
use EvoMark\InertiaWordpress\Inertia;
use EvoMark\InertiaWordpress\Modules\BaseModule;
class YourModule extends BaseModule
{
// The title of the module to be displayed
protected string $title = "Advanced Custom Fields";
// Optional URI for a module logo
protected string $logo;
// The main class of the plugin that the module interacts with
protected string $class = "ACF";
// Internal reference, alpha-numeric and lowercase
protected string $slug = "acf";
// Any valid entry files for the plugin relative to the wp-content/plugins directory.
protected array|string $entry = ['advanced-custom-fields-pro/acf.php', 'acf-pro/acf.php'];
/**
* Called immediately if the module is enabled and plugin installed/activated
*/
public function register()
{
//
}
/**
* Called before shared props are returned
*/
public function boot(): void
{
Inertia::share('myModule', [
// My data
]);
}
}
You can then register your module by doing:
use EvoMark\InertiaWordpress\Inertia;
use YourProject\YourModule;
add_action('inertia_wordpress_modules', function () {
Inertia::addModule(YourModule::class);
});
Don't forget to enable your module in the Inertia -> Settings
menu once it is registering.
v0.3.0
-
Feature: Svelte template now available via
wp inertia:create-theme
command -
Feature: React template now available via
wp inertia:create-theme
command -
Feature: Edit and Comment nodes returned via
wp.adminBar
on Inertia requests -
Improvement: Included more detailed templates/layouts for theme bootstrapper
-
BugFix: Duplicated inertia instances when using code-splitting on pages
v0.2.4
Chore: Updated changelog and version
v0.2.3
Merge branch 'main' of github.com:evo-mark/inertia-wordpress #patch
v0.2.1
- BugFix: Fix GitHub action build
v0.2.0
- Feature: Menus by location now available on the
wp.menus
page prop - Feature: Filter hooks added, more information coming soon
- Improvement: Added default layout and pages to bootstrapped Vue theme
- Improvement:
logo
,name
andhomeUrl
also now available onwp
page prop
v0.1.1
- Initial Release