Giter Club home page Giter Club logo

reactplayground's Introduction

React Playground

With React Playground, you create, test, export, and share your ReactJS Components.

Here you can :

  1. ๐Ÿ”— Share your project. You can get at any moment a shareable link without any registration or login. The page's URL is constantly updated at any keystroke, and you can directly copy it, or use the designed button.
  2. โš›๏ธ Open several tabs (in JS, JSX and CSS file format), and import/export components and hooks from them.
  3. ๐Ÿ“ฆ Import third parties packages, as you would do it in your text editor (e.g. import styled from 'styled-components'). React Playground will import them using internally esm.sh. you can select a version by adding @ + version. (e.g. import React from '[email protected]').
  4. ๐Ÿ”ฒ Export your code to Stackblitz and CodeSandbox with a click.
  5. ๐Ÿ–Œ๏ธ Format your code with prettier.

Known bugs and limitations

  • The bundler will automatically import from esm.sh, and is therefore subject to any limitations coming from the CDN (e.g. some dependencies cannot be imported)
  • You can only open .jsx tabs. However, you can style your components with CSS in js libraries, such as styled-components
  • Only JS/JSX third-party libraries can be imported (no CSS @import). However, most CSS-in-JS libraries, like styled-components workwork normally.

Technologies used

Credits

React Playground is inspired by SvelteJS REPL, SolidJS Playground, and VueJS Playground.

This Udemy course by Stephen Grider was essential to learn how to work with bundlers in the browser.

reactplayground's People

Contributors

aylosrd avatar

Stargazers

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

Watchers

 avatar

Forkers

image72 gowram

reactplayground's Issues

Feature: Move to Monaco Editor

Need to move to Monaco Editor, as it will help passing to Typescript mode.
Monaco must have autoLineWrap enabled.

It's going to be diffucult because Monaco runs best on webpack, have to figure out a way

Feature: allow css files

It should be possible to add css files too (and additionally js) other than jsx.
Possible side effects to monitor in the download and export flow.

Enhancement: fetch and log complete description of minified react errors

Explore possibility to get complete error message from react minified error code by fetching it from react website.
Eg.

Uncaught Error: Minified React error #300; visit https://reactjs.org/docs/error-decoder.html?invariant=300 for the full message or use the non-minified dev environment for full errors and additional helpful warnings.

Add loader for async tasks

Add loader (in button? mouse icon?) when async tasks are ongoing, (e.g. downloading project, or generating Stackblitz/CodeSandbox)

Add report bug button

Add a button in the navbar that opens in a new tab this github issues page. Github icon.

Feature: Add prettifier

Add a button on the tabs bar that, when clicked, prettifies the current file. Use webworkers if possible.

Feature: Allow to download project

Need to create a download button, that generates a whole folder with a vite-react initialized project, including npm packages used in the playground and file structure.

Better hanling cases of broken url hash

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.