Skip to content

Commit

Permalink
update github templates (#35)
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewmcodes authored and hopsoft committed Sep 13, 2019
1 parent e0d3426 commit 0920c5a
Show file tree
Hide file tree
Showing 5 changed files with 195 additions and 32 deletions.
42 changes: 42 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
---
name: Bug report
about: Create a report to help us improve
---

# Bug Report

_Please help us help you by filling out any applicable information in this template and removing the rest!_

## Describe the bug

A clear and concise description of what the bug is.

## To Reproduce

Steps to reproduce the behavior

## Expected behavior

A clear and concise description of what you expected to happen.

## Screenshots or reproduction

If applicable, add screenshots (errors, example of the behavior, etc.) to help explain your problem or post a link to a repository that replicates the issue.

## Versions

### StimulusReflex

- Gem: [e.g. 2.0.1]
- Node package: [e.g. 2.0.1]

### External tools

- Ruby: [e.g. 2.6.4]
- Rails: [e.g. 6.0.0]
- Node: [e.g. 12.4.0]

### Browser

- Browser [e.g. chrome, safari]
- Version [e.g. 22]
24 changes: 24 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
name: Feature request
about: Suggest an idea for this project
---

# Feature Request

_Please help us help you by filling out any applicable information in this template and removing the rest!_

## Is your feature request related to a problem?

A clear and concise description of what the problem is. If this is a bug, please open a bug report instead of a feature request!

## Describe the solution you'd like

A clear and concise description of what you want to happen. Please also include alternative solutions or features you've considered.

## Additional context

Add any other context or screenshots about the feature request here.

## PR link

If you have opened a pull request to address the issue, please link it here.
16 changes: 16 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Type of PR (feature, enhancement, bug fix, etc.)

## Description

Please include a summary of the change and which issue is fixed.

Fixes # (issue)

## Why should this be added

Explain value.

## Checklist

- [ ] My code follows the style guidelines of this project
- [ ] Checks (StandardRB & Prettier) are passing
76 changes: 76 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# Contributor Covenant Code of Conduct

## Our Pledge

In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, sex characteristics, gender identity and expression,
level of experience, education, socio-economic status, nationality, personal
appearance, race, religion, or sexual identity and orientation.

## Our Standards

Examples of behavior that contributes to creating a positive environment
include:

- Using welcoming and inclusive language
- Being respectful of differing viewpoints and experiences
- Gracefully accepting constructive criticism
- Focusing on what is best for the community
- Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

- The use of sexualized language or imagery and unwelcome sexual attention or
advances
- Trolling, insulting/derogatory comments, and personal or political attacks
- Public or private harassment
- Publishing others' private information, such as a physical or electronic
address, without explicit permission
- Other conduct which could reasonably be considered inappropriate in a
professional setting

## Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.

## Scope

This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community. Examples of
representing a project or community include using an official project e-mail
address, posting via an official social media account, or acting as an appointed
representative at an online or offline event. Representation of a project may be
further defined and clarified by project maintainers.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at natehop@gmail.com. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html

[homepage]: https://www.contributor-covenant.org

For answers to common questions about this code of conduct, see
https://www.contributor-covenant.org/faq
69 changes: 37 additions & 32 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ It's designed to work perfectly with [server rendered HTML](https://guides.rubyo
[Russian doll caching](https://edgeguides.rubyonrails.org/caching_with_rails.html#russian-doll-caching),
[Stimulus](https://stimulusjs.org), [Turbolinks](https://www.youtube.com/watch?v=SWEts0rlezA), etc...

__No need for a complex front-end framework. No need to grow your team or duplicate your efforts.__
**No need for a complex front-end framework. No need to grow your team or duplicate your efforts.**

_Inspired by [Phoenix LiveView](https://youtu.be/Z2DU0qLfPIY?t=670)._ 🙌

Expand All @@ -26,28 +26,28 @@ _Inspired by [Phoenix LiveView](https://youtu.be/Z2DU0qLfPIY?t=670)._ 🙌
- [Before you Begin](#before-you-begin)
- [How it Works](#how-it-works)
- [Setup](#setup)
* [JavaScript](#javascript)
+ [app/javascript/controllers/index.js](#appjavascriptcontrollersindexjs)
* [Gemfile](#gemfile)
- [JavaScript](#javascript)
- [app/javascript/controllers/index.js](#appjavascriptcontrollersindexjs)
- [Gemfile](#gemfile)
- [Usage](#usage)
* [Zero JavaScript](#zero-javascript)
+ [app/views/pages/example.html.erb](#appviewspagesexamplehtmlerb)
+ [app/reflexes/example_reflex.rb](#appreflexesexample_reflexrb)
* [Minimal JavaScript](#minimal-javascript)
+ [app/views/pages/example.html.erb](#appviewspagesexamplehtmlerb-1)
+ [app/javascript/controllers/example.js](#appjavascriptcontrollersexamplejs)
+ [app/reflexes/example_reflex.rb](#appreflexesexample_reflexrb-1)
- [Zero JavaScript](#zero-javascript)
- [app/views/pages/example.html.erb](#appviewspagesexamplehtmlerb)
- [app/reflexes/example_reflex.rb](#appreflexesexample_reflexrb)
- [Minimal JavaScript](#minimal-javascript)
- [app/views/pages/example.html.erb](#appviewspagesexamplehtmlerb-1)
- [app/javascript/controllers/example.js](#appjavascriptcontrollersexamplejs)
- [app/reflexes/example_reflex.rb](#appreflexesexample_reflexrb-1)
- [What Just Happened](#what-just-happened)
- [Advanced Usage](#advanced-usage)
* [The Reflex `element` property](#the-reflex-element-property)
* [ActionCable](#actioncable)
+ [Performance](#performance)
+ [ActionCable Rooms](#actioncable-rooms)
* [Render Delay](#render-delay)
- [The Reflex `element` property](#the-reflex-element-property)
- [ActionCable](#actioncable)
- [Performance](#performance)
- [ActionCable Rooms](#actioncable-rooms)
- [Render Delay](#render-delay)
- [Demo Applications](#demo-applications)
- [Contributing](#contributing)
* [Coding Standards](#coding-standards)
* [Releasing](#releasing)
- [Coding Standards](#coding-standards)
- [Releasing](#releasing)

<!-- tocstop -->

Expand All @@ -61,9 +61,9 @@ _Check out the [Stimulus TodoMVC](https://github.com/hopsoft/stimulus_todomvc) e

StimulusReflex offers 3 primary benefits over the traditional Rails HTTP request/response cycle.

1. __Communication happens on the ActionCable web socket__ _- saves time by avoiding the overhead of establishishing traditional HTTP connections_
1. __The controller action is invoked directly__ _- skips framework overhead such as the middleware chain, etc..._
1. __DOM diffing is used to update the page__ _- provides faster rendering and less jitter_
1. **Communication happens on the ActionCable web socket** _- saves time by avoiding the overhead of establishishing traditional HTTP connections_
1. **The controller action is invoked directly** _- skips framework overhead such as the middleware chain, etc..._
1. **DOM diffing is used to update the page** _- provides faster rendering and less jitter_

## How it Works

Expand All @@ -72,7 +72,7 @@ StimulusReflex offers 3 primary benefits over the traditional Rails HTTP request
1. Watch the page automatically render updates via fast [DOM diffing](https://github.com/patrick-steele-idem/morphdom)
1. That's it...

__Yes, it really is that simple.__
**Yes, it really is that simple.**
There are no hidden gotchas.

![How it Works](https://raw.githubusercontent.com/hopsoft/stimulus_reflex/master/docs/diagram.png)
Expand All @@ -81,9 +81,10 @@ There are no hidden gotchas.

### JavaScript

```
```sh
yarn add stimulus_reflex
```

#### app/javascript/controllers/index.js

This is the file where Stimulus is initialized in your application.
Expand Down Expand Up @@ -140,7 +141,7 @@ end

The code above will automatically update the relevant DOM nodes with the updated count whenever the anchor is clicked.

__Note that all concerns (from managing state to rendering views) are handled server side.__
**Note that all concerns (from managing state to rendering views) are handled server side.**
This technique works regardless of how complex the UI may become.
For example, we could render multiple instances of `@count` in unrelated sections of the page and they will all update.

Expand All @@ -166,8 +167,8 @@ Stimulus controller to handle the DOM event and trigger the server side reflex.
#### app/javascript/controllers/example.js

```javascript
import { Controller } from "stimulus"
import StimulusReflex from "stimulus_reflex"
import { Controller } from 'stimulus';
import StimulusReflex from 'stimulus_reflex';

export default class extends Controller {
connect() {
Expand Down Expand Up @@ -213,11 +214,7 @@ It contains all of the Stimulus controller's
_Most of the values will be strings._

```html
<checkbox id="example"
label="Example"
data-controller="checkbox"
data-value="123"
checked />
<checkbox id="example" label="Example" data-controller="checkbox" data-value="123" checked />
```

```ruby
Expand Down Expand Up @@ -278,7 +275,7 @@ Simply set the `renderDelay` _(milliseconds)_ option when registering the contro
```javascript
export default class extends Controller {
connect() {
StimulusReflex.register(this, {renderDelay: 200});
StimulusReflex.register(this, { renderDelay: 200 });
}
}
```
Expand All @@ -295,6 +292,10 @@ Building apps with StimulusReflex should evoke your memories of the original [Ra

## Contributing

### Code of Conduct

Everyone interacting with StimulusReflex is expected to follow the [Code of Conduct](CODE_OF_CONDUCT.md)

### Coding Standards

This project uses [Standard](https://github.com/testdouble/standard)
Expand All @@ -308,3 +309,7 @@ Please run `./bin/standardize` prior submitting pull requests.
1. Run `rake release`
1. Change directories `cd ./javascript`
1. Run `yarn publish` - NOTE: this will throw a fatal error because the tag already exists but the package will still publish

## License

StimulusReflex is released under the [MIT License](LICENSE.txt).

0 comments on commit 0920c5a

Please sign in to comment.