It looks like we’re doing the same thing regarding loading a new level ( 2nd paragragh of my first post mentions the same loadSceneHierarchy and app.root.destroy as you do ).
As a user mainly using the editor to create scenes, I would prefer to use the name I give to the scene ( eg “MainMenu” or “GameOverScene” ).
For the GameJam, it actually took me a while to figure out what the number was that precedes .json and where to get it ( I wasn’t paying attention to whatever was in the browser url field, I was looking through all of the scene properties within the editor to try to find that number ).
I suppose this suggestion is more for people who want to quickly jump between scenes based on the name they gave to the scene.
This would effectively use SceneName to extract the number.json value and call loadSceneHierarchy in the background, and then use optionToDestroyExistingScene to call app.root.destroy on success ( a sort of handy built in wrapper ).
For the GameJam, I figured it would take about 5 minutes to code the switching between scenes logic - it ended up taking a lot longer to get it working ( searching on forums, googling, trying out loadSceneHierarchy and not being aware of how to get the number part ) so I’m hoping to make it easier for the next person.