Add queryNodeTree API and fix EditorExtends global aliasing#497
Merged
star-e merged 5 commits intococos:mainfrom Apr 21, 2026
Merged
Add queryNodeTree API and fix EditorExtends global aliasing#497star-e merged 5 commits intococos:mainfrom
star-e merged 5 commits intococos:mainfrom
Conversation
- Add queryNodeTree method to INodeService for querying the scene hierarchy tree in the format used by the hierarchy panel - Move PrefabState enum to common/node.ts as a shared type and use it in IPrefabStateInfo instead of plain number - Change isCustomComponent from async to sync since it only performs a synchronous Set.has() check - Add alias-editor-extends-global rollup plugin to inject EditorExtends global after the editorExtends IIFE in scene bundle
…onPolicy - Move PrefabState enum and IPrefabStateInfo interface from common/node.ts to common/prefab/prefab-info.ts where they belong - Fix OptimizationPolicy enum: AUTO=0, SINGLE_INSTANCE=1, MULTI_INSTANCE=2 (previously AUTO and SINGLE_INSTANCE were both 0) - Update imports in prefab/utils.ts to use common re-export
Add test cases covering: - Querying the full scene tree - Verifying returned node fields (name, active, locked, type, etc.) - Querying a subtree by path - Querying a non-existent path returns null - Component info includes type, isCustom, value, and extends
bofeng-song
approved these changes
Apr 20, 2026
star-e
approved these changes
Apr 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
queryNodeTreemethod toINodeServicefor querying the scene hierarchy tree in the format used by the hierarchy panelPrefabStateenum tocommon/node.tsas a shared type and use it inIPrefabStateInfoinstead of plainnumberisCustomComponentfrom async to sync since it only performs a synchronousSet.has()checkalias-editor-extends-globalrollup plugin to injectEditorExtendsglobal after theeditorExtendsIIFE in scene bundleTest plan
queryNodeTreereturns correct hierarchy for an opened scenequeryNodeTreewithpathparameter returns the correct subtreeisCustomComponentworks correctly after async-to-sync changeEditorExtendsis accessible in the built scene bundle