Commit Graph

17 Commits

Author SHA1 Message Date
Gabby Getz 31c154a299 Remove when.js and replace with native promises
There were a few areas in Source where a function was assumed to be executed synchronously when a function was resolved. Native Promises however, by spec, will resolve at the end of a frame. There were also some strange handling of promise rejection in imagery providers that I cleaned up a bit in order to make them testable.

- In LabelCollection and EntityCluster, order of execution adjustment where made.
- Added TextureAtlas.addImageSync to support the order of execution fix in LabelCollection
- ArcGisMapServerImageryProvider.readyPromise will not reject if there is a failure unless the request cannot be retried.
- SingleTileImageryProvider.readyPromise will not reject if there is a failure unless the request cannot be retried.

The majority of the changes lie in the Specs, where unresolved promises weren’t being awaited before finishing executions, and where resolved promises are assumed to be synchronous all over the place and needed a good amount of fixes. Another issue which came up was calling Promise.reject in the body of a spec can cause node to halt execution when running via the command line.
2022-03-16 09:38:39 -04:00
Eli Bogomolny 691ae2b943 Remove zip.js comments and update gulpfile comment 2021-10-08 12:44:38 -04:00
Eli Bogomolny 51950009af use pako with buildModuleUrl paths 2021-10-07 14:14:47 -04:00
Eli Bogomolny 4472b26d81 configure without web workers 2021-10-07 00:55:46 -04:00
Eli Bogomolny 3a07c02572 pako workers for zip.js 2021-09-29 16:35:11 -04:00
ebogo1 2bed051958 rename to Uri.js 2021-08-29 12:11:22 -04:00
ebogo1 4ed739465e Merge remote-tracking branch 'origin/main' into uri-js 2021-08-29 11:51:13 -04:00
ebogo1 edefb597b3 add meshoptimizer npm module 2021-08-27 11:13:34 -04:00
ebogo1 0d2b579786 Merge remote-tracking branch 'origin/npm-third-party-staging' into uri-js 2021-08-23 13:05:59 -04:00
Matthew Amato 974bb42a99 Use protobufjs from npm
Locked to version 6.7.0 since that is the version we are already using and
updating it requires additinal work because of the use of util.lazyResolve
in the GoogleEarthEnterpriceMetadata root parser code.
2021-08-22 15:08:43 -04:00
ebogo1 a5d7070f26 first pass 2021-08-18 23:18:11 -04:00
ebogo1 b962003b37 reduce import sizes for pako and zip 2021-08-04 13:29:21 -04:00
ebogo1 7b40a60bae remove inflate and deflate workers 2021-07-28 14:42:15 -04:00
ebogo1 65f59241e3 zip.js in exportKml 2021-07-26 17:05:12 -04:00
ebogo1 8165fd9d24 add ThirdParty/npm/ktx-parse.js 2021-07-23 16:45:46 -04:00
ebogo1 e1228598c8 add npm packages pt 1 2021-07-20 17:15:17 -04:00
Matthew Amato f594b3c99b Start of replacing submitted third party libraries with npm modules
Rather than submit libraries to Source/ThirdParty, which always end up
being modified for our build system and quickly go out of date, this
change starts to use libraries via npm instead. Currently Autolinker,
earcut, when, tween.js, rbush, kdbush, quickselect, and topojson are
ported.

The main hurdle that prevented us from doing this sooner was the fact that
Cesium has a long history of not requiring a build step after every code
change and has a goal of writing valid JS code, unlike many libraries today
 that mandate a bundler to turn invalid JS code into valid code.

Rather than mandate a bundler during development, this initial step adds a
"buildThirdyParty" function to the current "build" step. This function runs
third party libraries (defined in the ThirdParty/npm/ folder) through
RollUp and creates an equivalent file in `Source/ThirdPartyNpm`.

The change to end users will be non-existent, especially since the combined
Cesium.js will still re-export any third party modules as part of the
private API just like it used to.

This doesn't prevent code duplication for users using some of the same
third party libraries as Cesium. This is just an improvement as to how
depend on third party libraries internally.

I think Cesium's days of being "bundler free" are probably limited long
term, performance is the main hurdle and newer tools like esbuild may make
that no longer a problem. But that's outside the scope of this initial
goal.
2021-04-11 15:02:36 -04:00