The motivation is simple - we want a solution that works for the whole
app, can handle debug vs. release execution, pluggable modules, and
installations in read-only directories.
With the current configuration of Grunt, all the requirements you mention are available.
The tasks on Grunt should only be run under development or before we are creating the installer.
The installer should pick up only the bundled Javascript and should install it in the correct folders, this way there is no need to rewrite or process files in read-only directories of the end user machine.
Per the other thread on the subject (that Joao suggested continuing
discussion on), Surinder is currently looking into flask-webpack. I
spent some time playing with grunt and some other options last week.
We should continue the discussion about flask-webpack or Grunt or any other Build system in the other thread, but we need to have some decision because this patch needs a build system.
If we remove Grunt from this patch we will need to execute the following command every time the application run:
yarn run eslint pgadmin/static/jsx/**/*.jsx pgadmin/static/js/selection/*.js regression/javascript/**/*.jsx regression/javascript/**/*.js *.js && yarn run webpack -- --config webpack.config.js && python web/pgAdmin4
And to run the jasmine tests:
yarn run eslint pgadmin/static/jsx/**/*.jsx pgadmin/static/js/selection/*.js regression/javascript/**/*.jsx regression/javascript/**/*.js *.js && yarn run karma start
And to run the feature tests:
yarn run eslint pgadmin/static/jsx/**/*.jsx pgadmin/static/js/selection/*.js regression/javascript/**/*.jsx regression/javascript/**/*.js *.js && yarn run webpack -- --config webpack.config.js && python runtests.py
Is this a solution that is acceptable?
However; this patch is supposed to be about the history tab rewrite.
Whatever solution we use for webpacking/transpiling/linting/minifying
etc, it should be a standalone change as it's decidedly non-trivial.
We split this patch into 2 different commits:
1 - Add React and all the tools needed to work with it, this includes Grunt, Webpack and ESLint
2 - Change the history tab
Do you want a single commit for each of the following?
React (just adds the React library via yarn)
Webpack (adds Webpack library via yarn and creates the webpack.config.js)
ESLint (adds ESLint library via yarn, creates .eslintrc config file, and corrects all lint errors that previously existed)
Grunt (adds Grunt library via yarn and creates Gruntfile.js config, creating a pipeline of the previous three libraries/tasks)
Our change to History
Thanks
Joao & Matt