add tracking issue for TODO item (#14638)

* issue 14637

* issue 14640: animation module

* issue 14642: serialize deserialize hack

* issue 7519: pal/image

* issue 14643: dynamic inject

* mark as NOTE

* issue 14644: native only

* issue 7512: pal/fs
This commit is contained in:
PP
2023-03-23 16:42:46 +08:00
committed by GitHub
parent 0e9c26c216
commit e01ac3ee05
27 changed files with 50 additions and 16 deletions
+1
View File
@@ -31,6 +31,7 @@ interface EditorExtendsNode {
clear(): any;
getNode(uuid: string): any;
getNodes(): {[uuid: string]: any};
emit(name: string, ...args: any): void;
}
interface EditorExtendsPrefabUtils {
@@ -199,6 +199,7 @@ export class Impl {
renderData.initRenderDrawInfo(this._comp, RenderDrawInfoType.MODEL);
// TODO: MeshRenderData and RenderData are both sub class of BaseRenderData, here we weirdly use MeshRenderData as RenderData
// please fix the type @holycanvas
// issue: https://github.com/cocos/cocos-engine/issues/14637
this._comp._renderData = renderData as unknown as RenderData;
this._comp._renderData.material = this._comp.getMaterialInstance(0)!;// hack
}
+2
View File
@@ -181,9 +181,11 @@ export class UIMeshRenderer extends Component {
const renderData = MeshRenderData.add();
// TODO: here we weirdly use UIMeshRenderer as UIRenderer
// please fix the type @holycanvas
// issue: https://github.com/cocos/cocos-engine/issues/14637
renderData.initRenderDrawInfo(this as unknown as UIRenderer, RenderDrawInfoType.MODEL);
// TODO: MeshRenderData and RenderData are both sub class of BaseRenderData, here we weirdly use MeshRenderData as RenderData
// please fix the type @holycanvas
// issue: https://github.com/cocos/cocos-engine/issues/14637
this._renderData = renderData as unknown as RenderData;
this._renderData.material = this._modelComponent!.getMaterialInstance(index);
}
+2
View File
@@ -47,6 +47,7 @@ export class UIComponent extends Component {
public __preload () {
// TODO: UIComponent should not be assigned to UIMeshRenderer | UIRenderer @holycanvas
// workaround: mark this as any
// issue: https://github.com/cocos/cocos-engine/issues/14637
(this as any).node._uiProps.uiComp = this;
}
@@ -60,6 +61,7 @@ export class UIComponent extends Component {
public onDestroy () {
// TODO: UIComponent should not be assigned to UIMeshRenderer | UIRenderer @holycanvas
// workaround: mark this as any
// issue: https://github.com/cocos/cocos-engine/issues/14637
if ((this as any).node._uiProps.uiComp === this) {
(this as any).node._uiProps.uiComp = null;
}
+1 -3
View File
@@ -629,9 +629,7 @@ export class LODGroup extends Component {
*/
private _emitChangeNode (node: Node) {
if (EDITOR) {
// TODO: Property 'emit' does not exist on type 'EditorExtendsNode'.
// workaround: mark Node as any
(EditorExtends.Node as any).emit('change', node.uuid, node);
EditorExtends.Node.emit('change', node.uuid, node);
}
}
@@ -125,6 +125,7 @@ class BlendStateWriterInternal<P extends BlendingPropertyName> implements Runtim
} = this;
const weight = host.weight;
// TODO: please fix type here @Leslie Leigh
// Tracking issue: https://github.com/cocos/cocos-engine/issues/14640
propertyBlendState.blend(value as Readonly<Vec3> & Readonly<Quat>, weight);
}
}
+1
View File
@@ -318,6 +318,7 @@ const selectLerpFx = (() => {
return (from: T, to: T, ratio: number) => {
// TODO: `ValueType` class doesn't define lerp method
// please fix the type @Leslie Leigh
// Tracking issue: https://github.com/cocos/cocos-engine/issues/14640
(constructor as any).lerp(tempValue, from, to, ratio);
return tempValue;
};
+2 -1
View File
@@ -89,7 +89,8 @@ function makeCubicSplineValueConstructor<T> (
}
}
// TODO: This comparison appears to be unintentional because the types 'new () => T' and 'typeof Quat' have no overlap.
// TODO: This comparison appears to be unintentional because the types 'new () => T' and 'typeof Quat' have no overlap. @Lelie Leight
// Tracking issue: https://github.com/cocos/cocos-engine/issues/14640
if (ConstructorX as any === Quat) {
const lerp = CubicSplineValueClass.prototype.lerp;
CubicSplineValueClass.prototype.lerp = function (this: CubicSplineValueClass, to: CubicSplineValueClass, t: number, dt: number) {
+1
View File
@@ -181,6 +181,7 @@ export class DependUtil {
// TODO: json: any[] is not assigned to IFileData
// workaround: mark json as any
// issue: https://github.com/cocos/cocos-engine/issues/14642
if (Array.isArray(json) && (!(BUILD || isCompiledJson(json)) || !hasNativeDep(json as any))) {
out = {
deps: this._parseDepsFromJson(json),
+2 -4
View File
@@ -92,11 +92,9 @@ Object.defineProperty(imageAssetProto, '_nativeAsset', {
get () {
return this._nativeData;
},
// TODO: Property 'format' does not exist on type 'HTMLCanvasElement'
// set (value: ImageSource) {
set (value: any) {
set (value: ImageSource) {
if (!(value instanceof jsbWindow.HTMLElement) && !isImageBitmap(value)) {
value.format = value.format || this.format;
(value as IMemoryImageSource).format = (value as IMemoryImageSource).format || this.format;
}
this.reset(value);
},
+5 -5
View File
@@ -153,7 +153,7 @@ export interface IMemoryImageSource {
*/
export type ImageSource = HTMLCanvasElement | HTMLImageElement | IMemoryImageSource | ImageBitmap;
function isImageBitmap (imageSource: any): boolean {
function isImageBitmap (imageSource: any): imageSource is ImageBitmap {
return !!(sys.hasFeature(sys.Feature.IMAGE_BITMAP) && imageSource instanceof ImageBitmap);
}
@@ -580,8 +580,7 @@ export class ImageAsset extends Asset {
} else if (!(data instanceof HTMLElement)) {
// this._nativeData = Object.create(data);
this._nativeData = data;
// TODO: Property 'format' does not exist on type 'ImageBitmap'
this._format = (data as any).format;
this._format = data.format;
} else {
this._nativeData = data;
}
@@ -593,10 +592,11 @@ export class ImageAsset extends Asset {
this._setRawAsset('');
// JSB element should destroy native data.
// TODO: Property 'destroy' does not exist on type 'HTMLImageElement'.
// maybe we need a higher level implementation called `pal/image`, we provide `destroy` interface here.
// issue: https://github.com/cocos/cocos-engine/issues/14646
if (JSB) (this.data as any).destroy();
} else if (isImageBitmap(this.data)) {
// TODO: Property 'close' does not exist on type 'HTMLCanvasElement'
(this.data as any)?.close();
this.data?.close();
}
return super.destroy();
}
+2 -1
View File
@@ -50,7 +50,8 @@ export interface ITexture2DSerializeData {
}
texture2DProto._ctor = function () {
// TODO TODO: Property '_ctor' does not exist on type 'SimpleTexture'.
// TODO: Property '_ctor' does not exist on type 'SimpleTexture'.
// issue: https://github.com/cocos/cocos-engine/issues/14644
(SimpleTexture.prototype as any)._ctor.apply(this, arguments);
this._mipmaps = [];
};
+7 -1
View File
@@ -319,6 +319,7 @@ class CCObject implements EditorExtendableObject {
if (JSB) {
// TODO: `_destroy` method only implemented on native @dumganhar
// issue: https://github.com/cocos/cocos-engine/issues/14644
(this as any)._destroy();
}
@@ -373,6 +374,7 @@ class CCObject implements EditorExtendableObject {
return;
}
// TODO: '_onPreDestroy' should be define in CCObject class.
// issue: https://github.com/cocos/cocos-engine/issues/14643
((this as any)._onPreDestroy)?.();
if (!EDITOR || legacyCC.GAME_VIEW) {
@@ -380,6 +382,7 @@ class CCObject implements EditorExtendableObject {
*hasOwnProperty's detection cannot be passed.
*/
// TODO: `destruct` is only implemented on native @dumganhar
// issue: https://github.com/cocos/cocos-engine/issues/14644
if (JSB && (this as any).destruct) {
(this as any).destruct();
}
@@ -419,6 +422,7 @@ if (EDITOR || TEST) {
* @method realDestroyInEditor
* @private
* TODO: this is a dynamic inject method, should be define in class
* issue: https://github.com/cocos/cocos-engine/issues/14643
*/
(prototype as any).realDestroyInEditor = function () {
if (!(this._objFlags & Destroyed)) {
@@ -434,7 +438,7 @@ if (EDITOR || TEST) {
};
}
// TODO: `clearImmediate` method is only defined in NodeJS environment.
// NOTE: `clearImmediate` method is only defined in NodeJS environment.
declare const clearImmediate: (immediateId: number) => void;
if (EDITOR) {
js.value(CCObject, '_clearDeferredDestroyTimer', () => {
@@ -449,6 +453,7 @@ if (EDITOR) {
* @param {Boolean} exporting
* @return {object} the serialized json data object
* TODO: this is a dynamic inject method, should be define in class
* issue: https://github.com/cocos/cocos-engine/issues/14643
*/
(prototype as any)._serialize = null;
}
@@ -459,6 +464,7 @@ if (EDITOR) {
* @param {Object} data - the serialized json data
* @param {_Deserializer} ctx
* TODO: this is a dynamic inject method, should be define in class
* issue: https://github.com/cocos/cocos-engine/issues/14643
*/
(prototype as any)._deserialize = null;
+2 -1
View File
@@ -108,7 +108,8 @@ import type { Node } from '../../scene-graph';
// });
// }
// TODO: we mark node as type of any, because we access much of protected properties here.
// TODO: we mark node as type of any, because the properties we access are only implemented on native. @dumganhar
// issue: https://github.com/cocos/cocos-engine/issues/14644
// export function syncNodeValues (node: Node) {
export function syncNodeValues (node: any) {
const lpos = node._lpos;
@@ -51,4 +51,5 @@ export class EventAcceleration extends Event {
}
// TODO: this is an injected property, should be deprecated
// issue: https://github.com/cocos/cocos-engine/issues/14643
(Event as any).EventAcceleration = EventAcceleration;
@@ -94,4 +94,5 @@ export class EventKeyboard extends Event {
}
// TODO: this is an injected property, should be deprecated
// issue: https://github.com/cocos/cocos-engine/issues/14643
(Event as any).EventKeyboard = EventKeyboard;
+1
View File
@@ -379,4 +379,5 @@ export class EventMouse extends Event {
}
// TODO: this is an injected property, should be deprecated
// issue: https://github.com/cocos/cocos-engine/issues/14643
(Event as any).EventMouse = EventMouse;
+1
View File
@@ -247,4 +247,5 @@ export class EventTouch extends Event {
}
// TODO: this is an injected property, should be deprecated
// issue: https://github.com/cocos/cocos-engine/issues/14643
(Event as any).EventTouch = EventTouch;
+2
View File
@@ -134,6 +134,7 @@ Object.defineProperty(Camera, "standardExposureValue", {
enumerable: true,
get () {
// TODO: `getStandardExposureValue` only implemented on native platforms. @dumganhar
// issue: https://github.com/cocos/cocos-engine/issues/14644
return (Camera as any).getStandardExposureValue();
},
});
@@ -143,6 +144,7 @@ Object.defineProperty(Camera, "standardLightMeterScale", {
enumerable: true,
get () {
// TODO: `getStandardLightMeterScale` only implemented on native platforms. @dumganhar
// issue: https://github.com/cocos/cocos-engine/issues/14644
return (Camera as any).getStandardLightMeterScale();
},
});
+1
View File
@@ -360,6 +360,7 @@ class Component extends CCObject {
public destroy () {
if (EDITOR) {
// TODO: `_getDependComponent` is an injected method.
// issue: https://github.com/cocos/cocos-engine/issues/14643
const depend = (this.node as any)._getDependComponent(this);
if (depend.length > 0) {
errorID(3626,
+3
View File
@@ -84,6 +84,7 @@ export const TRANSFORM_ON = 1 << 0;
const Destroying = CCObject.Flags.Destroying;
// TODO: `_setTempFloatArray` is only implemented on Native platforms. @dumganhar
// issue: https://github.com/cocos/cocos-engine/issues/14644
(Node as any)._setTempFloatArray(_tempFloatArray.buffer);
function getConstructor<T>(typeOrClassName) {
@@ -381,6 +382,7 @@ nodeProto._registerIfAttached = !EDITOR ? undefined : function (this: Node, atta
for (let i = 0, len = children.length; i < len; ++i) {
const child = children[i];
// TODO: `_registerIfAttached` is an injected property.
// issue: https://github.com/cocos/cocos-engine/issues/14643
(child as any)._registerIfAttached(attached);
}
};
@@ -1285,6 +1287,7 @@ nodeProto._instantiate = function (cloned: Node, isSyncedNode: boolean) {
}
if (EDITOR && legacyCC.GAME_VIEW) {
// TODO: Property 'sync' does not exist on type 'PrefabInfo'.
// issue: https://github.com/cocos/cocos-engine/issues/14643
const syncing = newPrefabInfo && cloned === newPrefabInfo.root && (newPrefabInfo as any).sync;
if (!syncing) {
cloned.name += ' (Clone)';
+3
View File
@@ -1332,10 +1332,12 @@ export class Node extends CCObject implements ISchedulable, CustomSerializable {
if (!inCurrentSceneBefore && inCurrentSceneNow) {
// attached
// TODO: `_registerIfAttached` is injected property
// issue: https://github.com/cocos/cocos-engine/issues/14643
(this as any)._registerIfAttached!(true);
} else if (inCurrentSceneBefore && !inCurrentSceneNow) {
// detached
// TODO: `_registerIfAttached` is injected property
// issue: https://github.com/cocos/cocos-engine/issues/14643
(this as any)._registerIfAttached!(false);
}
@@ -1358,6 +1360,7 @@ export class Node extends CCObject implements ISchedulable, CustomSerializable {
const destroyByParent: boolean = (!!parent) && ((parent._objFlags & Destroying) !== 0);
if (!destroyByParent && EDITOR) {
// TODO: `_registerIfAttached` is injected property
// issue: https://github.com/cocos/cocos-engine/issues/14643
(this as any)._registerIfAttached!(false);
}
+1
View File
@@ -82,6 +82,7 @@ Object.defineProperty(sceneProto, 'renderScene', {
sceneProto._ctor = function () {
// TODO: Property '_ctor' does not exist on type 'Node'.
// issue: https://github.com/cocos/cocos-engine/issues/14644
(Node.prototype as any)._ctor.apply(this, arguments);
this._inited = false;
this._renderSceneInternal = null;
+1
View File
@@ -186,6 +186,7 @@ export class Scene extends Node {
if (EDITOR) {
// register all nodes to editor
// TODO: `_registerIfAttached` is injected property
// issue: https://github.com/cocos/cocos-engine/issues/14643
(this as any)._registerIfAttached!(active);
}
legacyCC.director._nodeActivator.activateNode(this, active);
@@ -354,6 +354,7 @@ class DeserializerPool extends js.Pool<_Deserializer> {
}
// TODO: this is should be a HACK, we've changed the method signature
// issue: https://github.com/cocos/cocos-engine/issues/14642
(DeserializerPool.prototype as any).get = function (
this: DeserializerPool,
details: Details,
@@ -793,6 +794,7 @@ class _Deserializer {
const attrs = CCClass.Attr.getClassAttrs(klass);
// TODO: `__values__` is injected property
// issue: https://github.com/cocos/cocos-engine/issues/14642
const props: string[] = (klass as any).__values__;
if (DEBUG && !props) {
error(`Unable to deserialize ${js.getClassName(klass)}. `
@@ -842,6 +844,7 @@ export function deserializeDynamic (data: SerializedData | CCON, details: Detail
// TODO: this should be a HACK, we've changed the method signature
// workaround: mark pool as type of any.
// issue: https://github.com/cocos/cocos-engine/issues/14642
const deserializer = (_Deserializer.pool as any).get(details, classFinder, reportMissingClass, customEnv, ignoreEditorOnly);
cclegacy.game._isCloning = true;
+1
View File
@@ -420,6 +420,7 @@ class MotionEvalRecord {
public rebind(bindContext: AnimationGraphBindingContext) {
// TODO: please fix type @Leslie Leigh
// Tracking issue: https://github.com/cocos/cocos-engine/issues/14640
const motionEval = this._motion[createEval]({
additive: false,
up: bindContext,
@@ -41,6 +41,7 @@ try {
if (ALIPAY) {
if (systemInfo.os === OS.IOS && !minigame.isDevTool) {
// TODO: use pal/fs
// issue: https://github.com/cocos/cocos-engine/issues/14647
const fs = my.getFileSystemManager();
const screenOrientation = JSON.parse(fs.readFileSync({
filePath: 'game.json',