Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What the difference of module.system=haste and module.system=node in Facebook's flow

Tags:

flowtype

I work on a project which is using Facebook's flow. In the Advanced Configuration of flow and there are two choices for the [options] heading (module.system=haste and module.system=node).

Now I would like to know what is the difference of "haste" and "node".

like image 514
knarz Avatar asked May 06 '15 13:05

knarz


People also ask

What is a haste module?

Haste Module is a module that is used in the Environmental Controller. This module adds Haste I effect. With this module installed, Environmental Controller will consume 0.001 RF/tick per 1 cubic block covered.

What is haste module map?

This post in SO tells us Haste is an alternative to Node. Then, I may conclude that a Haste Map is a map of all static dependency references of a node project AND as a deprecated system must be avoided in favor of Node module system.


1 Answers

They are 2 different ways of resolving modules: haste is the module system used by react-native for packaging (similar to browserify or webpack for browsers):

https://github.com/facebook/node-haste

The node module system is the method used by node internally.

As for how they actually differ: unfortunately haste does not have extensive documentation yet. AFAICT the primary difference is that haste can resolve packages references (e.g. require('underscore')) to a single module, whereas node will actually use a different module for each sub-package. Basically: with node you can end up with multiple versions of say, underscore in a single program, whereas with haste only one version of underscore is put into the final package.

This can result in subtle differences if there are multiple versions of a module in a project, though apparently haste is becoming more compatible with existing node behavior.

like image 105
rjpower Avatar answered Dec 31 '22 17:12

rjpower