Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Start moving third party libraries to use npm #9706

Merged
merged 41 commits into from
Aug 23, 2021
Merged
Show file tree
Hide file tree
Changes from 30 commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
4a4c564
remove sprintf and use padStart
ebogo1 Apr 8, 2021
267b98e
Merge pull request #9476 from CesiumGS/remove-sprintf
mramato Apr 11, 2021
f594b3c
Start of replacing submitted third party libraries with npm modules
mramato Apr 11, 2021
52f690c
Merge pull request #9466 from CesiumGS/npm-third-party
ebogo1 Apr 12, 2021
73e00e1
Merge remote-tracking branch 'origin/master' into npm-third-party-sta…
ebogo1 Jul 15, 2021
8391bfe
fix when imports
ebogo1 Jul 15, 2021
a0d67f8
fix multiple holes test in PolygonPipelineSpec
ebogo1 Jul 18, 2021
e122859
add npm packages pt 1
ebogo1 Jul 20, 2021
709f206
add back zip.js
ebogo1 Jul 20, 2021
4012e2e
ktx-parse to npm
ebogo1 Jul 23, 2021
8165fd9
add ThirdParty/npm/ktx-parse.js
ebogo1 Jul 23, 2021
f8c9a23
Merge pull request #9688 from CesiumGS/npm-second-pass
lilleyse Jul 26, 2021
65f5924
zip.js in exportKml
ebogo1 Jul 26, 2021
2dd0ca7
Merge branch 'npm-second-pass' into npm-zip-js
ebogo1 Jul 26, 2021
aa276f3
fix exportKml and update KmlDataSource
ebogo1 Jul 28, 2021
7b40a60
remove inflate and deflate workers
ebogo1 Jul 28, 2021
038f732
Merge pull request #9696 from CesiumGS/npm-zip-js
lilleyse Jul 28, 2021
86de8af
move GltfPipeline to Source/Scene and add it to .eslintignore
ebogo1 Jul 29, 2021
c0be363
Mark functions as @private
lilleyse Jul 30, 2021
661f9ba
mark GltfPipeline in .prettierignore
ebogo1 Jul 30, 2021
2f8be0c
first pass
ebogo1 Jul 30, 2021
3764981
revert prettier changes
ebogo1 Jul 30, 2021
c8f576b
Merge pull request #9699 from CesiumGS/move-gltf-pipeline
lilleyse Jul 30, 2021
be34f56
move google-earth-dbroot-parser back to ThirdParty
ebogo1 Jul 30, 2021
63d5860
Fix gulpfile
ebogo1 Jul 30, 2021
824b774
update prettier and eslint ignore files
ebogo1 Jul 30, 2021
4ec47be
update CHANGES.md
ebogo1 Jul 30, 2021
d382be0
Merge branch 'npm-third-party-staging' of github.com:CesiumGS/cesium …
ebogo1 Jul 30, 2021
110af2a
Merge pull request #9704 from CesiumGS/move-into-source
lilleyse Jul 30, 2021
c8592cb
first pass
ebogo1 Jul 31, 2021
f73cbd4
ignore new ThirdParty files from source
ebogo1 Jul 31, 2021
690edff
fix gulpfile again
ebogo1 Jul 31, 2021
74b874a
Merge remote-tracking branch 'origin/main' into npm-third-party-staging
ebogo1 Aug 1, 2021
138566d
Merge remote-tracking branch 'origin/npm-third-party-staging' into sa…
ebogo1 Aug 1, 2021
f1da729
Merge pull request #9705 from CesiumGS/save-in-ThirdParty
lilleyse Aug 1, 2021
dc2e925
Update gltf-pipeline files, now using prettier
lilleyse Aug 3, 2021
2ccf0fd
Merge branch 'main' into npm-third-party-staging
lilleyse Aug 3, 2021
c17e60b
Update CHANGES.md
lilleyse Aug 3, 2021
b962003
reduce import sizes for pako and zip
ebogo1 Aug 4, 2021
fa50855
Merge branch 'main' into npm-third-party-staging
ebogo1 Aug 16, 2021
0346a5d
Merge branch 'main' into npm-third-party-staging
ebogo1 Aug 20, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ Apps/HelloWorld.html
Apps/Sandcastle/ThirdParty/**
Build/**
Documentation/**
Source/Scene/GltfPipeline/**
Source/Shaders/**
Source/ThirdParty/**
Source/ThirdPartyNpm/**
Source/Workers/**
!Source/Workers/transferTypedArrayTest.js
ThirdParty/**
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Thumbs.db
/Specs/SpecList.js
/Source/Shaders/**/*.js
/Source/ThirdParty/Shaders/**/*.js
/Source/ThirdPartyNpm/**
/Source/Workers/**
!/Source/Workers/cesiumWorkerBootstrapper.js
!/Source/Workers/transferTypedArrayTest.js
Expand Down
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,10 @@
# Re-ignore a few things caught above
**/*.min.js
Source/Cesium.js
Source/Scene/GltfPipeline/**
Source/Shaders/**/*.js
Source/ThirdParty/**
Source/ThirdPartyNpm/**
Source/Workers/**/*
Apps/Sandcastle/ThirdParty

Expand Down
5 changes: 5 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

- Added `ImageryLayerCollection.pickImageryLayers` which determines the imagery layers that are intersected by a pick ray. [#9651](https://github.com/CesiumGS/cesium/pull/9651)
- Added a `polylinePositions` getter to `Cesium3DTileFeature` that gets the decoded positions of a polyline vector feature. [#9684](https://github.com/CesiumGS/cesium/pull/9684)
- Started moving over third party libraries to use npm modules.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this the right place to mention the change? I think there should be a note of this somewhere in CHANGES.md.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has zero user facing implications at this time, while we are moving to npm, there are still build time dependencies, not runtime dependencies (i.e. users who use Cesium don't actually have a direct dependencies on these libraries via npm)

##### Fixes :wrench:

Expand All @@ -19,6 +20,10 @@
- Fixed a crash that would hang the browser if a `Label` was created with a soft hyphen in its text. [#9682](https://github.com/CesiumGS/cesium/pull/9682)
- Fixed the incorrect calculation of `distanceSquaredTo` in `BoundingSphere`. [#9686](https://github.com/CesiumGS/cesium/pull/9686)

##### Deprecated :hourglass_flowing_sand:

- Support for Internet Explorer has been dropped.

### 1.83 - 2021-07-01

##### Breaking Changes :mega:
Expand Down
2 changes: 1 addition & 1 deletion Source/Core/ArcGISTiledElevationTerrainProvider.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import when from "../ThirdParty/when.js";
import when from "../ThirdPartyNpm/when.js";
import Cartesian2 from "./Cartesian2.js";
import Credit from "./Credit.js";
import defaultValue from "./defaultValue.js";
Expand Down
2 changes: 1 addition & 1 deletion Source/Core/CartographicGeocoderService.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import when from "../ThirdParty/when.js";
import when from "../ThirdPartyNpm/when.js";
import Cartesian3 from "./Cartesian3.js";
import Check from "./Check.js";

Expand Down
2 changes: 1 addition & 1 deletion Source/Core/CesiumTerrainProvider.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import when from "../ThirdParty/when.js";
import when from "../ThirdPartyNpm/when.js";
import AttributeCompression from "./AttributeCompression.js";
import BoundingSphere from "./BoundingSphere.js";
import Cartesian3 from "./Cartesian3.js";
Expand Down
2 changes: 1 addition & 1 deletion Source/Core/Credit.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import DOMPurify from "../ThirdParty/purify.js";
import DOMPurify from "../ThirdPartyNpm/dompurify.js";
import Check from "./Check.js";
import defaultValue from "./defaultValue.js";
import defined from "./defined.js";
Expand Down
2 changes: 1 addition & 1 deletion Source/Core/CustomHeightmapTerrainProvider.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import when from "../ThirdParty/when.js";
import when from "../ThirdPartyNpm/when.js";
import Check from "./Check.js";
import Credit from "./Credit.js";
import defaultValue from "./defaultValue.js";
Expand Down
2 changes: 1 addition & 1 deletion Source/Core/EarthOrientationParameters.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import when from "../ThirdParty/when.js";
import when from "../ThirdPartyNpm/when.js";
import binarySearch from "./binarySearch.js";
import defaultValue from "./defaultValue.js";
import defined from "./defined.js";
Expand Down
2 changes: 1 addition & 1 deletion Source/Core/EasingFunction.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Tween from "../ThirdParty/Tween.js";
import Tween from "../ThirdPartyNpm/Tween.js";

/**
* Easing functions for use with TweenCollection. These function are from
Expand Down
2 changes: 1 addition & 1 deletion Source/Core/EllipsoidTerrainProvider.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import when from "../ThirdParty/when.js";
import when from "../ThirdPartyNpm/when.js";
import defaultValue from "./defaultValue.js";
import defined from "./defined.js";
import Ellipsoid from "./Ellipsoid.js";
Expand Down
2 changes: 1 addition & 1 deletion Source/Core/FeatureDetection.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import when from "../ThirdParty/when.js";
import when from "../ThirdPartyNpm/when.js";
import defaultValue from "./defaultValue.js";
import defined from "./defined.js";
import DeveloperError from "./DeveloperError.js";
Expand Down
2 changes: 1 addition & 1 deletion Source/Core/GoogleEarthEnterpriseMetadata.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import protobufMinimal from "../ThirdParty/protobuf-minimal.js";
import when from "../ThirdParty/when.js";
import when from "../ThirdPartyNpm/when.js";
import buildModuleUrl from "./buildModuleUrl.js";
import Check from "./Check.js";
import Credit from "./Credit.js";
Expand Down
2 changes: 1 addition & 1 deletion Source/Core/GoogleEarthEnterpriseTerrainProvider.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import when from "../ThirdParty/when.js";
import when from "../ThirdPartyNpm/when.js";
import Credit from "./Credit.js";
import defaultValue from "./defaultValue.js";
import defined from "./defined.js";
Expand Down
2 changes: 1 addition & 1 deletion Source/Core/HeightmapTerrainData.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import when from "../ThirdParty/when.js";
import when from "../ThirdPartyNpm/when.js";
import BoundingSphere from "./BoundingSphere.js";
import Cartesian3 from "./Cartesian3.js";
import Check from "./Check.js";
Expand Down
2 changes: 1 addition & 1 deletion Source/Core/Iau2006XysData.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import when from "../ThirdParty/when.js";
import when from "../ThirdPartyNpm/when.js";
import buildModuleUrl from "./buildModuleUrl.js";
import defaultValue from "./defaultValue.js";
import defined from "./defined.js";
Expand Down
2 changes: 1 addition & 1 deletion Source/Core/IonResource.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Uri from "../ThirdParty/Uri.js";
import when from "../ThirdParty/when.js";
import when from "../ThirdPartyNpm/when.js";
import Check from "./Check.js";
import Credit from "./Credit.js";
import defaultValue from "./defaultValue.js";
Expand Down
70 changes: 43 additions & 27 deletions Source/Core/JulianDate.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import sprintf from "../ThirdParty/sprintf.js";
import binarySearch from "./binarySearch.js";
import defaultValue from "./defaultValue.js";
import defined from "./defined.js";
Expand Down Expand Up @@ -787,28 +786,39 @@ JulianDate.toIso8601 = function (julianDate, precision) {
if (!defined(precision) && millisecond !== 0) {
//Forces milliseconds into a number with at least 3 digits to whatever the default toString() precision is.
millisecondStr = (millisecond * 0.01).toString().replace(".", "");
return sprintf(
"%04d-%02d-%02dT%02d:%02d:%02d.%sZ",
year,
month,
day,
hour,
minute,
second,
millisecondStr
return (
year.toString().padStart(4, "0") +
"-" +
month.toString().padStart(2, "0") +
"-" +
day.toString().padStart(2, "0") +
"T" +
hour.toString().padStart(2, "0") +
":" +
minute.toString().padStart(2, "0") +
":" +
second.toString().padStart(2, "0") +
"." +
millisecondStr +
"Z"
);
}

//Precision is either 0 or milliseconds is 0 with undefined precision, in either case, leave off milliseconds entirely
if (!defined(precision) || precision === 0) {
return sprintf(
"%04d-%02d-%02dT%02d:%02d:%02dZ",
year,
month,
day,
hour,
minute,
second
return (
year.toString().padStart(4, "0") +
"-" +
month.toString().padStart(2, "0") +
"-" +
day.toString().padStart(2, "0") +
"T" +
hour.toString().padStart(2, "0") +
":" +
minute.toString().padStart(2, "0") +
":" +
second.toString().padStart(2, "0") +
"Z"
);
}

Expand All @@ -817,15 +827,21 @@ JulianDate.toIso8601 = function (julianDate, precision) {
.toFixed(precision)
.replace(".", "")
.slice(0, precision);
return sprintf(
"%04d-%02d-%02dT%02d:%02d:%02d.%sZ",
year,
month,
day,
hour,
minute,
second,
millisecondStr
return (
year.toString().padStart(4, "0") +
"-" +
month.toString().padStart(2, "0") +
"-" +
day.toString().padStart(2, "0") +
"T" +
hour.toString().padStart(2, "0") +
":" +
minute.toString().padStart(2, "0") +
":" +
second.toString().padStart(2, "0") +
"." +
millisecondStr +
"Z"
);
};

Expand Down
2 changes: 1 addition & 1 deletion Source/Core/Math.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import MersenneTwister from "../ThirdParty/mersenne-twister.js";
import MersenneTwister from "../ThirdPartyNpm/mersenne-twister.js";
import Check from "./Check.js";
import defaultValue from "./defaultValue.js";
import defined from "./defined.js";
Expand Down
2 changes: 1 addition & 1 deletion Source/Core/PolygonPipeline.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import earcut from "../ThirdParty/earcut-2.2.1.js";
import earcut from "../ThirdPartyNpm/earcut.js";
import Cartesian2 from "./Cartesian2.js";
import Cartesian3 from "./Cartesian3.js";
import Cartographic from "./Cartographic.js";
Expand Down
2 changes: 1 addition & 1 deletion Source/Core/QuantizedMeshTerrainData.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import when from "../ThirdParty/when.js";
import when from "../ThirdPartyNpm/when.js";
import BoundingSphere from "./BoundingSphere.js";
import Cartesian2 from "./Cartesian2.js";
import Cartesian3 from "./Cartesian3.js";
Expand Down
2 changes: 1 addition & 1 deletion Source/Core/RectangleCollisionChecker.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import RBush from "../ThirdParty/rbush.js";
import RBush from "../ThirdPartyNpm/rbush.js";
import Check from "./Check.js";

/**
Expand Down
2 changes: 1 addition & 1 deletion Source/Core/RequestScheduler.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Uri from "../ThirdParty/Uri.js";
import when from "../ThirdParty/when.js";
import when from "../ThirdPartyNpm/when.js";
import Check from "./Check.js";
import defaultValue from "./defaultValue.js";
import defined from "./defined.js";
Expand Down
2 changes: 1 addition & 1 deletion Source/Core/Resource.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Uri from "../ThirdParty/Uri.js";
import when from "../ThirdParty/when.js";
import when from "../ThirdPartyNpm/when.js";
import appendForwardSlash from "./appendForwardSlash.js";
import Check from "./Check.js";
import clone from "./clone.js";
Expand Down
2 changes: 1 addition & 1 deletion Source/Core/TaskProcessor.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Uri from "../ThirdParty/Uri.js";
import when from "../ThirdParty/when.js";
import when from "../ThirdPartyNpm/when.js";
import buildModuleUrl from "./buildModuleUrl.js";
import defaultValue from "./defaultValue.js";
import defined from "./defined.js";
Expand Down
2 changes: 1 addition & 1 deletion Source/Core/Transforms.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import when from "../ThirdParty/when.js";
import when from "../ThirdPartyNpm/when.js";
import Cartesian2 from "./Cartesian2.js";
import Cartesian3 from "./Cartesian3.js";
import Cartesian4 from "./Cartesian4.js";
Expand Down
2 changes: 1 addition & 1 deletion Source/Core/VRTheWorldTerrainProvider.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import when from "../ThirdParty/when.js";
import when from "../ThirdPartyNpm/when.js";
import Credit from "./Credit.js";
import defaultValue from "./defaultValue.js";
import defined from "./defined.js";
Expand Down
2 changes: 1 addition & 1 deletion Source/Core/loadAndExecuteScript.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import when from "../ThirdParty/when.js";
import when from "../ThirdPartyNpm/when.js";

/**
* @private
Expand Down
2 changes: 1 addition & 1 deletion Source/Core/loadImageFromTypedArray.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import when from "../ThirdParty/when.js";
import when from "../ThirdPartyNpm/when.js";
import Check from "./Check.js";
import defaultValue from "./defaultValue.js";
import defined from "./defined.js";
Expand Down
2 changes: 1 addition & 1 deletion Source/Core/loadKTX2.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Check from "./Check.js";
import Resource from "./Resource.js";
import KTX2Transcoder from "./KTX2Transcoder.js";
import when from "../ThirdParty/when.js";
import when from "../ThirdPartyNpm/when.js";

/**
* Stores the supported formats that KTX2 can transcode to. Called during context creation.
Expand Down
2 changes: 1 addition & 1 deletion Source/Core/sampleTerrain.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import when from "../ThirdParty/when.js";
import when from "../ThirdPartyNpm/when.js";
import Check from "./Check.js";

/**
Expand Down
2 changes: 1 addition & 1 deletion Source/Core/sampleTerrainMostDetailed.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import when from "../ThirdParty/when.js";
import when from "../ThirdPartyNpm/when.js";
import Cartesian2 from "./Cartesian2.js";
import defined from "./defined.js";
import DeveloperError from "./DeveloperError.js";
Expand Down
2 changes: 1 addition & 1 deletion Source/DataSources/CzmlDataSource.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ import LabelStyle from "../Scene/LabelStyle.js";
import ShadowMode from "../Scene/ShadowMode.js";
import VerticalOrigin from "../Scene/VerticalOrigin.js";
import Uri from "../ThirdParty/Uri.js";
import when from "../ThirdParty/when.js";
import when from "../ThirdPartyNpm/when.js";
import BillboardGraphics from "./BillboardGraphics.js";
import BoxGraphics from "./BoxGraphics.js";
import CallbackProperty from "./CallbackProperty.js";
Expand Down
2 changes: 1 addition & 1 deletion Source/DataSources/DataSourceCollection.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import destroyObject from "../Core/destroyObject.js";
import DeveloperError from "../Core/DeveloperError.js";
import Event from "../Core/Event.js";
import CesiumMath from "../Core/Math.js";
import when from "../ThirdParty/when.js";
import when from "../ThirdPartyNpm/when.js";

/**
* A collection of {@link DataSource} instances.
Expand Down
4 changes: 2 additions & 2 deletions Source/DataSources/EntityCluster.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import LabelCollection from "../Scene/LabelCollection.js";
import PointPrimitive from "../Scene/PointPrimitive.js";
import PointPrimitiveCollection from "../Scene/PointPrimitiveCollection.js";
import SceneMode from "../Scene/SceneMode.js";
import kdbush from "../ThirdParty/kdbush.js";
import KDBush from "../ThirdPartyNpm/kdbush.js";

/**
* Defines how screen space objects (billboards, points, labels) are clustered.
Expand Down Expand Up @@ -335,7 +335,7 @@ function createDeclutterCallback(entityCluster) {
var collection;
var collectionIndex;

var index = kdbush(points, getX, getY, 64, Int32Array);
var index = new KDBush(points, getX, getY, 64, Int32Array);

if (currentHeight < previousHeight) {
length = clusters.length;
Expand Down
4 changes: 2 additions & 2 deletions Source/DataSources/GeoJsonDataSource.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ import Resource from "../Core/Resource.js";
import RuntimeError from "../Core/RuntimeError.js";
import HeightReference from "../Scene/HeightReference.js";
import VerticalOrigin from "../Scene/VerticalOrigin.js";
import topojson from "../ThirdParty/topojson.js";
import when from "../ThirdParty/when.js";
import topojson from "../ThirdPartyNpm/topojson.js";
import when from "../ThirdPartyNpm/when.js";
import BillboardGraphics from "./BillboardGraphics.js";
import CallbackProperty from "./CallbackProperty.js";
import ColorMaterialProperty from "./ColorMaterialProperty.js";
Expand Down
Loading