Download the PHP package pinkcrab/elm-mount without Composer

On this page you can find all versions of the php package pinkcrab/elm-mount. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package elm-mount

PinkCrab ElmMount

Latest Stable Version Total Downloads License PHP Version Require GitHub contributors GitHub issues

WP 6.6 [PHP8.0-8.4] Tests WP 6.7 [PHP8.0-8.4] Tests WP 6.8 [PHP8.0-8.4] Tests WP 6.9 [PHP8.0-8.4] Tests

codecov

Mount compiled Elm apps into WordPress admin pages, shortcodes and other surfaces. Handles the enqueue, the localized flags blob, and the REST nonce. Bundling your Elm is your job — this package takes the compiled .js and wires it into WordPress.

Part of a three-package set:

Role Package
PHP mount helper (this package) pinkcrab/elm-mount
JS bootstrap @pinkcrab/elm-wp-bootstrap
Elm package Pink-Crab/elm-wp

Install

Usage

Build an Elm_App once with your script + flags, then call render() (echoes) or parse() (returns a string) from any WordPress callback that produces output — admin page, shortcode, meta box, widget, REST handler, template part. The same $app works for all of them.

Both render() and parse() enqueue the script, localize the flags blob on window.my_settings, and produce <div id="my_settings-root"></div> for Elm to attach to. The mount node id defaults to {handle}-root; override with ->mount_node( 'custom-id' ) if needed.

Your compiled Elm bundle reads window.my_settings and mounts into #my_settings-root@pinkcrab/elm-wp-bootstrap handles that plumbing automatically.

Contract

This section is the authoritative spec shared by all three packages. Any change here is a contract bump and must be mirrored in the other two repos in lockstep.

Flags blob

Emitted via wp_localize_script( $handle, $handle, $blob ). The JavaScript side reads it from window.<handle> and hands it to Elm as flags.

Notes:

Port names

The JS bootstrap and the Elm package must agree on these names. Changing any is a contract break.

Direction Port name Purpose
Elm → JS wpApiFetch Outbound REST call via wp.apiFetch. Payload: { id, method, path, body? }.
JS → Elm wpApiFetchResult Paired response. Payload: { id, ok, status, body }.
Elm → JS wpNotice Show an admin notice. Payload: { kind: "success"\|"error"\|"info"\|"warning", message }.
Elm → JS copyToClipboard Copy text to clipboard. Payload: string.

id on wpApiFetch / wpApiFetchResult is a string correlation id the Elm side generates so multiple in-flight requests can be matched to their responses.

Versioning

All three packages share a major version. Within 1.x, minor and patch versions can move independently per package — compatibility is guaranteed across the same major.

pinkcrab/elm-mount @pinkcrab/elm-wp-bootstrap Pink-Crab/elm-wp
1.x 1.x 1.x

License

MIT © PinkCrab


All versions of elm-mount with dependencies

PHP Build Version
Package Version
Requires php Version >=8.0.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package pinkcrab/elm-mount contains the following files

Loading the files please wait ...