Skip to content

Commit 82f5234

Browse files
committed
refactor: Move vgl locally
This reduces the published code volume by 9% for the unminified lean library. It also ensures that vgl is tested and not using out-of-date packages.
1 parent 404f1f2 commit 82f5234

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+4596
-71
lines changed

docs/developers.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,12 @@ so there is no need to rerun this command unless you add a new file.
5151

5252
There are a number of utilities present in the file ``tests/test-utils.js``
5353
that developers can use to make better unit tests. For example, a mocked
54-
vgl renderer can be used to hit code paths within webgl rendered layers. There
55-
are also methods for mocking global methods like ``requestAnimationFrame``
56-
to test complex, asynchronous code paths in a stable and repeatable manner.
57-
The `Sinon <https://sinonjs.org/>`_ testing library is also available to
58-
generate stubs, spies, and mocked methods. Because all tests share
59-
a global scope, they should be careful to clean up all mocking and
54+
webgl renderer can be used to hit code paths within webgl rendered layers.
55+
There are also methods for mocking global methods like
56+
``requestAnimationFrame`` to test complex, asynchronous code paths in a stable
57+
and repeatable manner. The `Sinon <https://sinonjs.org/>`_ testing library is
58+
also available to generate stubs, spies, and mocked methods. Because all tests
59+
share a global scope, they should be careful to clean up all mocking and
6060
instrumentation after running. Ideally, each test should be runnable
6161
independently and use jasmines ``beforeEach`` and ``afterEach`` methods
6262
for setup and tear down.

package-lock.json

Lines changed: 1 addition & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@
2323
"kdbush": "^4.0.0",
2424
"mousetrap": "^1.6.5",
2525
"polybooljs": "git+https://github.com/manubb/polybooljs#eps-logic",
26-
"proj4": "^2.7.5",
27-
"vgl": "0.3.11"
26+
"proj4": "^2.7.5"
2827
},
2928
"optionalDependencies": {
3029
"@egjs/hammerjs": "^2.0.8",

src/index.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,6 @@
88
/*
99
* Bundled with the following libraries:
1010
*
11-
* vgl
12-
* @copyright 2014-2016, Kitware, Inc.
13-
* @license Apache-2.0
14-
*
1511
* Proj4js
1612
* @copyright 2014, Mike Adair, Richard Greenwood, Didier Richard, Stephen Irons, Olivier Terral and Calvin Metcalf
1713
* @license MIT
@@ -99,7 +95,8 @@ module.exports = $.extend({
9995
svg: require('./svg'),
10096
vtkjs: require('./vtkjs'),
10197
webgl: require('./webgl'),
102-
gui: require('./ui')
98+
gui: require('./ui'),
99+
vgl: require('./vgl')
103100
}, require('./registry'));
104101

105102
if (window && !window.$) {

src/util/common.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ var util = {
328328
* is the correct size, return it. Otherwise, allocate a new buffer; any
329329
* data in an old buffer is discarded.
330330
*
331-
* @param {vgl.geometryData} geom The geometry to reference and modify.
331+
* @param {geo.vgl.geometryData} geom The geometry to reference and modify.
332332
* @param {string} srcName The name of the source.
333333
* @param {number} len The number of elements for the array.
334334
* @param {number} [allowLarger=0.2] If the existing buffer is larger than

src/util/mockVGL.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ module.exports = {};
1818
*/
1919
module.exports.mockWebglRenderer = function mockWebglRenderer(supported) {
2020
'use strict';
21-
var vgl = require('vgl');
21+
var vgl = require('../vgl');
2222

2323
if (supported === undefined) {
2424
supported = true;
@@ -189,7 +189,7 @@ module.exports.mockWebglRenderer = function mockWebglRenderer(supported) {
189189
* @alias geo.util.restoreWebglRenderer
190190
*/
191191
module.exports.restoreWebglRenderer = function () {
192-
var vgl = require('vgl');
192+
var vgl = require('../vgl');
193193

194194
if (vgl._mocked) {
195195
vgl.renderWindow = _renderWindow;

0 commit comments

Comments
 (0)