Skip to content

Instantly share code, notes, and snippets.

View snewell92's full-sized avatar
๐Ÿ•
I yearn for pizza

Sean Newell snewell92

๐Ÿ•
I yearn for pizza
View GitHub Profile
@ScriptedAlchemy
ScriptedAlchemy / hoisted-runtime-blog.md
Last active August 12, 2025 08:45
Rspack Module Federation Hoisted Runtime Documentation

Module Federation now uses Rspack's runtime capabilities instead of patching user entry points, making federation available before entry point evaluation.

Previously, Module Federation was injected into user entry points as the first imported item. This approach caused several issues: federation runtime was duplicated across entry points when using a single runtime chunk, remote modules weren't available at startup unless entry points were loaded on the page, and programmatically created entry points like web workers weren't properly handled.

The new implementation adds a runtime module that initializes federation during Rspack's runtime phase, similar to webpack's v1 Module Federation. Federation runtime is hoisted into runtime chunks regardless of code splitting rules, ensuring it's eagerly available for startup.

This approach:

  • Eliminates "should have __webpack_require__.f.consumes" errors and sharing initialization failures
  • Prevents federation runtime duplication across entry points (~70kb savings
@barnybug
barnybug / docker-compose.yml
Created November 21, 2017 11:14
Docker compose for a Docker-in-docker gitlab runners setup
# Docker-in-Docker Gitlab runners setup taken from:
# https://medium.com/@tonywooster/docker-in-docker-in-gitlab-runners-220caeb708ca
dind:
restart: always
privileged: true
volumes:
- /var/lib/docker
image: docker:17.09.0-ce-dind
command:
- --storage-driver=overlay2