This repository has been archived by the owner on Sep 18, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
422ffea
commit fbb417a
Showing
8 changed files
with
71 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,36 @@ | ||
# Drupal Block React | ||
Combining goodies of Drupal 8, Blocks and React. | ||
This one should be really minimal. | ||
# Drupal Block Reactive (codename Hipster) | ||
|
||
[Drupal 8](https://www.drupal.org/8) module creates a block with recent comments. Displayed dynamically using [React.js](https://facebook.github.io/react/). | ||
|
||
[ES2015 (ES6)](https://babeljs.io/docs/learn-es2015/) is used via Babel and npm scripts. | ||
|
||
The goal is to be as simple as possible: minimum dependencies, tools and steps to actually write ES6 code that works. This way, the code can be easily modified and played with for other purposes without too much hassle. | ||
|
||
## Requirements | ||
- [node.js](https://nodejs.org/en/download/) for using npm, not for API | ||
- npm for package management) | ||
- working [Drupal 8](https://www.drupal.org/project/drupal) project | ||
- command line obviously | ||
|
||
## Installation | ||
1. Go to the /modules folder in your Drupal 8 project (normally /modules from project root) | ||
2. Clone this repository | ||
3. Go to /js folder inside the cloned folder | ||
4. Run `npm install` to download dependencies | ||
5. Enable the Drupal module by `drush pm-enable drupal_block_reactive` or [via the UI](https://www.drupal.org/documentation/install/modules-themes/modules-8) | ||
6. Import example Views export configuration from the module. (/config/install, will be automatic later) | ||
7. Go to the block management page '/admin/structure/block' and find/place the custom module 'Recent comments (reactive)' | ||
8. Go to the page where you placed the block and you should see 'No comments.' message in a block. | ||
|
||
Now, play with the reactivity by splitting the window into 2 and posting a comment from one to the other. The expected modern behavior :) | ||
|
||
## Demo | ||
|
||
![ScreenShot](https://raw.github.com/kalinchernev/drupal_block_reactive/master/screenshot.gif) | ||
|
||
## Credits | ||
Inspirations from places: | ||
|
||
- [Drupal React Block](https://github.com/blackwood/drupal-react_blocks) (same idea for Drupal 7) | ||
- [React.js tutorial](https://facebook.github.io/react/docs/tutorial.html) | ||
- [Powering Up With React](https://www.codeschool.com/courses/powering-up-with-react) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,30 @@ | ||
{ | ||
"name": "drupal-block-reactive", | ||
"version": "1.0.0", | ||
"description": "JS things in Drupal things", | ||
"description": "A drop of reactivity in Drupal 8", | ||
"main": "index.js", | ||
"private": true, | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1", | ||
"dev": "./node_modules/babel-cli/bin/babel.js --presets es2015,react --watch src/ --out-dir dist" | ||
"clean": "rm -rf dist", | ||
"build": "npm run clean && npm run transpile", | ||
"dev": "./node_modules/babel-cli/bin/babel.js --presets es2015,react --watch src/ --out-dir dist", | ||
"lint": "eslint src", | ||
"transpile": "./node_modules/babel-cli/bin/babel.js --presets es2015,react src/ --out-dir dist" | ||
}, | ||
"author": "Kalin Chernev", | ||
"url": "https://github.com/kalinchernev", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/kalinchernev/drupal_block_reactive.git" | ||
}, | ||
"author": "", | ||
"license": "ISC", | ||
"devDependencies": { | ||
"babel-cli": "^6.10.1", | ||
"babel-preset-es2015": "^6.9.0", | ||
"babel-preset-react": "^6.5.0" | ||
"babel-preset-react": "^6.5.0", | ||
"eslint": "^2.12.0", | ||
"eslint-config-airbnb": "^9.0.1", | ||
"eslint-plugin-import": "^1.8.1", | ||
"eslint-plugin-jsx-a11y": "^1.4.2", | ||
"eslint-plugin-react": "^5.1.1" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters