Re: [pgAdmin4][Patch]: RM_2596 - Query tool not working in DesktopRuntime on Mac OS X - Mailing list pgadmin-hackers

From Surinder Kumar
Subject Re: [pgAdmin4][Patch]: RM_2596 - Query tool not working in DesktopRuntime on Mac OS X
Date
Msg-id CAM5-9D81PzA5LQMMpRJsL4Nsc3+hq3-pcbBegLtLgP8+LttYQg@mail.gmail.com
Whole thread Raw
In response to Re: [pgAdmin4][Patch]: RM_2596 - Query tool not working in DesktopRuntime on Mac OS X  (Ashesh Vashi <ashesh.vashi@enterprisedb.com>)
Responses Re: [pgAdmin4][Patch]: RM_2596 - Query tool not working in DesktopRuntime on Mac OS X  (Surinder Kumar <surinder.kumar@enterprisedb.com>)
List pgadmin-hackers
Hi Ashesh,

1. Now we are using `envType` variable in definePlugin which sets environment variable NODE_ENV globally which is used by React to create development or production build.
where:
     envType - determine build type is either `production` or `development`​ depending on the environment set in package.json > scripts.

2. In `UglifyJSPlugin`, i am setting compress > `warnings to false`, because here warning flag is meant to display warnings on terminal while creating build in production mode. so it is set to false.

I didn't created an RM for #2 as it is minor change, if needed, i will create.


Please find updated patch with fixed review comments and review.

Thanks,
Surinder

On Mon, Jul 31, 2017 at 3:31 PM, Ashesh Vashi <ashesh.vashi@enterprisedb.com> wrote:
On Fri, Jul 28, 2017 at 12:42 PM, Surinder Kumar <surinder.kumar@enterprisedb.com> wrote:
Hi,

I inspect the react code and in call stacks, found `process.env.NODE_ENV` is undefined due to which 'SyntheticEvent.call' is not callable.

So, to fix this, i add 'definePlugin' to plugins for `dev` environment in `webpack.config.js`. Initially it was added only for `production` environment. but it is needed for both, because React code is conditional based on environment variables set. 

Please find attached patch and review.
As discussed, you're setting 'production', even in the 'development' mode.

Please understand the code, and share the updated patch.
Also - share the references next time, so that - committer can understand the reason for these changes.

-- Thanks, Ashesh

Thanks,
Surinder


Attachment

pgadmin-hackers by date:

Previous
From: Shirley Wang
Date:
Subject: Re: Re-open Dashboard
Next
From: Surinder Kumar
Date:
Subject: [Patch][pgAdmin4]: RM_2617 - pgAgent module is not loading after webpacking