Download the PHP package moodlehq/moodle-local_importmapshim without Composer

On this page you can find all versions of the php package moodlehq/moodle-local_importmapshim. 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 moodle-local_importmapshim

Import Map Shim (local_importmapshim)

A Moodle local plugin that injects the es-module-shims polyfill into every page, enabling import map support for browsers that do not natively support the feature.

Why this plugin exists

Moodle 5.2+ adopted ES module import maps as the foundation for its React-based UI. An import map is a JSON block in the HTML page that tells the browser how to resolve bare module specifiers like:

Moodle core added the import map mechanism but did not ship a polyfill for browsers that lack native support. Older browsers — and some versions of Firefox until recently — do not support import maps natively, causing the entire React-based UI to silently break for those users.

This plugin injects es-module-shims into every Moodle page before any import map or ES module is parsed. The shim works transparently: on browsers that already support import maps natively it steps aside and does nothing; on older browsers it intercepts module loading and emulates the feature.

Layer Who provides it
Import map definition + React modules Moodle core
Native import map support Modern browsers
Import map support on older browsers This plugin (via es-module-shims)

Requirements

Installation

Using Git

From your Moodle root directory, clone the plugin into the public/local/ subdirectory:

Then visit Site administration > Notifications to complete the installation.

Manual

  1. Download the plugin archive.
  2. Extract it so the plugin folder is at <moodleroot>/public/local/importmapshim/.
  3. Log in as an administrator and visit Site administration > Notifications.

How it works

The plugin hooks into Moodle's before_standard_top_of_body_html_generation hook (priority 1000) to inject a <script> tag that loads the es-module-shims polyfill early in the page lifecycle — before any import map or ES module scripts are evaluated.

The polyfill is served by a dedicated PSR-7 route controller (/shims/{revision}) that applies appropriate HTTP cache headers:

Mode Behaviour
Development ($CFG->cachejs = false) Short-lived headers, no ETag, 2-second expiry
Production Cache-Control: public, max-age=31536000, immutable with ETag and 304 support

Updating the bundled polyfill

The es-module-shims library can be updated by running the helper script:

For example:

This downloads the specified release, updates js/es-module-shims.js, and updates the version metadata in thirdpartylibs.xml.

License

This plugin is licensed under the GNU General Public License v3 or later.


All versions of moodle-local_importmapshim with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1
moodle/moodle Version ^5.2
moodle/composer-installer Version *
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 moodlehq/moodle-local_importmapshim contains the following files

Loading the files please wait ...