Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacob Schatz <jschatz1@gmail.com>2016-07-22 17:53:45 +0300
committerStan Hu <stanhu@gmail.com>2016-07-23 06:13:46 +0300
commitd6ebd4a3f7af1b78259edc4a3ffdc4778f5d0725 (patch)
treef45ed4438ca53b13719e81189a694bda94b589bb /doc/development/gotchas.md
parent46a17ffd5a200b4d2aca914ef5bafe46db1cb9bf (diff)
Update docs for CoffeeScript -> JavaScript.
Diffstat (limited to 'doc/development/gotchas.md')
-rw-r--r--doc/development/gotchas.md5
1 files changed, 3 insertions, 2 deletions
diff --git a/doc/development/gotchas.md b/doc/development/gotchas.md
index 9d7fe7440d2..fc52027ab94 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