Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add README.md and images for 01-basic-esnext #206

Open
wants to merge 3 commits into
base: trunk
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions 01-basic-esnext/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Basic Block
Simple block, renders and saves the same content without interactivity. Using inline styles - no external stylesheet needed. Not recommended because all of these styles will appear in `post_content`.

"Hello World: Step 1" from [Writing Your First Block Type](https://wordpress.org/gutenberg/handbook/blocks/writing-your-first-block-type/).

This is the version with ESNext, the version without it can be found [here](https://github.com/WordPress/gutenberg-examples/tree/master/01-basic).

## Screenshots
### Editor
![A red block with the text "Hello World, step 1 (from the editor)"](../images/basic-editor.png)
### Front-End
![A red block with the text "Hello World, step 1 (from the frontend)"](../images/basic-client.png)

## Uses
### Wordpress Packages
These are exposed via `window.wp`.
* [@wordpress/i18n](https://wordpress.org/gutenberg/handbook/packages/packages-i18n/)
* [@wordpress/blocks](https://wordpress.org/gutenberg/handbook/packages/packages-blocks/)

### NPM Packages
* [babel-core](https://www.npmjs.com/package/babel-core)
* [babel-loader](https://www.npmjs.com/package/babel-loader)
* [babel-plugin-transform-react-jsx](https://www.npmjs.com/package/babel-plugin-transform-react-jsx)
* [babel-preset-env](https://www.npmjs.com/package/babel-preset-env)
* [cross-env](https://www.npmjs.com/package/cross-env)
* [webpack](https://www.npmjs.com/package/webpack)

## Building
First, make sure you have [Node.js](https://nodejs.org/en/) installed and run `npm install` to install the dependencies.
* `npm run dev` builds a development version of the plugin and watches for changes for automatic rebuild.
* `npm run build` builds a production version of the plugin.
Binary file added images/basic-client.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/basic-editor.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.