Download the PHP package automattic/jetpack-wp-build-polyfills without Composer

On this page you can find all versions of the php package automattic/jetpack-wp-build-polyfills. 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 jetpack-wp-build-polyfills

Jetpack WP Build Polyfills

Polyfills for WordPress Core packages not yet available or complete in older WordPress versions.

This package conditionally registers @wordpress/* packages as both classic scripts (IIFE) and script modules (ESM) when they are not already provided by Core or Gutenberg. It is intended to be used while Jetpack supports WordPress versions whose bundled packages are missing or incomplete. Revisit this package once Jetpack's minimum supported WordPress version reaches 7.1.

Problem

WordPress 7.0 introduces several new packages (@wordpress/boot, @wordpress/route, @wordpress/theme, etc.) that plugins built with @wordpress/build depend on. On older WordPress versions, these packages are missing or ship incomplete implementations — for example, wp-private-apis has an allowlist that rejects @wordpress/theme, @wordpress/route, and newer dashboard packages, and wp-notices lacks component exports that @wordpress/boot requires.

This package provides those missing or updated packages so that plugins using @wordpress/build can work across Jetpack's supported WordPress versions.

What it polyfills

Classic scripts (IIFE)

Handle Source package Force-replaced?
wp-notices @wordpress/notices Yes on WP < 7.0 — missing component exports
wp-private-apis @wordpress/private-apis Yes on WP < 7.1 unless Gutenberg >= 23.5.0 is active — incomplete allowlist
wp-theme @wordpress/theme No — only registered if absent
wp-views @wordpress/views No — only registered if absent

Script modules (ESM)

Module ID Source package
@wordpress/boot @wordpress/boot
@wordpress/route @wordpress/route
@wordpress/a11y @wordpress/a11y

Script modules use "first-wins" semantics — if Core or Gutenberg already registered the module, the polyfill is silently ignored.

How it works

  1. WP_Build_Polyfills::register() hooks into wp_default_scripts at priority 20, after Core (priority 0) and Gutenberg (priority 10) have registered their scripts.
  2. For each polyfill, it checks whether a built asset file exists (build/scripts/*/index.asset.php or build/modules/*/index.asset.php).
  3. For classic scripts, it checks whether the handle is already registered. Scripts marked for force replacement are deregistered and re-registered with the polyfill version when the WordPress version is below the script's threshold and active Gutenberg is not known to provide a compatible implementation. Non-force scripts are skipped if already registered.
  4. For script modules, it calls wp_register_script_module(), which silently ignores duplicates.

wp-private-apis has an additional Gutenberg-version guard because the dashboard packages require a private-apis allowlist that includes @wordpress/widget-dashboard. Gutenberg 23.4.0 and older do not include that allowlist entry; Gutenberg 23.5.0 is expected to be the first active-Gutenberg version that matches the current @next package build used here.

Usage

Call register() early in your plugin, specifying a consumer name and the polyfills you need:

Available handles are listed in WP_Build_Polyfills::SCRIPT_HANDLES and WP_Build_Polyfills::MODULE_IDS.

Multiple plugins can call register() — the hook is only added once, and all requested polyfills are merged. You can inspect which consumers requested which polyfills via WP_Build_Polyfills::get_consumers().

The version threshold for force-replacements can be overridden with a third parameter:

Boot module asset file

Packages that use @wordpress/build to generate pages get a hardcoded reference to build/modules/boot/index.min.asset.php in the generated page templates. This file provides the classic script dependencies and version hash needed to bootstrap the page.

When @wordpress/build stops bundling the boot module (as planned in upcoming Gutenberg changes), this asset file will no longer be generated. This package builds its own boot module asset file, and ships a bin script (provide-boot-asset-file) that copies it to the expected location in the consumer's build directory.

Consuming packages should add @automattic/jetpack-wp-build-polyfills as a devDependency and call the script after wp-build:

Development


All versions of jetpack-wp-build-polyfills with dependencies

PHP Build Version
Package Version
No informations.
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 automattic/jetpack-wp-build-polyfills contains the following files

Loading the files please wait ...