Skip to content

Releases: evo-mark/inertia-wordpress

v0.6.2

26 Dec 00:56
Compare
Choose a tag to compare
  • 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 for npm run ssr:stop and npm run ssr:restart.

v0.6.1

24 Dec 12:37
Compare
Choose a tag to compare
  • 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

23 Dec 11:04
Compare
Choose a tag to compare
  • 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

22 Dec 13:53
Compare
Choose a tag to compare
  • 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

21 Dec 12:28
Compare
Choose a tag to compare
  • 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

20 Dec 08:42
Compare
Choose a tag to compare
Chore: Updated changelog and version

v0.2.3

20 Dec 08:30
Compare
Choose a tag to compare
Merge branch 'main' of github.com:evo-mark/inertia-wordpress #patch

v0.2.1

20 Dec 08:00
Compare
Choose a tag to compare
  • BugFix: Fix GitHub action build

v0.2.0

20 Dec 07:32
Compare
Choose a tag to compare
  • 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 and homeUrl also now available on wp page prop

v0.1.1

19 Dec 18:41
Compare
Choose a tag to compare
  • Initial Release