Skip to content

[bug] Avoid redundant leaflet JS in netjsongraph.js bundle, reuse django-leaflet #709

@nemesifier

Description

@nemesifier

Depends on and relates to openwisp/netjsongraph.js#425.

It would be great to change the dashboard map so that we load the leaflet JS file shipped in django-leaflet and avoid bundling it with netjsongraph.js.

Current situation:

  • dashboard: loads netjsongraph.js which bundles echarts and leaflet (which is huge)
  • device/location detail pages: load leaflet from django-leaflet

Ideal situation:

  • dashboard: loads leaflet from django-leaflet, netjsongraph.js with echarts bundled
  • device/location detail pages: load leaflet from django-leaflet (same file as dashboard, leveraging browser cache)

Follow up:

We can then move netjsongraph.js+echarts to openwisp-utils (openwisp/openwisp-utils#517) and load it from there both here in openwisp-monitoring (#710) and in openwisp-network-topology (openwisp/openwisp-network-topology#272).

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingdependenciesPull requests that update a dependency file

    Type

    No type

    Projects

    Status

    Backlog

    Status

    To do (general)

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions