docs/javascripts
Sarah Edwards c594dff941
fix ts bug (#19945)
2021-06-15 22:44:02 +00:00
..
README.md Hello git history spelunker! 2020-09-27 14:10:11 +02:00
airgap-links.ts Update current JavaScripts to use Typescript (#19824) 2021-06-14 18:07:39 +00:00
all-articles.ts Update current JavaScripts to use Typescript (#19824) 2021-06-14 18:07:39 +00:00
browser-date-formatter.d.ts Update current JavaScripts to use Typescript (#19824) 2021-06-14 18:07:39 +00:00
copy-code.ts Update current JavaScripts to use Typescript (#19824) 2021-06-14 18:07:39 +00:00
dev-toc.ts Update current JavaScripts to use Typescript (#19824) 2021-06-14 18:07:39 +00:00
display-platform-specific-content.ts SubLanding page filter (#19918) 2021-06-15 18:16:24 +00:00
display-tool-specific-content.ts fix ts bug (#19945) 2021-06-15 22:44:02 +00:00
events.ts Update current JavaScripts to use Typescript (#19824) 2021-06-14 18:07:39 +00:00
experiment.ts Update current JavaScripts to use Typescript (#19824) 2021-06-14 18:07:39 +00:00
explorer.ts Update current JavaScripts to use Typescript (#19824) 2021-06-14 18:07:39 +00:00
filter-cards.ts Update current JavaScripts to use Typescript (#19824) 2021-06-14 18:07:39 +00:00
get-csrf.ts Update current JavaScripts to use Typescript (#19824) 2021-06-14 18:07:39 +00:00
hyperscript.ts Update current JavaScripts to use Typescript (#19824) 2021-06-14 18:07:39 +00:00
index.ts Update current JavaScripts to use Typescript (#19824) 2021-06-14 18:07:39 +00:00
localization.ts Update current JavaScripts to use Typescript (#19824) 2021-06-14 18:07:39 +00:00
nav.ts Update current JavaScripts to use Typescript (#19824) 2021-06-14 18:07:39 +00:00
print.ts Update current JavaScripts to use Typescript (#19824) 2021-06-14 18:07:39 +00:00
release-notes.ts Update current JavaScripts to use Typescript (#19824) 2021-06-14 18:07:39 +00:00
scroll-anchoring.d.ts fix ts bug (#19945) 2021-06-15 22:44:02 +00:00
scroll-up.ts Update current JavaScripts to use Typescript (#19824) 2021-06-14 18:07:39 +00:00
search-with-your-keyboard.d.ts Update current JavaScripts to use Typescript (#19824) 2021-06-14 18:07:39 +00:00
search.ts Update current JavaScripts to use Typescript (#19824) 2021-06-14 18:07:39 +00:00
set-next-env.ts Update current JavaScripts to use Typescript (#19824) 2021-06-14 18:07:39 +00:00
show-more.ts Update current JavaScripts to use Typescript (#19824) 2021-06-14 18:07:39 +00:00
sidebar.ts Update current JavaScripts to use Typescript (#19824) 2021-06-14 18:07:39 +00:00
survey.ts Update current JavaScripts to use Typescript (#19824) 2021-06-14 18:07:39 +00:00
toggle-images.ts Update current JavaScripts to use Typescript (#19824) 2021-06-14 18:07:39 +00:00
user-agent.ts Update current JavaScripts to use Typescript (#19824) 2021-06-14 18:07:39 +00:00
wrap-code-terms.ts Update current JavaScripts to use Typescript (#19824) 2021-06-14 18:07:39 +00: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.