Skip to content

Instantly share code, notes, and snippets.

@alibek-gao
alibek-gao / boilerplate.md
Created August 23, 2022 15:56
boilerplate
  • yarn create vite
  • npm init @eslint/config
  • npx install-peerdeps --dev eslint-config-airbnb

.eslintrc.cjs

module.exports = {
  env: {
    browser: true,
    es2021: true
@alibek-gao
alibek-gao / [...slug].js
Last active April 24, 2023 15:56
attempt to implement dynamic remote with dynamic routes
import { useMemo } from 'react'
import { injectScript } from '@module-federation/utilities'
import dynamic from 'next/dynamic'
// TODO: replace with a LRU cache or something similar
const remotePagesMap = new Map();
function DynamicComponent({ remote, path, props }) {
const Component = useMemo(() => {
if (typeof window === 'undefined') {