Standardize capitalization of JavaScript (#9080)

* Standardize capitalization of JavaScript

* Reword links to alternate JS guides
This commit is contained in:
Jacob Herrington 2020-07-02 15:44:38 -05:00 committed by GitHub
parent 5739b9d651
commit 0c08a63622
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 15 additions and 15 deletions

View file

@ -1,23 +1,23 @@
---
title: Javascript and Initializers
title: JavaScript and Initializers
---
# Javascript and Initializers
# JavaScript and Initializers
DEV has two Javascript codebases.
DEV has two JavaScript codebases.
One is located in the directory `app/assets/javascripts` and contains plain
Javascript (mostly ES5+) being served using
JavaScript (mostly ES5+) being served using
[Sprockets](https://github.com/rails/sprockets-rails) which packages static
assets.
Webpacker manages the other one, and you can read more about [in its own
guide](/frontend/webpacker).
Webpacker manages the other one,
[which you can read more about in this guide](/frontend/webpacker).
This source code is not transpiled, only packaged and minified, and will be
limited to whatever flavour of Javascript can run on the user's web browser.
limited to whatever flavor of JavaScript can run on the user's web browser.
`app/assets/javascripts/application.js` contains the manifest Javascript file
`app/assets/javascripts/application.js` contains the manifest JavaScript file
which is included globally in the primary template,
`app/views/layouts/application.html.erb`.

View file

@ -4,10 +4,10 @@ title: Webpacker
# Webpacker
DEV has two Javascript codebases.
DEV has two JavaScript codebases.
One contains plain Javascript, you can read about it
[in its own guide](/frontend/plain-js).
One contains plain JavaScript,
[which you can read more about in this guide](/frontend/plain-js).
The other one is managed by [Webpacker](https://github.com/rails/webpacker), and
it's located inside `/app/javascripts`, written using ES6+.

View file

@ -197,7 +197,7 @@ NOTE: Make sure to download **the OSS version**, `elasticsearch-oss`.
> - Its first task is to install the `bundler` gem. Next, it will make
> `bundler` install all the gems, including `Rails`, located in `Gemfile`
> in the root of the repository. It also installs `foreman`.
> - It then installs javascript dependencies using the script in `bin/yarn`
> - It then installs JavaScript dependencies using the script in `bin/yarn`
> file. These dependencies are located in `package.json` in the root of the
> repository.
> - Next, it uses various Rake files located inside the `lib` folder to setup

View file

@ -50,7 +50,7 @@ tests, we then run a series of other checks. These additional checks are split
up between the different jobs. Here is a list of those additional checks that
are run.
- Job 0 is where we run Javascript tests, Preact tests, and coverage checks.
- Job 0 is where we run JavaScript tests, Preact tests, and coverage checks.
- Job 1 is where Travis builds Storybook to ensure its integrity, and where we
check for any known vulnerabilities using `bundle-audit`.
- Job 2 is where Travis fires up a Rails console to ensure the application loads

View file

@ -53,11 +53,11 @@ There are two ways to do this:
### `js: true` Flag
`js: true` indicates that we want the javascript on the page to be executed when
`js: true` indicates that we want the JavaScript on the page to be executed when
the page is rendered, and a headless chrome instance will be initialized to do
so (instead of the default
[rack_test](https://github.com/teamcapybara/capybara#racktest) driver). One side
effect of running our javascript in our specs is that a lot of pages will hit
effect of running our JavaScript in our specs is that a lot of pages will hit
Elasticsearch. Since we don't clean out Elasticsearch between every single spec
(because it is very costly) this can lead to unexpected data being loaded for a
spec. To prevent this from happening, we can use the `:stub_elasticsearch` flag.