0.0.1 • Published 7 months ago

irsa-react-apps v0.0.1

Weekly downloads
-
License
-
Repository
-
Last release
7 months ago

Instructions for compiling Irsa React/ES6 based modules using gulp plus webpack

Install latest npm if you dont have it. For this google 'node installer', download and intsall it on your system. npm will be installed along with it. Minium version of npm must be 3.5.*

Next: *** If you want to compile JS modules via Visual Studio, then you must have a file with name "VSPostBuildCheck.txt" present on C Drive's root. Given file is present on the mentioned path, upon building IrsaHostWebAppMvc project via Visual Studio Build/Rebuild command, after successful compilation of Mvc project, it will start compiling JS/ES6/React modules. Can take a while (at least first time), so please wait for it to complete.

*** If you want to manually compile JS modules then do following:

  1. Open Command Prompt (cmd) (IN ADMINISTRATIVE MODE) and cd to \IrsaHostWebAppMvc\Scripts\irsa\modules folder.
  2. Run following commands: (Note character '>' here stands for Command Prompt's prompt symbol, so skip it while typing your commands.)

    npm install (Run this only one time. Only if you are doing it for the first time or if you have changed something in package.json file, like added some new dependency(s)) (**** VERY IMPORTANT: Always make sure to 'git ignore' node_modules folder. as it is not supposed to be committed to our IRSA Host Enterprise GIT repo)

    npm run gulp (See package.json "scripts" options) (Modules compilation command. All Irsa modules will start compiling upon execution of this command. This will by default produce development build files. Supply -p argument, if you want production build. See below.

    If you want to have compressed code (or production build), use following command:

    npm run gulp -- -p

    If you want to enable watch mode, add -w argument e.g:

     > npm run gulp -- -w      (Development build with watch)
     > npm run gulp -- -p -w   (Production build with watch)
         Note: After execution of above command, a 'Watch' is set on files and then 
    	   whenever you will modify any JS/SCSS file present under modules folder, it will automatically recompile.

    If you want a toast window to appear in case some compilation error occurs, add -m argument e.g:

     > npm run gulp -- -m   
     > npm run gulp -- -p -m

Output: After compilation, it will create/overwrite all CSS and js files present under IrsaHostWebAppMvc\Scripts\irsa\modules\build folder. Note: File 'irsa-modules.bundle.js' contains compiled and merged output from all script files present under commons/js folder. File 'unit-config.js' contains compiled and merged output from all script files present under others/unitConfiguration folder. File 'case.js' contains compiled and merged output from all script files present under others/case folder. All .scss files present under modules/css folder will be compiled to their corresponding and individual .css outputs into "build" folder.

NOTE: "build" folder has been removed from git repo. If it still shows while committing, please GIT ignore it. However all the files present under "build" folder must be added to MVC project, otherwise MSI/Team City wont include them in final build, resulting in errors.

NOTE: In our Notifications and UnitConfiguration modules, we have made use of React-Redux. Before looking at it, first do have a thorough understanding of Redux, in particular its TodoMvc and Async examples code. In short, Redux is a predictable state container for JavaScript apps.

http://redux.js.org/ http://redux.js.org/docs/basics/ExampleTodoList.html

/ "react": "0.14.7", "react-bootstrap": "^0.28.2", "react-dom": "0.14.7" /