-
Notifications
You must be signed in to change notification settings - Fork 2k
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
[v3.8.6] Optimize code size again. #18197
Conversation
@@ -474,7 +474,7 @@ export class Material extends Asset { | |||
protected _uploadProperty (pass: Pass, name: string, val: MaterialPropertyFull | MaterialPropertyFull[]): boolean { | |||
const handle = pass.getHandle(name); | |||
if (!handle) { return false; } | |||
const type = Pass.getTypeFromHandle(handle); | |||
const type = getTypeFromHandle(handle); |
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 static method Pass.getTypeFromHandle
could not be optimized by terser but getTypeFromHandle could.
👍 Package size ⤵ -1477 bytes, old: 5241693, new: 5240216Interface Check Report! WARNING this pull request has changed these public interfaces:
@@ -1137,32 +1137,10 @@
*/
ensureMeshData(): void;
destroy(): boolean;
/**
- * Calculate UV for sliced
* @deprecated since v3.5.0, this is an engine private interface that will be removed in the future.
*/
- _calculateSlicedUV(): void;
- /**
- * Calculate UV
- * @deprecated since v3.5.0, this is an engine private interface that will be removed in the future.
- */
- _calculateUV(): void;
- /**
- * @deprecated since v3.5.0, this is an engine private interface that will be removed in the future.
- */
- _setDynamicAtlasFrame(frame: any): void;
- /**
- * @deprecated since v3.5.0, this is an engine private interface that will be removed in the future.
- */
- _resetDynamicAtlasFrame(): void;
- /**
- * @deprecated since v3.5.0, this is an engine private interface that will be removed in the future.
- */
- _checkPackable(): void;
- /**
- * @deprecated since v3.5.0, this is an engine private interface that will be removed in the future.
- */
_serialize(ctxForExporting: any): any;
/**
* @deprecated since v3.5.0, this is an engine private interface that will be removed in the future.
*/
@@ -11191,9 +11169,9 @@
/**
* Editor specific gizmo camera logic
* @internal
*/
- syncCameraEditor(camera: any): void;
+ syncCameraEditor(camera: Camera): void;
/**
* @en Update the camera's builtin matrixes
* @zh 更新相机的视图、投影等矩阵
* @param forceUpdate If force update, then dirty flag will be ignored
|
@@ -23,16 +23,18 @@ | |||
THE SOFTWARE. | |||
*/ | |||
|
|||
import { BYTEDANCE, WECHAT, WECHAT_MINI_PROGRAM } from 'internal:constants'; |
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.
It seems these constants are not used.
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.
I just moved it from bellow lines. It's better to put constants at the beginning.
And they are used in this file, see
if (WECHAT || WECHAT_MINI_PROGRAM || BYTEDANCE) {
this.__isWebIOS14OrIPadOS14Env = (sys.os === OS.IOS || sys.os === OS.OSX) && GameGlobal?.isIOSHighPerformanceMode
&& /(OS 1((4\.[0-9])|(5\.[0-3])))|(Version\/1((4\.[0-9])|(5\.[0-3])))/.test(window.navigator.userAgent);
} else {
this.__isWebIOS14OrIPadOS14Env = (sys.os === OS.IOS || sys.os === OS.OSX) && systemInfo.isBrowser
&& /(OS 14)|(Version\/14)/.test(window.navigator.userAgent);
}
Re: #18056
Changelog
Continuous Integration
This pull request:
Compatibility Check
This pull request: