lundegaard / react-union

⚛️ Collection of tools allowing to React.js applications to run on specific server-side environments such as Content Management Systems (CMS) or Portals.
http://react-union.org/
MIT License
94 stars 13 forks source link

Refactor react-union-scripts structure #110

Open wafflepie opened 6 years ago

wafflepie commented 6 years ago

There are a couple of points that I'd like to address:

  1. Rename the lib folder to something like utils.
  2. Move the unionConfig handling code from utils to a separate package (or at least a separate folder or file).
  3. Move webpack.config.js along with the parts to a separate package or a separate folder (or even a file, that would be sufficient).
  4. I don't understand the point of having a separate startDevServer.js file, just merge it with the start.js file.
  5. The scripts directory is a mess of multiple types of files. I'd like it to be a directory with the possible entry points for react-union-scripts and nothing else (test, build, start, that's it).
  6. In my react-union-ssr-server package, I would like to use a couple of useful functions from react-union-scripts (namely the CLI getArgValue function), it makes me think whether we should have a react-union-utils or a react-union-cli package – more small packages will lead to looser coupling and more maintainable code.

The code itself is pretty good, but the directory structure needs a major revamp.

tommmyy commented 6 years ago

I will look into that. Not everything is priority. We have plans with union-scripts which makes this possible refactor just temporary. But thank you for comments.

wafflepie commented 6 years ago

Okay, I'll try to stay away from doing any major refactoring in the ssr branch and will only leave comments as to what should be improved so that we don't forget about it.