Zopfli[^1] performs very good, but time-intensive, zlib compression.
It is hence only suitable for pre-compressing objects, not on-the-fly
compression.
Use a webpack plugin to write pre-compressed versions of JS and CSS
assets using Zopfli, and configure nginx to serve those assets when
`Accept-Encoding: gzip` is provided.
This reduces the size of the JS and CSS assets on initial pageload
from 1422872 bytes to 1108267 bytes, or about a 22% savings.
[^1]: https://github.com/google/zopfli
We are adding MDX files to `.gitignore` for now since they are
just a result of a build process, once the migration is done,
we will not ignore them.
We're using PNPM workspaces to manage this project.
The new project's tsconfig.json has been copied from the current
root tsconfig.json while omitting some details that are only
relevant to that project.
`help-beta/src/env.d.ts` is a type declaration file auto-generated
by Astro. See https://github.com/withastro/astro/issues/6013.
In Firefox, event targets can be pseudo elements like text
nodes which don't have .closest method. This results in error
when delegate tries to handle trigger for a text node target.
Since https://github.com/atomiks/tippyjs/pull/1166 has no
response from the developer, we decided to apply this patch
ourselves.
It’s been unused since its introduction in commit
c13e3dee24. (koa-bodyparser is not
@koa/bodyparser; the latter has built-in TypeScript support.)
Signed-off-by: Anders Kaseorg <anders@zulip.com>
It’s been unused since its introduction in commit
c13e3dee24 (#29198), and also not
permissively licensed.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
Replace a separate call to subprocess, starting `node` from scratch,
with an optional standalone node Express service which performs the
rendering. In benchmarking, this reduces the overhead of a KaTeX call
from 120ms to 2.8ms. This is notable because enough calls to KaTeX in
a single message would previously time out the whole message
rendering.
The service is optional because he majority of deployments do not use
enough LaTeX to merit the additional memory usage (60Mb).
Fixes: #17425.
date-fns-tz does not handle daylight saving time correctly, and can be
replaced with modern browser APIs.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
`signup.js` uses `jquery-validation` plugin, which is a javascript
package shipped without type definitions. Installing its corresponding
types help with TypeScript migration by allowing types annotations
involving the plugin methods and obejcts.