Giter Club home page Giter Club logo

pxt-react-extension-template's Introduction

THIS KIND OF EXTENSION WILL NOT BE SUPPORTED IN FUTURE VERSIONS OF MAKECODE.

A MakeCode Extension

This template contains the boiler plate code to create a MakeCode Extension that exposes a custom page in the editor.

Creating the extension

Follow these steps carefully to setup your extension for MakeCode.

Updating info in the sources

  • search and replace all instance of "pxt-extension-name" with the repo name
  • search and replace all instance of "githubid" with the GitHub organization of the repo
  • update the pxt.json fields: name, description, extension namespace
  • search for all TODO strings and update descriptions

Build

  • install Node.
  • To build the repo, run:
npm install

Launch the Development Server

  • After this you can run the dev server
npm run start

This will be running on http://localhost:3000

You can edit your React app under src and the dev server will hot reload it in the browser. Unless you change styles, you generally don't have to reload it to see your changes during development.

When running locally in a web browser, and not in an iframe, read and write operations are stored in localStorage to make debugging easier.

Webpack will generate the bundled app js when running npm run start or npm run deploy

This repo uses semantic-ui-react as the UI framework, but you can substitue it with any

Deploy

  • To deploy your extension to Github pages, run:
npm run deploy

Try it out

  • Once built, the extension will be hosted on GitHub pages.

https://githubid.github.io/pxt-extension-name

  • Go to the MakeCode editor and add this repo as an extension to a project, you should see your button show up in the desired namespace.

Update the README

Supported targets

Update the list of targets supported by this extension.

  • for PXT/microbit
  • for PXT/adafruit
  • for PXT/maker
  • for PXT/arcade
  • for PXT/codal

(The metadata above is needed for package search, update it with the targets you support)

License

MIT

pxt-react-extension-template's People

Contributors

microsoftopensource avatar msftgits avatar pelikhan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pxt-react-extension-template's Issues

Is this still supported?

Hello @pelikhan ,

I've been working on trying to get the demo template working with MakeCode but have been unable to do so without it crashing. The issue appears to be related to how the iframe is sandboxed in MakeCode. This template utilizes forms, but MakeCode's iframe does not appear to allow for form submissions. I've done some quick edits to remove the forms and use standard html buttons, and that works locally but does not work with the online MakeCode editor.

Before diving deeper into the template's code and doing further testing, I wanted to make sure if the features in this iframe extension are still supported by the MakeCode editor (transferring Serial communication, reading from and writing to the user's code).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.