-
-
Notifications
You must be signed in to change notification settings - Fork 309
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
Feat: Add dependency map #2476
base: dev/1.4
Are you sure you want to change the base?
Feat: Add dependency map #2476
Changes from 21 commits
c3b2aef
e82a3fc
ba86d40
880cb70
de6f83c
97a13a7
5d0f426
5e7d7ab
d10530b
8ca3c9c
98042c1
1130b13
94b7be4
f5a51b0
5bf17b3
f739fcf
8a9a2e2
8de27d3
a6eb435
ff7ca78
d79fd47
c534e51
5174b59
b54f336
6b1c196
9a413e6
4155cc1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -556,6 +556,8 @@ | |||||||||||||||||
_editorResourceConfig: EditorResourceConfig = Object.create(null); | ||||||||||||||||||
/** @internal */ | ||||||||||||||||||
_virtualPathMap: Record<string, string> = Object.create(null); | ||||||||||||||||||
/** @internal */ | ||||||||||||||||||
_dependencyMap: Record<string, { [key: string]: string }> = Object.create(null); | ||||||||||||||||||
|
||||||||||||||||||
/** | ||||||||||||||||||
* @internal | ||||||||||||||||||
|
@@ -593,6 +595,7 @@ | |||||||||||||||||
initVirtualResources(config: EditorResourceItem[]): void { | ||||||||||||||||||
config.forEach((element) => { | ||||||||||||||||||
this._virtualPathMap[element.virtualPath] = element.path; | ||||||||||||||||||
this._dependencyMap[element.virtualPath] = element.depndentAssets; | ||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What's the value of element.dependentAssets if asset has not dependentAssets. if it is undefined, still set? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done |
||||||||||||||||||
this._editorResourceConfig[element.id] = element; | ||||||||||||||||||
}); | ||||||||||||||||||
} | ||||||||||||||||||
|
@@ -631,7 +634,7 @@ | |||||||||||||||||
"g" | ||||||||||||||||||
); | ||||||||||||||||||
|
||||||||||||||||||
type EditorResourceItem = { virtualPath: string; path: string; type: string; id: string }; | ||||||||||||||||||
type EditorResourceItem = { virtualPath: string; path: string; type: string; id: string, depndentAssets: { [key: string]: string } }; | ||||||||||||||||||
Check failure on line 637 in packages/core/src/asset/ResourceManager.ts GitHub Actions / lint
|
||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Address ESLint’s formatting recommendations and fix the property name. Use multiline for readability, and correct the property name to Below is a suggested diff: - type EditorResourceItem = { virtualPath: string; path: string; type: string; id: string, depndentAssets: { [key: string]: string } };
+ type EditorResourceItem = {
+ virtualPath: string;
+ path: string;
+ type: string;
+ id: string;
+ dependentAssets: { [key: string]: string };
+ }; 📝 Committable suggestion
Suggested change
🧰 Tools🪛 eslint[error] 637-637: Replace (prettier/prettier) 🪛 GitHub Check: lint[failure] 637-637: There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||||||||||||||||||
type EditorResourceConfig = Record<string, EditorResourceItem>; | ||||||||||||||||||
type SubAssetPromiseCallbacks<T> = Record< | ||||||||||||||||||
// main asset url, ie. "https://***.glb" | ||||||||||||||||||
|
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.
Spelling mismatch in the key property
depndentAssets
.It appears the property name is missing an “e.” Renaming it to
dependentAssets
throughout the code helps with clarity and consistency, since “depndent” could be mistaken for a typographical error.Apply the following diff to rename the property:
📝 Committable suggestion
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.
done
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.
@johanzhu Great! Thanks for handling it. Let me know if there's anything else you need.
If you found this review helpful, would you consider giving us a shout-out on X?
Thank you for using CodeRabbit!