-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
8261 - Avoid including Cesium3DTileSet in Picking.js #8532
Conversation
Thank you so much for the pull request @Samulus! I noticed this is your first pull request and I wanted to say welcome to the Cesium community! The Pull Request Guidelines is a handy reference for making sure your PR gets accepted quickly, so make sure to skim that.
Reviewers, don't forget to make sure that:
|
497e429
to
e269701
Compare
Can we do something similar to avoid sucking in |
@hpinkos import Color from '../Core/Color.js';
import defined from '../Core/defined.js';
import defineProperties from '../Core/defineProperties.js'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a few minor style things.
I'm going to verify that this actually reduces the build size and then it should be good to go.
Source/Scene/Cesium3DTileset.js
Outdated
@@ -879,6 +879,19 @@ import TileOrientedBoundingBox from './TileOrientedBoundingBox.js'; | |||
} | |||
|
|||
defineProperties(Cesium3DTileset.prototype, { | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style: remove empty line
Source/Scene/Cesium3DTileset.js
Outdated
|
||
/** | ||
* NOTE: This getter exists so that `Picking.js` can differentiate between | ||
* PrimitiveCollections and Cesium3DTileset objects without inflating |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* PrimitiveCollections and Cesium3DTileset objects without inflating | |
* PrimitiveCollection and Cesium3DTileset objects without inflating |
Source/Scene/Cesium3DTileset.js
Outdated
/** | ||
* NOTE: This getter exists so that `Picking.js` can differentiate between | ||
* PrimitiveCollections and Cesium3DTileset objects without inflating | ||
* the size of the module via `instance of Cesium3DTileset` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* the size of the module via `instance of Cesium3DTileset` | |
* the size of the module via `instanceof Cesium3DTileset` |
Source/Scene/Cesium3DTileset.js
Outdated
* the size of the module via `instance of Cesium3DTileset` | ||
*/ | ||
|
||
isCesium3DTileset: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style:
isCesium3DTileset: { | |
isCesium3DTileset : { |
Source/Scene/Cesium3DTileset.js
Outdated
*/ | ||
|
||
isCesium3DTileset: { | ||
get: function() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style:
get: function() { | |
get : function() { |
Source/Scene/Cesium3DTileset.js
Outdated
get: function() { | ||
return true; | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is why CI is failing. You can run npm run eslint
locally which will also catch this.
} | |
}, |
Also - add an entry to |
@lilleyse fixed |
Can confirm this fix reduces the build size. For future reference these were the steps @mramato suggested to verify this:
window.CESIUM_BASE_URL = '../../Source/';
import {
CesiumWidget
} from '../../Source/Cesium.js';
function main() {
var widget = new CesiumWidget('cesiumContainer');
}
main();
With fix: CesiumViewer.js is 1.3 MB |
@Samulus there's one style comment that you missed: https://github.com/AnalyticalGraphicsInc/cesium/pull/8532/files#r365949948 After that's fixed I'll go ahead and merge. |
* PrimitiveCollection and Cesium3DTileset objects without inflating | ||
* the size of the module via `instanceof Cesium3DTileset` | ||
*/ | ||
isCesium3DTileset : { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My mistake for not noticing this in the initial review - the getter should be marked as @private
.
This reverts commit cc88320.
86f8c58
to
96797bf
Compare
@lilleyse rebased and annotation added |
Little bit of offline miscommunication on my part, I should have been the one to merge the PR. That said, the changes do look good and I was about to merge 👍 |
Fixes #8261