How do you manage multiple ReactJS projects?

Reference Information. My web application of my company is actually a few completely separate applications that have minimal impact on each other. Therefore, it makes no sense to keep them under one project, so I use separate projects. However, since I started porting and writing new applications in ReactJS (using Webpack for bundling), I find many ways to reuse them to avoid code duplication and not load shared resources again after another application has already brought them out:

  • I use certain versions of third-party npm modules - so there is no reason to link them again and again - and there is no reason to upload them to the server more than once (for all projects).
    • How do you share fixed versions of package.json in different projects?
    • Do you put all / groups of npm modules together or each separately? I want to get everything from the server for local deployment cases.
    • What measures will you take to ensure that you will not forget to re-merge the node modules if you decide to upgrade one of them?
  • A similar question concerns font files (saving the font on the server and another font for the icons)
  • common style sheets
  • generic js code - both utils and generic
  • general web.config settings
  • shared images (some of them are currently built into different packages)
  • and last - common components - how do you separate them? Do you use a separate project and publish to npm? symbolic?

Or maybe, in the end, should I go with monorepo? And How?

+4
1

my_modules, . package.json index.js, - :

import React, { Component, PropTypes } from 'react';
import moment from 'moment';

export { React, Component, PropTypes, moment };

my_modules github .

import { React, Component, PropTypes } from 'my-modules';

, , , ( - , - greenkeeper.io, , ).

, , ; , , , , .

EDIT: , React , . - React Storybook . , - (, Form ). , .

+2

All Articles