Code Monkey home page Code Monkey logo

gutenberg-rust-starter's Introduction

Gutenberg + Rust + TypeScript

This is a minimum block plugin template to rapidly get started building WP blocks using Rust + TypeScript.

Getting Started

  • Run npm install to install necessary packages
  • Run npm run rename <text-domain> <label> to rename from rust-starter.
  • Run npm run start to start the dev server
  • Run cypress open to run interactive tests

Features

This is an opinionated starter template that is designed to fit my personal workflow. However, I've added a small script to clean up and remove some features.

  • To remove Tailwind, run npm run eject tailwind
  • To remove Rust, run npm run eject rust
  • To remove Cypress, run npm run eject cypress

Rust

Rust is a systems programming language with a strong type system, memory safety, and great documentation. Beyond that it's fun to write and has a great community of helpful developers. Rust also compiles into WebAssembly, letting us utilize the power of systems programming on the web.

Read more about Rust: https://www.rust-lang.org/

TypeScript

TypeScript is essentially JavaScript with type safety. TypeScript will save you plenty of headaches while writing your code. Ever try to access a JS property on undefined? TypeScript will warn you before you even press save.

Read more about TypeScript: https://www.typescriptlang.org/

Tailwind CSS (heavily scoped)

Tailwind CSS is a utility framework designed for rapid building. Rather than maintaining CSS/scss files, you use specific class names directly in your markup, keeping the component logic, layout, and design in one place. You should default to WordPress components and classes when possible, and use Tailwind for everything beyond that.

This starter repo builds on top of Tailwind in a few useful ways:

  • Separates editor and frontend styles and processes them in isolation, keeping the stylesheet size on the frontend to a minimum
  • Removes the preflight and global Tailwind styles/animation presets so that there isn't a conflict with other blocks, plugins, etc.
  • On frontend styles, padding and margins will only be applied if the block doesn't have inline styling (e.g. .p-4:not([style*="padding"])). This lets you define a default while letting users override these values. Open an issue for more info.

Read more about Tailwind CSS: https://tailwindcss.com/

Cypress e2e testing

Cypress is a CLI test runner as well as an interactive one. Essentially it will run your tests through a browser, clicking here or there as you tell it to. It has an intuative API and is easy to learn. I've included some helpers to get started with WordPress, such as cy.loginUser() and cy.visitNewPageEditor()

Read more about Cypress: https://www.cypress.io/

Projects using this starter template

gutenberg-rust-starter's People

Contributors

dependabot[bot] avatar kevinbatdorf avatar montchr avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar

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.