Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@module-federation/fmr

Package Overview
Dependencies
Maintainers
3
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@module-federation/fmr

  • 0.0.3
  • npm
  • Socket score

Version published
Weekly downloads
12K
increased by29.12%
Maintainers
3
Weekly downloads
 
Created
Source

MF Dev Server

About

This is the "brain" of the live reload feature.

It gets updates from webpack, and sends them to the chrome extension / client.

In the future, it will also include functionality that allows clients to subscribe and unsubscribe from each other.

MF Dev Server

Up and running

Starting the node server

> yarn
// comment out the "start" function in index.js
> node ./index.js

This will start the node server on port: 40001

Hosting the index.html

In a seperate process / terminal window

This HTML file will open up a socket connection to the node sever on port 40001

Keeping all socket messages consistent:

MF Dev Server messages adhere to a common API. This API is:

{
    time: Date.now(),
    sender: 'string', // this is the UUID of the client
    data: 'any', 
    type: 'string' // this is equivelant to an action type in redux terms
}

Passing around ctx

In MF Dev Sever, ctx is the main argument passed to each funciton because it has almost everything you may need. From the top, ctx consists of:

  1. wss: web socket server, a ref to the wss itself
  2. socket: this is the socket that is handling the connection
  3. req: this is the TCP request
  4. id: this is the UUID of the request
  5. message: this is the message (see above)

FAQs

Package last updated on 07 Aug 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc