- Install
@module-federation/nextjs-mf
.
yarn add @module-federation/nextjs-mf
- Add resolutions to
package.json
:
"resolutions": {
/* | |
Made by Elly Loel - https://ellyloel.com/ | |
With inspiration from: | |
- Josh W Comeau - https://courses.joshwcomeau.com/css-for-js/treasure-trove/010-global-styles/ | |
- Andy Bell - https://piccalil.li/blog/a-modern-css-reset/ | |
- Adam Argyle - https://unpkg.com/[email protected]/normalize.min.css / https://codepen.io/argyleink/pen/KKvRORE | |
Notes: | |
- `:where()` is used to lower specificity for easy overriding. | |
*/ |
// Never forget a stray console.log() | |
// ---------------------------------- | |
// | |
// This one is for you printf debuggers | |
// | |
// This spies on console.*() calls and reports the call sites | |
// ordered by file name then by position, all at once at the | |
// end of the report (while making the suite fail, this counts | |
// as a failed assertion). |
/* Ultra lightweight Github REST Client */ | |
// original inspiration via https://gist.github.com/v1vendi/75d5e5dad7a2d1ef3fcb48234e4528cb | |
const token = 'github-token-here' | |
const githubClient = generateAPI('https://api.github.com', { | |
headers: { | |
'User-Agent': 'xyz', | |
'Authorization': `bearer ${token}` | |
} | |
}) |
/* Using a JavaScript proxy for a super low code REST client */ | |
// via https://dev.to/dipsaus9/javascript-lets-create-aproxy-19hg | |
// also see https://towardsdatascience.com/why-to-use-javascript-proxy-5cdc69d943e3 | |
// also see https://github.com/fastify/manifetch | |
// also see https://github.com/flash-oss/allserver | |
// and https://gist.github.com/v1vendi/75d5e5dad7a2d1ef3fcb48234e4528cb | |
const createApi = (url) => { | |
return new Proxy({}, { | |
get(target, key) { |
#!/bin/bash | |
# This script will download the contents of a GitHub repo | |
# and place them in a local directory. | |
# | |
# Usage: | |
# download-repo.sh <repo> <output-path> <nested-path> <branch-name> | |
# | |
# Example: | |
# download-repo.sh wattenberger/kumiko ./kumiko-assets master public/assets |
<link rel="shortcut icon" width=32px> | |
<canvas style="display: none" id="loader" width="16" height="16"></canvas> | |
<script> | |
class Loader { | |
constructor(link, canvas) { | |
this.link = link; | |
this.canvas = canvas; | |
this.context = canvas.getContext('2d'); | |
this.context.lineWidth = 2; |
{-# LANGUAGE DeriveFunctor #-} | |
{-# LANGUAGE LambdaCase #-} | |
import Control.Applicative (liftA2) | |
import Data.Char | |
import Data.Foldable (for_) | |
import Data.Functor | |
import qualified Data.HashMap.Strict as M | |
import Data.List (intercalate) | |
import Prelude hiding (any) |
@module-federation/nextjs-mf
.yarn add @module-federation/nextjs-mf
package.json
: "resolutions": {
// setup all the utilities to be used | |
var delay = (ms,cancel = new AbortController()) => { | |
var pr = new Promise(res => { | |
var intv = setTimeout(res,ms); | |
cancel.signal.addEventListener("abort",() => { clearTimeout(intv); res(); }); | |
}); | |
pr.abort = () => cancel.abort(); | |
return pr; | |
}; |