Building GoJS from TypeScript Sources

All customers can use the go.js and go-debug.js files or the corresponding ES module files to run their app. However, if you have purchased a license to the GoJS TypeScript source code, you can build your app from the TypeScript source. Popular module bundlers such as Webpack are able to remove a number of modules from the source, provided you are not using them, to shrink the size of the deliverable file.

Because the go.js and go-debug.js files are built in a custom process to reduce size, using Webpack or another bundler with the GoJS source, even though it removes unused modules, may result in a larger file size than just using go.js. However, programmers using TypeScript may appreciate the feedback and debugging capabilities of building from source.

Classes/modules that can be removed when building from source

Several classes, such as CommandHandler and the Tools, may be essential to add to your project, while others such as all or all but one Layout and one type of Model can often be removed. Below is a list of modules that webpack can remove from builds, provided they are not referenced in your code:

Layouts: Mouse-down tools: Mouse-move tools: Mouse-up tools:

There are several "built in" Panel types, each of which is a PanelLayout. Some of these are required for building the source:

However, it is possible to build without the following panel types:

The source index files demonstrate the necessary calls to Panel.addPanelLayout to include each panel type.

Using the optional classes

A typical GoJS project is not expected to remove all or even most of these modules, and may use the majority of them.

Important license information about GoJS source code

The GoJS source code is subject to the terms of our license, contained in SoftwareLicenseAgreement.pdf.

Do not use, release (deploy), or distribute the unminified source code. To build GoJS for your own application you must use a popular obfuscation/minification tool.