react-run

Crates.ioreact-run
lib.rsreact-run
version0.3.1
sourcesrc
created_at2022-01-24 17:46:44.930902
updated_at2022-04-06 15:12:53.807931
descriptionRun React code snippets/components from your command-line without config
homepagehttps://github.com/UltiRequiem/react-run
repositoryhttps://github.com/UltiRequiem/react-run
max_upload_size
id520322
size69,168
Eliaz Bobadilla (UltiRequiem)

documentation

README

react-run

Run React code snippets without config 🚀

Usage

The entry point is always a component called App 👇

// example.tsx

function ProductList({ products }: { products: string[] }) {
  return products.map((p: string) => <li>{p}</li>);
}

export default function App() {
  const style: { [key: string]: string } = {
    background: "lightgray",
    padding: "1em",
  };

  return (
    <div style={style}>
      <h1>Our Products</h1>
      <ProductList products={["Apple", "Banana"]} />
    </div>
  );
}

Run it 🏃

react-run example.tsx

Or run a hosted file 🤖

react-run https://raw.githubusercontent.com/UltiRequiem/react-run/main/examples/typescript.tsx

This will open your default browser with your component loaded 🤯

Features

  • JSX/TSX

  • Functional or Class Components

  • Import External Libraries

  • Run via URL

Check the examples/ to see what is supported.

Installation

Cargo is the Rust package manager.

cargo install react-run

Or use a binary from releases.

Standing on the shoulders of giants

  • 🗼 tokio-rs: A runtime for writing reliable asynchronous applications with Rust.

  • 🤗 colored: The easier way to have text on your term!

  • 👏 clap: A full featured, fast Command Line Argument Parser for Rust

  • minireq: Simple, minimal-dependency HTTP client.

Roadmap

  • Integrate with SWC #4
  • Support TypeScript #2
  • Support running URLs #3
  • Live Reload #1

Support

Open an Issue, I will check it a soon as possible 👀

If you want to hurry me up a bit send me a tweet 😆

Consider supporting me on Patreon if you like my work 🙏

Don't forget to start the repo ⭐

Versioning

We use Semantic Versioning. For the versions available, see the tags 🏷️

Authors

Eliaz Bobadilla - Creator and Maintainer 💪

See also the full list of contributors who participated in this project ✨

Licence

Licensed under the MIT License 📄

Commit count: 51

cargo fmt