This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import html from "@radically-straightforward/html"; | |
// https://www.youtube.com/watch?v=dSK-MW-zuAc | |
const order = 2; | |
const viewBox = 24; /* var(--space--6) */ | |
// Hilbert | |
// let points = [ | |
// [1 / 4, 1 / 4], | |
// [1 / 4, 3 / 4], | |
// [3 / 4, 3 / 4], |
We use two tools to measure the performance of slow pages:
- 0x: Profile the application and generate flame graphs.
- autocannon: Load test (send lots of requests) and measure response time (which autocannon calls “latency”) & throughput.
Here’s a step-by-step guide of how to use these tools in Courselore:
-
Run the application normally.
Note: Don’t use a custom
HOSTNAME
, because autocannon may not recognize the self-signed certificate generated by Caddy.
- Similar Libraries.
- https://npm.im/morphdom
- Transposition is only handled via
id
s, which are global, not scoped to siblings. - Doesn’t handle well the case of insertions in the middle, losing state (for example, scrolling position) of siblings, because it detaches and reattaches them.
- Transposition is only handled via
- https://npm.im/nanomorph
- Transposition is only handled via
id
s, which are global, not scoped to siblings.- Maybe it could be handled with
data-nanomorph-component-id
, but still, as far as I understand, it doesn’t do LCS, and probably detaches and reattaches elements similar to morphdom.
- Maybe it could be handled with
- No lifecycle callbacks (though most of them are subsumed by other mechanisms, for example,
.isSameNode()
). - Transferring callback handlers seems heavy-handed (though it may be a good idea in practice).
- Transposition is only handled via
- https://npm.im/morphdom
- Others
- Interpolation
- What I think of as interpolation many libraries call “dynamic” properties/styles/etc.
- Astroturf
- Allows two types of interpolation:
- Values, using CSS variables.
- Blocks, using extra classes.
- Doesn’t seem to support nesting, because that requires you to parse the CSS & extract the classes nested inside.
- Allows two types of interpolation:
- vanilla-extract
- Doesn’t seem to allow for interpolation.
- Linaria
-
Create the tunnel. If you’re part of the Courselore team, you may request a custom Courselore tunnel address such as
leafac.courselore.org
, otherwise you may use services such as Localtunnel and localhost.run, for example:# Custom Courselore Tunnel Address $ ssh -NR 3000:localhost:80 [email protected] # Localtunnel $ npx localtunnel --port 80
-
Features
- Schedule jobs
- Schedule jobs in the future
- Explicit failure: An exception was thrown
- Implicit failure: A job was picked up and not finished in a certain amount of time
- Retry jobs that failed (explicitly or implicitly)
- After a certain number of retries, fail the job
- Have a way to force the worker to run immediately
-
On graceful termination finish existing jobs
- TypeScript transformation
- The
tsc
compiler doesn’t yet let you run your own transforms. - And what if your project isn’t using TypeScript?
- The
- esbuild doesn’t allow you to manipulate the AST
- Babel Plugin (That’s my option)
- More powerful & easier to conceptualize.
- Babel Macros (https://github.com/kentcdodds/babel-plugin-macros)
- Useful for
create-react-app
and things that don’t allow you to change configuration easily. - Macros have to be CommonJS
- Useful for
- A Babel visitor must be synchronous and the visitor needs to
require()
the macro definition, butimport()
is async.
NewerOlder