docs/javascripts
Kevin Heis 380c4dcc82
Hydro exit event (#16067)
* Start a basic exit event

* Combine to one performance function

* Lint

* Fancy operators

* Update events.js

* Update events.js

* Update cookie-settings.js

* Add scroll tracking

* Tell "standard" to use babel-eslint

* Throttle scroll tracking

* Lint

* Use sendBeacon

* Update index.js
2020-10-21 09:42:02 -07:00
..
README.md Hello git history spelunker! 2020-09-27 14:10:11 +02:00
copy-code.js Add copy button to code blocks (#16052) 2020-10-16 10:55:35 -04:00
deprecation-banner.js Hello git history spelunker! 2020-09-27 14:10:11 +02:00
display-platform-specific-content.js Hello git history spelunker! 2020-09-27 14:10:11 +02:00
events.js Hydro exit event (#16067) 2020-10-21 09:42:02 -07:00
experiment.js Migrate experiments and helpfulness to Hydro (#16059) 2020-10-19 14:31:54 -07:00
explorer.js Hello git history spelunker! 2020-09-27 14:10:11 +02:00
get-csrf.js Send CSRF tokens over XHR (#15778) 2020-09-28 09:44:14 -07:00
google-analytics.js Hello git history spelunker! 2020-09-27 14:10:11 +02:00
helpfulness.js Migrate experiments and helpfulness to Hydro (#16059) 2020-10-19 14:31:54 -07:00
index.js Add copy button to code blocks (#16052) 2020-10-16 10:55:35 -04:00
localization.js Hello git history spelunker! 2020-09-27 14:10:11 +02:00
nav.js Hello git history spelunker! 2020-09-27 14:10:11 +02:00
print.js Hello git history spelunker! 2020-09-27 14:10:11 +02:00
search.js Add analyticsTags to Algolia search queries (#15719) 2020-09-30 18:31:04 +02:00
sidebar.js Hello git history spelunker! 2020-09-27 14:10:11 +02:00
user-agent.js Create a user agent parser for analytics (#15915) 2020-10-21 07:43:09 -07:00
wrap-code-terms.js Do not modify hrefs when wrapping code terms (#15785) 2020-09-28 16:50:29 -04:00

README.md

Javascripts

The code in this directory is destined to run in a web browser!

The index.js file in this directory is bundled by Webpack. In development, we use webpack-dev-middleware to bundle automatically while running the server. In production, we run webpack --mode production via npm run build.

This file is then referenced in the footer:

<script src="/dist/index.js"></script>

Every other file in this directory is written as a module to be required in index.js. They all have this format:

module.exports = () => {
  // Do some cool browser stuff
  // Note: by the time this runs, the DOM will be ready. :)
}

In development, the bundle will recompile every time a file used by javascripts/index.js is changed. This ensures that you're always getting an up-to-date version of the script.

In production, the bundle is compiled during build-time.