Fix lodash import issue and enhance asset reimport metadata - #856
Open
doommm wants to merge 2 commits into
Open
Conversation
Requiring lodash's package root fails in the engine runtime while resolving asset and script dependencies. Import only findLast through its module entry point so NodeManager can keep locating referenced scene nodes without triggering the runtime load error.
Successful reimports returned the default AssetInfo payload, which omitted inheritance metadata. PinK uses the asset-change payload to replace cached AssetInfo and clear invalid state, so a valid asset could stay marked invalid until a full reload. Serialize reimport results with the shared Asset Tree data-key contract, including sub-assets, display names, and extends. This keeps the result compatible with asset-change without a follow-up queryAssetInfo request.
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.
This pull request makes several improvements to the asset management system by standardizing the way asset metadata fields are selected and serialized, ensuring consistency across the codebase. It introduces constants for commonly used sets of asset info keys, updates method signatures to use these constants, and adds a test to verify correct serialization during asset reimport. Additionally, it refactors a utility import in the node manager for clarity.
Asset metadata key management:
DEFAULT_ASSET_INFO_DATA_KEYSandASSET_TREE_INFO_DATA_KEYSconstants inquery.tsto standardize which metadata fields are included when querying or serializing asset information. These are now used throughout the asset management code.AssetQueryManager(queryAssetInfo,queryAssetInfoByUUID,queryAssetInfos,encodeAsset) to acceptreadonlyarrays of keys, defaulting to the new constants for consistency and type safety. [1] [2] [3] [4]Usage of standardized asset info keys:
queryAssetInfoandencodeAssetinasset.tsandoperation.tsto useASSET_TREE_INFO_DATA_KEYSinstead of hardcoding key arrays, ensuring all relevant metadata is included for asset tree operations. [1] [2] [3] [4]Testing improvements:
operation-filesystem-bridge.test.tsto verify thatreimportAssetserializes asset metadata using the correct contract (ASSET_TREE_INFO_DATA_KEYS). [1] [2] [3]Codebase cleanup:
lodashimport with a direct import offindLastfromlodashinnode.tsfor improved clarity and tree-shaking. [1] [2]