This shows the execution order given JavaScript's Call Stack, Event Loop, and any asynchronous APIs provided in the JS execution environment (in this example; Web APIs in a Browser environment)
Given the code
| import crypto from "crypto"; | |
| import { renderToStaticMarkup } from "react-dom/server"; | |
| import createMailgun from "mailgun-js"; | |
| import type { ActionFunction, LoaderFunction, Session } from "remix"; | |
| import { createCookieSessionStorage, json, redirect } from "remix"; | |
| /******************************************************************************* | |
| * Before we can do anything, we need to make sure the environment has | |
| * everything we need. If anything is missing, we just prevent the app from | |
| * starting up. |
| #!/bin/sh | |
| ### | |
| # SOME COMMANDS WILL NOT WORK ON macOS (Sierra or newer) | |
| # For Sierra or newer, see https://github.com/mathiasbynens/dotfiles/blob/master/.macos | |
| ### | |
| # Alot of these configs have been taken from the various places | |
| # on the web, most from here | |
| # https://github.com/mathiasbynens/dotfiles/blob/5b3c8418ed42d93af2e647dc9d122f25cc034871/.osx |