Commit Graph

574 Commits

Author SHA1 Message Date
Sanjeet Suhag 36327923a1 Runs eslint before prettier in pre-commit hook 2022-06-06 10:11:20 -04:00
Gabby Getz 74dac36b6b Merge branch '1.94.2-release' into main 2022-06-03 15:07:58 -04:00
Gabby Getz 3a28262bbb Update for 1.94.2 release 2022-06-03 15:00:39 -04:00
Sanjeet Suhag 7594421ce7 Utilizes lint-staged for pre-commit hook 2022-06-03 14:31:13 -04:00
Gabby Getz 445744e3f9
Merge pull request #10411 from CesiumGS/markdown-lint
Adds markdownlint
2022-06-03 14:03:25 -04:00
Gabby Getz bfa1479ac3 1.94.1 updates 2022-06-03 13:33:23 -04:00
Sanjeet Suhag 79562ba016 Merge branch 'main' of https://github.com/CesiumGS/cesium into markdown-lint 2022-06-03 11:05:09 -04:00
Gabby Getz f409126287
Merge pull request #10412 from CesiumGS/karma-config-upgrade
Upgrade to Karma v6.3.20
2022-06-02 12:31:18 -04:00
Gabby Getz 7ac3fd09e0 coverage 2022-06-02 11:24:07 -04:00
Sanjeet Suhag 9ddf451a83 Upgrades package.json to version 1.94.0, updates Ion token for 1.94.0 release. 2022-06-01 12:10:45 -04:00
Sanjeet Suhag 64cd0cd468 Enables markdownlint on root files except README, CHANGES and LICENSE 2022-05-31 16:51:18 -04:00
Sanjeet Suhag 8990cf4c45 Upgrades to Karma v6.3.20 2022-05-31 12:53:20 -04:00
Sanjeet Suhag 39164357e0 Adds markdownlint 2022-05-31 09:50:32 -04:00
Gabby Getz 44b9610b40 karma specs and coverage 2022-05-27 10:42:45 -04:00
Gabby Getz f6cf110957 clean up gulp tasks and naming 2022-05-25 14:35:38 -04:00
Gabby Getz eb60fbf46a cleanup build tasks 2022-05-25 14:20:47 -04:00
Gabby Getz 355dd42838 Updated build process 2022-05-24 08:54:14 -04:00
Gabby Getz ff559c7109 build workers, third party, and combine with eslint 2022-05-11 16:53:41 -04:00
Sam Suhag 50752a47b1
Merge pull request #10295 from CesiumGS/third-party
ThirdParty.json
2022-05-05 09:57:49 -04:00
Gabby Getz 2eda8540f0 Add build-third-party task 2022-05-04 16:13:18 -04:00
Gabby Getz e8598a0f4a 1.93 release updates 2022-05-02 09:16:48 -04:00
Eli Bogomolny bc9e834b2c Remove customEqualityTester arguments 2022-04-05 13:35:51 -04:00
Sanjeet Suhag a02b1a0762 Updates to version 1.92.0 2022-04-01 16:01:14 -04:00
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 999ee4e6b8 1.91 release updates 2022-03-01 10:02:44 -05:00
Eli Bogomolny c497cdb4d2 Add back quantization 2022-02-22 17:01:42 -05:00
Gabby Getz a11b14cab7 1.90 release updates 2022-02-01 13:57:02 -05:00
Gabby Getz 87fe04415e
Merge pull request #9774 from yukinoda/ci/husky-upgrade
ci: Husky Upgrade from `4.3.8` to `7.0.2`
2022-01-20 09:49:46 -05:00
Eli Bogomolny 3ff462d550
Revert "Lock colors to 1.4.0" 2022-01-10 16:01:26 -05:00
Eli Bogomolny bb660e8cc5 Lock colors to 1.4.0 2022-01-10 12:26:18 -05:00
Eli Bogomolny 12bf7f83f6 Update for 1.89 release 2022-01-03 15:37:40 -05:00
Sanjeet Suhag fbc3f975b6 1.88 package.json 2021-12-01 14:15:52 -05:00
Sanjeet Suhag 185c6effa9 1.88 package and Ion token update 2021-12-01 14:14:48 -05:00
Sanjeet Suhag c199b8bde3 Revert "Upgrades package to 1.88.0, updates Ion token"
This reverts commit e190e8aa0f.
2021-12-01 13:46:51 -05:00
Sanjeet Suhag e190e8aa0f Upgrades package to 1.88.0, updates Ion token 2021-12-01 12:44:28 -05:00
Eli Bogomolny 9ebeea21ac Update package.json version 2021-11-09 13:39:24 -05:00
Eli Bogomolny 3831cb9ff1 Update for 1.87 release 2021-11-01 14:39:24 -04:00
Eli Bogomolny 51e724f962 Update to 2.3.12 2021-10-27 15:13:46 -04:00
Eli Bogomolny e6b2793b25 1.86.1 package.json and CHANGES.md updates 2021-10-15 11:35:01 -04:00
Eli Bogomolny 56ac035357
Merge pull request #9828 from CesiumGS/terser
Switch from uglify to terser
2021-10-05 19:07:35 -04:00
Eli Bogomolny cd144b360c Update Ion.js token, CHANGES.md, and package.json for 1.86.0 release 2021-10-01 11:26:27 -04:00
Eli Bogomolny 53d112e271 use prepare instead of postinstall 2021-10-01 09:56:16 -04:00
Eli Bogomolny 811584e7ff postinstall to copy files from node_modules 2021-09-28 13:36:57 -04:00
Matthew Amato 4fc197f62e Switch from uglify to terser 2021-09-24 08:02:13 -04:00
yukinoda bc03fe0eeb Revert "executed npm audit fix"
This reverts commit 73e8c2cbe3.
2021-09-22 17:25:43 +09:00
yukinoda 73e8c2cbe3 executed npm audit fix 2021-09-22 16:57:11 +09:00
yukinoda d934f151bc upgrade husky version 2021-09-22 16:55:46 +09:00
yukinoda 6f64ca2642 fix CI issue with duplicated prepare script 2021-09-03 13:55:28 +09:00
Yuki Noda bf6b1ca5e7
Merge branch 'main' into ci/husky-upgrade 2021-09-03 12:03:28 +09:00
Peter Gagliardi a020656976 Merge branch 'main' of github.com:CesiumGS/cesium into main 2021-09-01 16:25:27 -04:00
ebogo1 b0625508fb PR feedback 2021-09-01 15:01:13 -04:00
ebogo1 26716a82e1 Merge remote-tracking branch 'origin/main' into draco-prepare 2021-09-01 13:40:40 -04:00
Peter Gagliardi c0c0017862 Merge branch 'main' of github.com:CesiumGS/cesium into main 2021-09-01 13:15:04 -04:00
ebogo1 a1441494f6 First pass with npm prepare 2021-09-01 09:04:06 -04:00
Peter Gagliardi 2688bae4b6 Update Ion.js, CHANGES.md and package.json 2021-09-01 08:52:23 -04:00
yukinoda 9b8e4e96a6 husky upgrade 2021-08-31 21:24:57 +09: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
Sean Lilley 2ccf0fdb2f
Merge branch 'main' into npm-third-party-staging 2021-08-02 21:13:17 -04:00
srothst1 ffcc025a9e updated CHANGES.md, ion.js, and package.json 2021-08-02 13:38:42 -04:00
ebogo1 74b874a73f Merge remote-tracking branch 'origin/main' into npm-third-party-staging 2021-08-01 12:00:17 -04:00
ebogo1 65f59241e3 zip.js in exportKml 2021-07-26 17:05:12 -04:00
ebogo1 4012e2e6bb ktx-parse to npm 2021-07-23 16:34:05 -04:00
ebogo1 e1228598c8 add npm packages pt 1 2021-07-20 17:15:17 -04:00
Sean Lilley fe8fec2d51 master -> main 2021-07-16 19:01:30 -04:00
ebogo1 73e00e1e91 Merge remote-tracking branch 'origin/master' into npm-third-party-staging 2021-07-15 11:31:02 -04:00
ebogo1 52ed1012bc Update Ion token, CHANGES.md, and package.json version 2021-07-01 17:54:56 -04:00
Sean Lilley 61559cd2ac Downgrade husky 2021-06-23 09:19:56 -04:00
Sean Lilley 931593c801 Downgrade karma 2021-06-22 13:54:30 -04:00
Sean Lilley 22b347b0a3 Update husky from 4 to 6 2021-06-21 22:46:59 -04:00
Sean Lilley 8dfd3f1258 Update packages 2021-06-21 22:34:56 -04:00
Matthew Amato 540cac6a58 Bump version to 1.82.1 to fix improperly published 1.82.0
Also fix bad version for loadCRN/loadKTX deprecations.
2021-06-01 18:03:38 -04:00
Samuel Vargas 80ceefef2e
Update Ion token, update version to 1.82 2021-06-01 15:34:12 -04:00
Matthew Amato 829ca79d38 Update version, ion token, and CHANGES for 1.81 release. 2021-05-03 09:33:50 -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
hpinkos fc926f5a0d update for release 2021-04-01 15:42:32 -04:00
Kevin Ring c5db0d038f Bump version to 1.79.1. 2021-03-02 10:25:58 +11:00
Kevin Ring 528813ceb3 Updates for 1.79 release. 2021-03-01 18:02:07 +11:00
Kevin Ring 25585356e8 Merge remote-tracking branch 'origin/master' into eslint-gulpfile 2021-03-01 08:57:44 +11:00
Ian Lilley 85d9e19be0 prepare for 1.78 release 2021-02-01 12:43:21 -05:00
hpinkos 6113d463a3 Merge branch 'master' into eslint-gulpfile 2021-01-19 13:30:59 -05:00
Ian Lilley 06f5a625ba reverted eslint min version 2021-01-12 15:43:10 -05:00
Ian Lilley 009c6d1b6c eslint fixes 2021-01-12 15:10:38 -05:00
hpinkos f5a17527c6 Merge branch 'master' into eslint-gulpfile 2021-01-05 17:16:24 -05:00
Kangning Li 26e2c44a61 Update version and ion token for 1.77 release 2021-01-04 10:59:13 -05:00
hpinkos a2a0d73fe2 run eslint on cjs files 2020-12-18 14:53:33 -05:00
Sean Lilley 01a40073f4 Update package.json to 1.76.0 2020-12-01 14:04:22 -05:00
Omar Shehata 9949ddab92 Update version and ion token for 1.75 release 2020-11-02 09:17:06 -05:00
Matthew Amato 4467ccc6ba Update version and ion token for 1.74.0 release 2020-10-01 12:28:11 -04:00
Matthew Amato 09f87a6bea Update npm major version changes (and pinned prettier)
1. No code change required on our end at all. These were mostly dropping
support for Node 8, which is end-of-life.

2. I did not update to TypeScript 4.x, because I'm actually not sure what
that would mean for the definition files and something we should probably
look into separately.
2020-09-30 20:47:58 -04:00
Kevin Ring 6c0a0f89be Bump to v1.73.0. 2020-09-01 15:28:38 +10:00
Kevin Ring aaf7d72b6f
Use an exact version of prettier
As recommended by the prettier project.
2020-08-30 22:43:50 +10:00
Frederic Junod 241a27edf8 Update prettier to version ^2.1.1 2020-08-28 10:15:42 +02:00
William Wall 9046bd2c22 Add package.json to exports so it can be resolved
Many tools attempt to require.resolve package.json, and in the latest
versions of node that is not possible if the package specifies exports.
The solution is to simply add package.json to exports.

Resolves #8992
2020-08-19 12:08:31 -06:00
Bao 5c98e4268a update ion token and package.json version to 1.72 2020-08-03 11:00:24 -04:00
Matthew Amato 21c07cb6f4 Update outdated npm modules
1. Only code change was a harmless bug in Expression.js that new eslint
detected.

2. rollup-plugin-uglify and rollup-plugin-external-globals complain they
want rollup 1.x, but they work fine with 2 so it's a harmless warning.
2020-07-21 15:04:04 -04:00
Sanjeet Suhag bfdd1050bb Updates ion token, bump to version 1.71.0 2020-07-01 15:06:30 -04:00
Matthew Amato c6a993f472 Bump version and cleanup CHANGES for 1.70.1 release. 2020-06-10 09:38:24 -04:00
Ian Lilley 2d3852c31c updated tokens, version, and changes.md 2020-06-01 14:37:16 -04:00
Matthew Amato 85c78edf31 Generate official TypeScript type definitions
It's been a long requested feature for us to have official TypeScript type
definitions.  While the community has done a yeoman's job of manually
supporting various efforts, the most recent incarnation of which is
`@types/cesium`, the sheer scale and ever-evolving nature of Cesium's code
base makes manual maintenance a Sisyphean task.

Thankfully, our decision to maintain meticulous JSDoc API documentation
continues to pay dividends and is what makes automatically generating
TypeScript definitions possible. Using the excellent
https://github.com/englercj/tsd-jsdoc project we can now automatically
generate and even partially validate official definitions as part of the
build process. (Thanks to @bampakoa who contributed some early PRs to both
CesiumJS and tsd-jsdoc over a year ago and is how I learned about
tsd-jsdoc)

While tsd-jsdoc output is mostly where we need it to be, we do
post-processing on it as well. This lets us clean up the output and also
make sure these definitions work whether users include cesium via module,
i.e. `import { Cartesian3 } from 'cesium'`, or individual files, i.e.
`'import Cartesian3 from 'cesium/Source/Core/Cartesian3'`. There were also
some quirks of tsd-jsdoc output we fixed that may eventually turn into a PR
into that project from us. The post-processing is part typescript compiler
API, part string manipulation. It works and is straightforward but we might
want to go full TS api in the future if we decide we need to do more
complicated tasks. The output of tsd-jsdoc is currently a little noisy
because of some incorrect error reporting, but I'm talking with the
maintainer in https://github.com/englercj/tsd-jsdoc/issues/133 to get them
fixed. No need to hold up this PR for it though.

The definition is generated as a single `Cesium.d.ts` file in Source, so it
lives alongside Cesium.js. It is ignored by git but generated by a separate
`build-ts` task as part of CI and makeZipFile. This task also validates the
file by compiling it with TypeScript, so if a developer does anything too
egregious, the build will fail. Definitions are automatically included in
our npm packages and release zips and will be automatically used by IDEs
thanks to the `types` setting in package.json. This means that IDEs such as
VS Code will prefer these types over the existing `@types/cesium` version
by default.

I didn't want to slow the `build` step down, so I made this a separate
step, but in the future we could consider running it by default and we
could also unignore this file in Git so that PR reviewers can see the
impact, if any, our code changes have on the generated definitions. This
might be a good idea as an additional sanity check and should only actually
change when the public API itself changes. But the issue would be
remembering to run it before submitting the code (or we could use git hooks
I suppose?) I just don't want to slow down devs so I'm hesitant to do
anything like this out of the gate. We can definitely revisit in the
future.

A particular exciting thing about this approach is that it exposed a ton of
badness in our current JSDoc markup, which is now fixed. Previously, our
only concern was "does the doc look right" and we didn't pay attention to
whether the meta information generated by JSDoc correctly captured type
information (because up until it didn't matter). We leaned particular hard
on `@exports` which acted as a catch-all but has now been completely
removed from the codebase. All this means is that our documentation as a
whole has now improved greatly and will continue to be maintained at this
new higher level thanks to incorporating TS definition creation into our
pipeline!

One minor caveat here is that obviously we changed our JSDoc usage to both
make it correct and also accommodate TypeScript. The main drawback to these
fixes is that enums are now generated as globals in the doc, rather than
modules. This means they no longer have their own dedicated page and are
instead on the globals page, but I changed the code to ensure they are
still in the table of contents that we generate. I think this trade-off is
perfectly fine, but I wanted to mention it since it does change the doc
some. We can certainly look into whether we can generate enums on their own
page if we think that makes sense. (I actually like this approach a little
better personally).

Last major piece, the actual code. 99% of the changes in this PR only
affect the JSDoc. There are two exceptions:

A few of our enums also have private functions tacked onto them. I had to
move these functions to be outside the initializer but otherwise they are
unchanged.  This ensures that a valid TS enum is generated from our code, since you can't have functions globbed onto enums in the TS world. If we were writing TS code by hand, we could use  declaration merging with a namespace, but the toolchain we are using doesn't have a way to express that right now.  There were two cases where these extra functions weren't private, `ComponentDataType` and `IndexDataType`. That means that as far as the TS definitions goes, the helper methods don't exist.  I consder this an edge case and we can write up issues to investigate later.  I'm actually not even sure if these functions are public on purposes, @lilleyse can you confirm?

We had a few places where we had method signatures with optional parameters
that came _before_ required parameters, which is silly. This is invalid
TypeScript (and not good API design no matter the language). In 99% of
cases this was `equalsEpsilon` style functions where the lhs/rhs were
optional but the epsilon was not. I remember the discussion around this
when we first did it because we were paranoid about defaulting to 0, but
it's an edge case and it's silly so I just changed the epsilon functions
to default to zero now, problem solved.

Here's a high level summary of the JS changes:

* Use proper `@enum` notation instead of `@exports` for enums.

* Use proper `@namespace` instead of `@exports` for static classes.

* Use proper `@function` instead of `@exports` for standalone functions.

* Fix `Promise` markup to actually include the type in all cases, i.e.
`Promise` => `Promise<void>` or `Promise<Cartesian3[]>`.

* Fix bad markup that referenced types that do not exist (or no longer
exist) at the spec level, `Image` => `HTMLImageElement`,
`Canvas` => `HTMLCanvasElement`, etc.. `TypedArray` in particular does not
exist and much be expressed as a lsit of all applicable types,
`Int8Array|Uint8Array|Int16Array|Uint16Array...`.

* Use dot notation instead of tilde in callbacks, to better support
TypeScript, i.e. `EasingFunction~Callback` becomes
`EasingFunction.Callback`. The only exception is when we had a callback
type that was i.e. `exportKml~ModelCallback` becomes
`exportKmlModelCallback` (a module global type rather than a type on
exportKml). This is because it's not possible to have exportKml be both a
function and a namespace in this current toolchain.  Not a big deal either
way since these are meta-types used for defining callbacks but I wanted to
mention it.

* There were some edge cases where private types that were referenced in
the public API but don't exist in the JSDoc. These were trivial to fix by
either tweaking the JSDoc to avoid leaking the type or in some cases, just
as `PixelDataType`, simply exposing the private type as public.  I also
found a few cases where things were accidentally public, I marked these as
private (these were extreme edge cases so I'm not concerned about breaking
changes). Appearances took an optional `RenderState` in their options, I
just changed the type to `Object` which we can clean up further later if
we need to.

* Lots of other little misc JSDoc issues that became obvious once we
started to generate definitions (duplicate parameters for example).

Thanks again to the community for helping generate ideas and discussions
around TS definitions over the last few years and a big thanks to @javagl
for helping behind the scenes on this specific effort by evaluating a few
different approaches and workaround before we settled on this one (I'm
working on a blog with all of the gory details for those interested).

Finally, while I'm thrilled with how this turned out (all ~41000 lines
and 1.9MB of it), I can guarantee we will uncover some issues with the
type definitions as more people use it. The good news is that improving it
is now just a matter of fixing the JSDoc, which will benefit the community
as a whole and not just TS users.


Fixes #2730
Fixes #5717
2020-05-26 22:40:05 -04:00
Sean Lilley 65a079abf1 Update package.json to 1.69 and update default Ion access token 2020-05-01 09:53:25 -04:00
Frederic Junod 4323909b21 Remove sortRequires from package.json and doc 2020-04-24 15:34:11 +02:00
Kevin Ring 1117a6871f Improve consistency between prettier and pretty-quick. 2020-04-17 12:30:15 +10:00
Matthew Amato 1b16c31941 Add configuration for prettier code formatting
1. Add prettier and configuration files, but do not format code yet.
2. Configure it for all html|css|js|md code.
3. Fix a bug it found in `CZML Custom Properties.html`
4. Add a pre-commit hook via husky and pretty-quick which will
automatically format changed files when they are staged on the client.
5. Run `prettier-check` during CI and fail the build of code is not
formatted properly.
6. Install eslint config for prettier. This does not enable prettier
checking in eslint (it's unusably slow) but instead just makes sure that
no eslint rules conflict with prettier formatting.
7. Update .editorconfig to match (since prettier respects it)
8. Tweak Sandcastle to handle prettier formated examples
2020-04-13 17:19:59 -04:00
Omar Shehata 70478525bd Update version, CHANGES, and ion token for 1.68 release 2020-04-01 09:13:13 -04:00
Kevin Ring f67eb82ac8 Remove esm dependency, update CHANGES.md. 2020-03-19 23:45:13 +11:00
Kevin Ring 6eafc26c85 Add .gulp.json instead of explicitly specifying cjs in npm cmds. 2020-03-19 20:42:36 +11:00
Kevin Ring 47fa26074b Fix Cesium in Node.js 12+. 2020-03-04 20:18:08 +11:00
Matthew Amato 77d4f155a9 Update version, CHANGES, and ion token for 1.68 release. 2020-03-02 10:39:21 -05:00
Matthew Amato c276f0263b Make Cesium release server work on Node 12.
While we still can't use Node 12 for Cesium development, this change is
to make sure Cesium release zips can actually work under Node 12.
2020-03-02 09:39:37 -05:00
Matthew Amato 06a7763933 AnalyticalGraphicsInc -> CesiumGS
1. Update relevant AnalyticalGraphicsInc organization links to CesiumGS.

2. Remove Webstorm guide since it's unmaintained and reference an
unmaintained plugin

3. Update outdated email address in CODE_OF_CONDUCT.
2020-02-18 13:19:12 -05:00
greenkeeper[bot] 525595311e
chore(package): update karma-jasmine to version 3.1.1 2020-02-11 00:42:17 +00:00
Sean Lilley be4d7bb30e Update package.json to 1.66 2020-02-03 11:16:37 -05:00
greenkeeper[bot] 66371f75ab
chore(package): update mkdirp to version 1.0.0 2020-01-24 20:25:31 +00:00
Kevin Ring cb0f31c0bd Changes for January 2019 release (1.65). 2020-01-06 10:22:19 -05:00
Matthew Amato 456045f713
Merge pull request #8434 from AnalyticalGraphicsInc/greenkeeper/gulp-rename-2.0.0
Update gulp-rename to the latest version 🚀
2019-12-19 08:06:52 -05:00
Matthew Amato a9a8ade465
Merge pull request #8446 from AnalyticalGraphicsInc/greenkeeper/rollup-plugin-external-globals-0.5.0
Update rollup-plugin-external-globals to the latest version 🚀
2019-12-19 07:52:02 -05:00
Matthew Amato 2632a74225
Merge pull request #8402 from AnalyticalGraphicsInc/greenkeeper/yargs-15.0.1
Update yargs to the latest version 🚀
2019-12-19 07:51:32 -05:00
greenkeeper[bot] 6b65d33fb5
chore(package): update rollup-plugin-external-globals to version 0.5.0 2019-12-08 13:28:39 +00:00
greenkeeper[bot] d7a8de61d3
chore(package): update gulp-rename to version 2.0.0 2019-12-04 16:53:12 +00:00
Gabrielle Getz aed09e827d Updates for 1.64 release 2019-12-02 08:43:47 -05:00
greenkeeper[bot] 1ccdce059e
chore(package): update yargs to version 15.0.1 2019-11-16 22:59:32 +00:00
Matthew Amato 3f6ce5fda9 Bump version for 1.63.1 release 2019-11-06 08:32:17 -05:00
Matthew Amato 0697cb1d63 Update version, demo token, and CHANGES for release 2019-11-01 13:22:52 -04:00
Matthew Amato 869e77d3fa
Merge pull request #8287 from AnalyticalGraphicsInc/greenkeeper/open-7.0.0
Update open to the latest version 🚀
2019-10-30 21:13:18 -04:00
hpinkos 3558940b5f Merge branch 'more-cesiumjs.org-link' into cesiumjs.org-links 2019-10-21 10:52:02 -04:00
Hannah c82ec17cb0
Update package.json 2019-10-16 13:18:20 -04:00
Hannah 442de89510
Update package.json 2019-10-16 11:06:09 -04:00
hpinkos 4f23b39a04 update cesiumjs.org links 2019-10-15 16:49:19 -04:00
greenkeeper[bot] 9b4f7d2792
chore(package): update open to version 7.0.0 2019-10-15 18:43:51 +00:00
Matthew Amato dd4272fd77
Merge pull request #8265 from AnalyticalGraphicsInc/node-es6
Use ES6 modules under Node versions that support them.
2019-10-09 08:18:07 -04:00
Matthew Amato 16695223ce Use ES6 modules under Node versions that support them.
When running in a version of Node that supports ES6, this will now load
the ES6 version of Cesium instead of the transpiled modules or modules
loaded via ESM. It does it by setting the module type and entry points in
package.json.

There are 3 use cases this allows:

1. Roll-up and other tools that support resolving front-end dependencies
via node_modules can now make use of Cesium.
`import { defined, JulianDate } from 'cesium';` can now be used in such
systems instead of specifying the relative path to Source/Cesium.js This
makes it easier to write reusable components that rely on Cesium.

2. Since we are using Cesium ES6, node bundlers can perform treeshaking
and eliminate unused code, basically allow for building combined minified
node code with tools like roll-up.

3. Requiring in individual modules, such as `cesium/Source/Core/Cartesian3.js`
is now possible in situations where pulling the primary entry point is
not desired.

The one downside of this change is that ES6 versions of Node will no
longer automatically pull in the combined/minimized version of Cesium.js,
though its still technically possible to do via manual esm usage. This
may (or may not) impact performance under node in certain situations but
ultimately a build process is properly the preferred method for optimizing
node applications.
2019-10-08 11:26:09 -04:00
Matthew Amato 3fcf2317e8 Use built-in roll-up banner support. 2019-10-08 08:08:25 -04:00
Matthew Amato aabd27a760 Migrate Cesium to ES6 Modules
See https://github.com/AnalyticalGraphicsInc/cesium/pull/8224 for details.

eslint
There are a handful of new .eslintrc.json files, mostly to identify the files that are still AMD modules (Sandcastle/Workers). These are needed because you can't change the parser type with a comment directive (since the parser is the thing reading the file). We can finally detect unusued modules! So those have all been cleaned up as well.

requirejs -> rollup & clean-css
requirejs, almond, and karma-requirejs have all been removed. We now use rollup for building and minifying (via uglify) JS code and clean-css for css. These changes are fairly straight-forward and just involve calling rollup instead of requirejs in the build process.

Overall build time is significantly faster. CI is ~11 minutes compared to ~17 in master. Running makeZipFile on my machine takes 69 seconds compared to 112 seconds in master. There's probably plenty of room for additional optimization here too.

We wrote an published a small npm module, rollup-plugin-strip-pragma, for stripping the requirejs pragmas we use out of the release builds. This is maintained in the Tools/rollup-plugin-strip-pragma directory.

As for what we produce. The built version of Cesium is now a UMD module. So it should work anywhere that hasn't made the jump to ES6 yet. For users that were already using the "legacy" combined/minified approach, nothing changes.

One awesome thing about roll-up is that it compiles all of the workers at once and automatically detects shared codes and generates separate bundles under the hood. This means the size of our worker modules shrink dramatically and Cesium itself will load them much faster. The total minified/gzipped size of all workers in master is 2.6 MB compared to 225 KB in this branch! This should be most noticeable on demos like Geometry & Appearances which load lots of workers for the various geometry typs.

roll-up is also used to build Cesium Viewer, which is now an ES6 app.

We use clean-css via gulp and it is also a straightforward change from requirejs that requires no special mention.

Workers
While the spec allows for ES6 Web Workers, no browser actually supports them yet. That means we needed a way to get our workers into non-ES6 form. Thankfully, roll-up can generate AMD modules, which means we now have a build step to compile our Worker source code back into AMD and use the existing TaskProcessor to load and execute them. This build step is part of the standard build task and is called createWorkers. During development, these "built" workers are un-optimized so you can still debug them and read the code.

Since there is a build step, that means if you are changing code that affects a worker, you need to re-run build, or you can use the build-watch task to do it automatically.

The ES6 versions of Worker code has moved into Source/WorkersES6 and we build the workers into their "old home" of Source/Workers. cesiumWorkerBootstrapper and transferTypedArrayTest which were already non-AMD ES5 scripts remain living in the Workers directory.

Surprisingly little was changed about TaskProcessor or the worker system in general, especially considering that I thought this would be one of the major hurdles.

ThirdParty
A lot of our ThirdParty either already had a hand-written wrapper for AMD (which I updated to ES6) or had UMD which created problems when importing the same code in both Node and the browser. I basically had to update the wrapper of every third-party library to fix these problems. In some cases I updated the library version itself (Autolinker, topojson). Nothing to be too concerned about, but future clean-up would be using npm versions of these libraries and auto-generating the wrappers as needed so we don't hand-edit things.

Sandcastle
Sandcastle is eternal and manages to live another day in it's ancient requirejs/dojo 1.x form. Sandcastle now automatically uses the ES6 version of Cesium if it is available and fallsback to the ES5 unminified version if it is now. The built version of Sandcastle always uses CesiumUnminified, just like master. This means Sandcastle still works in IE11 if you run the combine step first (or use the relase zip)

Removed Cesium usage from Sandcastle proper, since it wasn't really needed
Generate a VERSION propertyin the gallery index since Cesium is no longer being included.
Remove requirejs from Sandcastle bucket
Update bucket to use the built version of Cesium if it is available by fallbackto the ES6 version during development.
Standalone.html was also updated
There's a bit of room for further clean-up here, but I think this gets us into master. I did not rename bucket-requirejs.html because I'm pretty sure it would break previously shared demos. We can put in some backwards compatible code later on if we want. (But I'd rather just see a full Sandcastle rewrite).

Specs
Specs are now all ES6, except for TestWorkers, which remain standard JS worker modules. This means you can no longer run the unbuilt unit tests in IE11. No changes for Chrome and Firefox.

Since the specs use ES6 modules and built Cesium is an ES5 UMD, I added a build-specs build step which generates a combined ES5 version of the specs which rely on Cesium as a global variable. We then inject these files into jasmine instead of the standard specs and everything works exactly as it did before. SpecRunner.html has been updated to inject the correct version of the script depending on the build/release query parameters.

The Specs must always use Cesium by importing Source/Cesium.js, this is so we can replace it with the built Cesium as describe above.

There's a bunch of room for clean-up here, such as unifying our two copies of jasmine into a single helper file, but I didn't want to start doing that clean-up as part of this already overly big PR. The important thing is that we can still test the built version and still test on IE/Edge as needed.

I also found and fixed two bugs that were causing failing unit tests, one in BingMapsImageryProviderSpec.js (which was overwriting createImage andnot setting it back) and ShadowVolumeAppearance.js (which had a module level caching bug). I think these may have been the cause of random CI failures in master as well, but only time will tell.

For coverage, we had to switch to karma-coverage-istanbul-instrumenter for native ES6 support, but that's it.

Finally, I updated appveryor to build Cesium and run the built tests under IE. We still don't fail the build for IE, but we should probably fix that if we want to keep it going.

NodeJS
When NODE_ENV is production, we now require in the minified CesiumJS directly, which works great because it's now a UMD module. Otherwise, we use the excellant esmpackage to load individual modules, it was a fairly straightforward swap from our old requirejs usage. We could probably drop esm too if we don't care about debugging or if we provie source maps at some point.
2019-10-03 11:51:23 -04:00
Matthew Amato de92ad61bf Update version, CHANGES, and ion token for release.
Also update autho metadata to Cesium GS, Inc.
2019-10-01 08:31:20 -04:00
Matthew Amato 12f2bf1af4
Merge pull request #8184 from AnalyticalGraphicsInc/update-node-modules
Update node modules
2019-09-20 10:19:54 -04:00
Aristeidis Bampakos 47d19c52c0 Remove instrumentForCoverage gulp task 2019-09-19 22:30:36 +03:00
hpinkos 1a8e2dd5a7 update node modules 2019-09-19 11:04:04 -04:00
Aristeidis Bampakos 3f4bdae71e Generate documentation in watch mode 2019-09-18 22:55:30 +03:00
hpinkos 95e17df2a4 2 degrees of precision 2019-09-18 14:39:48 -04:00
hpinkos 0133ed2241 Merge remote-tracking branch 'public-cesium/master' into optimize-approx-terrain-heights 2019-09-18 14:18:41 -04:00
Omar Shehata 37095c2bb6 Update CHANGES, Ion.js and package.json for 1.61 release 2019-09-03 10:37:41 -04:00
Matthew Amato b9fe8f33f4 Replace jscoverage with karma-coverage
1. Replace our ancient, windows-only jscoverage implementation with
karma-coverage, which works on all platforms and does not require a
separate instrumentation step. You now run coverage by simply typing
`npm run coverage`. This also provides improved results, such as branch
coverage, which the old system did not.
2. Updated Testing Guide
3. Remove old instrument link from index.html
4. Remove jscoverage and related code.
2019-08-27 21:10:14 -04:00
greenkeeper[bot] 8e8b178a95
chore(package): update yargs to version 14.0.0 2019-08-19 23:21:46 +00:00
Matthew Amato f18342d017 Re-enable Chrome for travis builds
Looks like the Chrome bug (or karma issue?) that prevented them from
running is now fixed.
2019-08-15 08:36:02 -04:00
Tinco Andringa a5481f2115
Add optimizeApproximateTerrainHeights task to gulpfile 2019-08-08 20:36:03 +02:00
Tinco Andringa 10fd4be0f2
Merge branch 'master' into optimize-approx-terrain-heights 2019-08-08 20:22:39 +02:00