Re: [pgAdmin4]: Webpacking of static JS/CSS

From: Surinder Kumar <surinder(dot)kumar(at)enterprisedb(dot)com>
To: Ashesh Vashi <ashesh(dot)vashi(at)enterprisedb(dot)com>
Cc: Dave Page <dpage(at)pgadmin(dot)org>, pgadmin-hackers <pgadmin-hackers(at)postgresql(dot)org>
Subject: Re: [pgAdmin4]: Webpacking of static JS/CSS
Date: 2017-07-27 06:39:48
Message-ID: CAM5-9D894o0jSM=3yOVsTxHsQ96PDZdVeQAmZa9bi5h2M7Y0yg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-hackers

Hi Ashesh,

Changes in patch:

1. I have removed duplicate function 'module_use_template_javascript' from
modules.
2. This patches only contains changes for moving template/js to static/js.
I have excluded changes for making module paths dynamic as we will be using
different approach to handle that.
3. Also, changed path references for JS modules to point to static/ dir
instead of template/js in webpack.shim.js and webpack.config.js .

Please find attached patches

Thanks,
Surinder

On Thu, Jul 27, 2017 at 10:33 AM, Surinder Kumar <
surinder(dot)kumar(at)enterprisedb(dot)com> wrote:

> Ok. I will send rebased patch.
>
> On Thu, Jul 27, 2017 at 10:32 AM, Ashesh Vashi <
> ashesh(dot)vashi(at)enterprisedb(dot)com> wrote:
>
>>
>>
>> On Thu, Jul 27, 2017 at 10:22 AM, Ashesh Vashi <
>> ashesh(dot)vashi(at)enterprisedb(dot)com> wrote:
>>
>>> Hi Surinder,
>>>
>>> 'delete_template_files.patch' is applied any more.
>>> Please send the rebased patches.
>>>
>>> I have also noticed in the 'move_js_files_to_static_directory.patch',
>>> couple of modules have two definitions for 'module_use_template_javascript'
>>> method.
>>>
>> Also - 'module_paths.json' is auto generated, please don't include that
>> in the patch.
>>
>> -- Thanks, Ashesh
>>
>>>
>>>
>>> --
>>>
>>> Thanks & Regards,
>>>
>>> Ashesh Vashi
>>> EnterpriseDB INDIA: Enterprise PostgreSQL Company
>>> <http://www.enterprisedb.com>
>>>
>>>
>>> *http://www.linkedin.com/in/asheshvashi*
>>> <http://www.linkedin.com/in/asheshvashi>
>>>
>>> On Tue, Jul 25, 2017 at 3:56 PM, Surinder Kumar <
>>> surinder(dot)kumar(at)enterprisedb(dot)com> wrote:
>>>
>>>> Hi,
>>>>
>>>> Please find rebased patches and review.
>>>>
>>>> On Sat, Jul 22, 2017 at 1:03 AM, Surinder Kumar <
>>>> surinder(dot)kumar(at)enterprisedb(dot)com> wrote:
>>>>
>>>>> Hi,
>>>>>
>>>>> Following are the changes in patches attached:
>>>>>
>>>>> 1) Move Javascripts from Templates directory to Static for following
>>>>> modules:
>>>>> - About
>>>>> - Browser nodes
>>>>> - Dashboard
>>>>> - FileManager
>>>>> - Vendor/snap.svg
>>>>> - Preferences
>>>>> - Settings
>>>>> - Backup
>>>>> - Datagrid
>>>>> - Debugger
>>>>> - Sqleditor
>>>>> - Grant Wizard
>>>>> - Import & Export
>>>>> - Maintenance
>>>>> - Restore and
>>>>> - User Management
>>>>>
>>>>> 2) Generate module JS path references dynamically/ Remove manually
>>>>> written paths.
>>>>> Added a new file 'module_paths.json' which will update with absolute
>>>>> paths to module JS defined in every modules > __init__.py > 'def
>>>>> get_own_javascripts'.
>>>>>
>>>>> When Flask service is started, it accesses the all module javascripts
>>>>> using `current_app.javascripts` which is called inside an route.
>>>>> This call to route is made using Flask's `test_client` and thus those
>>>>> paths are written to `module_paths.json`(in javascript_bundler.py) which is
>>>>> used by webpack.shim.js file.
>>>>>
>>>>> Three patches:
>>>>> 1. Move JS files to static directory
>>>>> 2. Deleted template JS
>>>>> 3. Generate JS paths before app starts
>>>>>
>>>>> These patches needs to be committed separately as deleted files
>>>>> includes in the commit that makes difficult to look for changes through
>>>>> `git log <commit-has>`
>>>>>
>>>>> Please review.
>>>>>
>>>>> Thanks,
>>>>> Surinder
>>>>>
>>>>>
>>>>>
>>>>> On Thu, Jul 20, 2017 at 6:08 PM, Dave Page <dpage(at)pgadmin(dot)org> wrote:
>>>>>
>>>>>> Thanks, applied.
>>>>>>
>>>>>> On Thu, Jul 20, 2017 at 1:35 PM, Surinder Kumar <
>>>>>> surinder(dot)kumar(at)enterprisedb(dot)com> wrote:
>>>>>>
>>>>>>> Hi Dave,
>>>>>>>
>>>>>>> Can you please review this patch please? I guess it was missed as i
>>>>>>> send 2 patches back to back in same email chain.
>>>>>>> Please find inline detailed description of issue.
>>>>>>>
>>>>>>> On Thu, Jul 20, 2017 at 12:37 PM, Surinder Kumar <
>>>>>>> surinder(dot)kumar(at)enterprisedb(dot)com> wrote:
>>>>>>>
>>>>>>>> Hi
>>>>>>>>
>>>>>>>> The loading icon image is used in FileManager and it is still
>>>>>>>> referenced from vendor `aciTree`(which is removed) so it gives 404 not
>>>>>>>> found when FileManager is opened from Query tool/Backup utility.
>>>>>>>>
>>>>>>>> Please find attached patch and review.
>>>>>>>>
>>>>>>>> Thanks,
>>>>>>>> Surinder Kumar
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> Dave Page
>>>>>> Blog: http://pgsnake.blogspot.com
>>>>>> Twitter: @pgsnake
>>>>>>
>>>>>> EnterpriseDB UK: http://www.enterprisedb.com
>>>>>> The Enterprise PostgreSQL Company
>>>>>>
>>>>>
>>>>>
>>>>
>>>
>>
>

Attachment Content-Type Size
deleted_template_files_v1.patch application/octet-stream 1011.4 KB
move_js_files_to_static_directory_v1.patch application/octet-stream 1.1 MB
webpack_config_file_changes.patch application/octet-stream 27.6 KB

In response to

Responses

Browse pgadmin-hackers by date

  From Date Subject
Next Message Surinder Kumar 2017-07-27 07:27:32 Re: [pgAdmin4]: Webpacking of static JS/CSS
Previous Message Khushboo Vashi 2017-07-27 05:20:27 [pgAdmin4][Patch]: Dashboard requests don't stop even after closing the panel