Quantcast
Channel: GoJS - Northwoods Software
Viewing all articles
Browse latest Browse all 7069

Reducing bundle size with GoJS 2.0

$
0
0

@estesbubba wrote:

Thanks for adding GoJS 2.0.0-beta5 to NPM and I now have it in our ReactJS app. With the rewrite of GoJS 2.0 does it support webpack tree shaking and do you have any examples of how to reduce bundle size? With GoJS 1.8 we did this:

import go from 'gojs';

With 2.0 I’m in the process of doing this:

import {
  CommandHandler,
  Diagram as GoJsDiagram,
  Geometry,
  GraphLinksModel,
  GraphObject,
  Link,
  List,
  Node,
  PathFigure,
  PathSegment,
  Point,
  Shape,
  Size,
  Spot,
  ToolManager
} from 'gojs';

I’m hoping doing the above will reduce our go.js footprint down from 1.26MB. The one thing is there a function or class I can import that will handle this?

go.licenseKey = process.env.REACT_APP_GO_LICENSE;

Currently I’m importing the entire go object to handle this.

Posts: 3

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 7069

Trending Articles