Fix resource paths containing hash characters#8581
Fix resource paths containing hash characters#8581adamsardo wants to merge 3 commits into4ian:masterfrom
Conversation
|
CI note after the first Semaphore run: the failed jobs are not pointing at the resource-loader changes in this PR. The red Semaphore jobs fail while parsing generated
This is the same class of generated-
The broader point of this PR versus the older editor-only attempt is that it encodes local paths both where the Electron editor resolves local files and where the GDJS runtime builds resource URLs for preview/exported games. That should cover the maintainer question from #8393 about previewed projects and exported games. Local checks still pass:
|
|
Follow-up on CI: Travis found a real test-environment gap from this PR. I pushed Also rechecked:
|
|
Travis is now green on
The focused local checks for the PR change still pass under Node 16, including the suites Travis previously failed on. |
|
Added a focused regression test in mise x node@16 -- npm test -- --runTestsByPath src/ResourcesLoader/index.spec.js --watchAll=falseThe test asserts that a local project/resource path containing Current local validation on the latest branch:
CI note: Semaphore fast tests are red again, but the public Semaphore page for the latest run does not expose detailed logs without sign-in. The earlier visible Semaphore failure on this PR was the generated |
Summary
pathToFileURL, so#, spaces, and non-ASCII path characters are encoded before<img>/Pixi see them.#is not interpreted as a fragment in exported games or in-game preview.Fixes #4015.
Checks
git diff --checknpx --yes prettier@1.15.3 --list-different newIDE/app/src/ResourcesLoader/index.jsnpx --yes prettier@3.4.2 --list-different GDJS/Runtime/ResourceLoader.tsGame Jam #1/Parts/hero.png->Game%20Jam%20%231/Parts/hero.pngandpathToFileURLoutput for local paths with#.