diff options
author | Rémy Coutable <remy@rymai.me> | 2016-08-04 11:41:52 +0000 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2016-08-04 11:41:52 +0000 |
commit | f4c79d6a84defb6ffae7d29a5c9a81fbc413f16c (patch) | |
tree | d65677683784575c6debe1c2776688b2ee2ba381 | |
parent | e0953d18c9e1a4b0c792c81c208108bf62293cfc (diff) | |
parent | 8c8599a6056766313252e618e87b32456e26e10e (diff) | |
download | gitlab-ce-f4c79d6a84defb6ffae7d29a5c9a81fbc413f16c.tar.gz |
Merge branch 'coffescript_docs_migration' into 'master'
Update docs for CoffeeScript -> JavaScript.
## What does this MR do?
Removes some CoffeeScript docs and adds more JS ones
## Are there points in the code the reviewer needs to double check?
No
## Why was this MR needed?
To migrate some docs
## What are the relevant issue numbers?
#20098
## Screenshots (if relevant)
None
## Does this MR meet the acceptance criteria?
- [x] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG) entry added
- [x] [Documentation created/updated](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/doc_styleguide.md)
- [ ] API support added
- Tests
- [ ] Added for this feature/bug
- [ ] All builds are passing
- [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides)
- [x] Branch has no merge conflicts with `master` (if you do - rebase it please)
- [x] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits)
See merge request !5433
-rw-r--r-- | CONTRIBUTING.md | 3 | ||||
-rw-r--r-- | doc/development/gotchas.md | 5 |
2 files changed, 5 insertions, 3 deletions
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a885e706810..2f522c1e39a 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -462,7 +462,8 @@ merge request: - string literal quoting style **Option A**: single quoted by default 1. [Rails](https://github.com/bbatsov/rails-style-guide) 1. [Testing](doc/development/testing.md) -1. [CoffeeScript](https://github.com/thoughtbot/guides/tree/master/style/coffeescript) +1. [JavaScript (ES6)](https://github.com/airbnb/javascript) +1. [JavaScript (ES5)](https://github.com/airbnb/javascript/tree/master/es5) 1. [SCSS styleguide][scss-styleguide] 1. [Shell commands](doc/development/shell_commands.md) created by GitLab contributors to enhance security diff --git a/doc/development/gotchas.md b/doc/development/gotchas.md index 9d7fe7440d2..159d5ce286d 100644 --- a/doc/development/gotchas.md +++ b/doc/development/gotchas.md @@ -41,10 +41,10 @@ Rubocop](https://gitlab.com/gitlab-org/gitlab-ce/blob/8-4-stable/.rubocop.yml#L9 [Exception]: http://stackoverflow.com/q/10048173/223897 -## Don't use inline CoffeeScript in views +## Don't use inline CoffeeScript/JavaScript in views Using the inline `:coffee` or `:coffeescript` Haml filters comes with a -performance overhead. +performance overhead. Using inline JavaScript is not a good way to structure your code and should be avoided. _**Note:** We've [removed these two filters](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/config/initializers/hamlit.rb) in an initializer._ @@ -52,6 +52,7 @@ in an initializer._ ### Further reading - Pull Request: [Replace CoffeeScript block into JavaScript in Views](https://git.io/vztMu) +- Stack Overflow: [Why you should not write inline JavaScript](http://programmers.stackexchange.com/questions/86589/why-should-i-avoid-inline-scripting) - Stack Overflow: [Performance implications of using :coffescript filter inside HAML templates?](http://stackoverflow.com/a/17571242/223897) ## ID-based CSS selectors need to be a bit more specific |