Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Latest commit

 

History

History
History
31 lines (20 loc) · 1.85 KB

File metadata and controls

31 lines (20 loc) · 1.85 KB
Copy raw file
Download raw file
Outline
Edit and raw actions

MakeCode extensions

Extensions are PXT's dynamic/static library mechanism for extending a target, such as the pxt-micro:bit:

pxt-microbit

Here is an example of a simple extension that extends the pxt-microbit target so that the micro:bit can drive a NeoPixel strip:

pxt-neopixel

To see how this extension is surfaced, visit https://makecode.microbit.org/ and select the "Extensions" option from the gear menu. You will see the extension "neopixel" listed in the available options. If you click on it, a new block category named "Neopixel" will be added to the editor.

In this scenario, PXT dynamically loads the neopixel extensions directly from GitHub, compiles it and incorporates it into the web app. Extensions also can be bundled with a web app (the analog of static linking). For dynamically loaded extensions, targets can provide a white list of approved extensions (see pxtarget.json).

Authoring extensions

Extensions may provide an optional editor extension. An editor extension is an HTML page that gets loaded inside an iFrame by the editor. It allows to interact with the project or access serial data via messages. These editor extensions are hosted on GitHub pages.

Morty Proxy This is a proxified and sanitized view of the page, visit original site.