Goals: Add links that are reasonable and good explanations of how stuff works. No hype and no vendor content if possible. Practical first-hand accounts of models in prod eagerly sought.
The package that linked you here is now pure ESM. It cannot be require()
'd from CommonJS.
This means you have the following choices:
- Use ESM yourself. (preferred)
Useimport foo from 'foo'
instead ofconst foo = require('foo')
to import the package. You also need to put"type": "module"
in your package.json and more. Follow the below guide. - If the package is used in an async context, you could use
await import(…)
from CommonJS instead ofrequire(…)
. - Stay on the existing version of the package until you can move to ESM.
#!/bin/bash | |
# Requires ffmpeg - brew install ffmpeg | |
if [[ -z "$1" ]]; then | |
echo "Usage: $0 Screen\\ Recording\\ at\\ 2021-01-21.mov" | |
exit 1 | |
fi | |
basefilename=$(basename "$1" .mov) | |
outputname="$basefilename.mp4" | |
nice ffmpeg \ |
#!/bin/bash | |
DAYS_SINCE_LAST_CHANGE=14 # If a project hasn't been touched in this long its node_modules will be deleted | |
SEARCH_PATH="./Git" # Update this to the path where your code is stored | |
TOTAL_BYTES_REMOVED=0 | |
Mb=1000000 | |
Kb=1000 | |
node_modules=$(find $SEARCH_PATH -name "node_modules" -type d -prune) |
patch-package | |
--- a/node_modules/webpack/lib/dependencies/ImportParserPlugin.js | |
+++ b/node_modules/webpack/lib/dependencies/ImportParserPlugin.js | |
@@ -28,7 +28,8 @@ class ImportParserPlugin { | |
const param = parser.evaluateExpression(expr.arguments[0]); | |
let chunkName = null; | |
- let mode = "lazy"; | |
+ // let mode = "lazy"; | |
+ let mode = "eager"; |
just the bare necessities of state management.
Hotlink it from https://unpkg.com/valoo
.
Note:
When this guide is more complete, the plan is to move it into Prepack documentation.
For now I put it out as a gist to gather initial feedback.
If you're building JavaScript apps, you might already be familiar with some tools that compile JavaScript code to equivalent JavaScript code:
- Babel lets you use newer JavaScript language features, and outputs equivalent code that targets older JavaScript engines.
// Licensed under CC BY 4.0. | |
type $If<X: boolean, Then, Else = empty> = $Call< | |
& ((true, Then, Else) => Then) | |
& ((false, Then, Else) => Else), | |
X, | |
Then, | |
Else, | |
>; |
// `fix` is an Y-combinator implementation (recursive calls in lambda calculus): | |
// Y = \f -> (\x -> f (x x))(\x -> f (x x)) | |
// fix :: (a -> a) -> a | |
const fix = f => (x => f(y => (x(x))(y)))(x => f(y => (x(x))(y))); | |
// Generator function. Inner signature should correspond to actual function interface. | |
// mapgen :: ((a -> b) -> [a] -> [b]) -> (a -> b) -> [a] -> [b] | |
const mapgen = map => f => list => list.length === 0 ? [] : [f(list[0]), ...map(f)(list.slice(1))]; |
The proposal you’re about to read is not just a proposal. We have a working implementation of almost everything we discussed here. We encourage you to checkout and build our branch: our fork, with the relevant branch selected. Building and using the implementation will give you a better understanding of what using it as a developer is like.
Our implementation ended up differing from the proposal on some minor points. As our last action item before making a PR, we’re writing documentation on what we did. While I loathe pointing to tests in lieu of documentation, they will be helpful until we complete writing docs: the unit tests.
This repo also contains a bundled version of npm that has a new command, asset
. You can read the documentation for and goals of that comma