Closed Sway007 closed 1 week ago
The changes involve a modification to the getResourceByRef
method in the ResourceManager
class located in ResourceManager.ts
. The method's implementation has been updated to set the url
directly to resourceConfig.virtualPath
, with the key
being appended as a query parameter if provided. This alters the way resources are fetched by changing the URL structure used for loading resources. The rest of the method's logic remains unchanged.
File | Change Summary |
---|---|
packages/core/src/asset/ResourceManager.ts | Updated getResourceByRef method to set url directly from resourceConfig.virtualPath and append key as a query parameter if provided. |
tests/src/core/resource/ResourceManager.test.ts | Added new test suite for "gltf subAsset load" with a test case for handling invalid query parameters in asset URLs. |
sequenceDiagram
participant Client
participant ResourceManager
Client->>ResourceManager: getResourceByRef(ref)
ResourceManager->>ResourceManager: construct url
ResourceManager-->>Client: return resource (possibly cloned)
MaterialLoader
class involve the use of resourceManager.getResourceByRef
, which directly relates to the modifications made to the getResourceByRef
method in the ResourceManager
class, indicating a connection in how resources are fetched.🐇 "In the code where the resources play,
A rabbit hops in a brand new way.
With paths now clear and logic refined,
The treasures of code are easier to find!
So let’s all cheer and give a shout,
For the changes that make the code sprout!" 🐇
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Attention: Patch coverage is 33.33333%
with 2 lines
in your changes missing coverage. Please review.
Project coverage is 69.43%. Comparing base (
7da32a5
) to head (c76cba5
).
Files with missing lines | Patch % | Lines |
---|---|---|
packages/core/src/asset/ResourceManager.ts | 33.33% | 2 Missing :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Please check if the PR fulfills these requirements
What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
What is the current behavior? (You can also link to an open issue here)
What is the new behavior (if this is a feature change)?
Does this PR introduce a breaking change? (What changes might users need to make in their application due to this PR?)
Other information:
Summary by CodeRabbit
Bug Fixes
Refactor
getResourceByRef
method for improved resource fetching, simplifying the URL construction process when loading resources.