Provide the raw specifier for the module fallback service
Fixes: https://github.com/cloudflare/workerd/issues/2112
I took a stab at testing this using a local build from this PR and I can confirm that the raw parameter works as expected.
I modified @dario-piotrowicz's app to test this. You can see my changes here: https://github.com/dario-piotrowicz/miniflare-ModuleFallbackService-demo/compare/main...IgorMinar:miniflare-ModuleFallbackService-demo:workerd-pr-2131-test?expand=1
Overall, while I succeeded in getting the fallback service to work, I had to hack around a lot and I don't have confidence that this will fly in the real world, without further changes in workerd. Specifically workerd's inability to support bare specifiers and specifiers ending with / seems troublesome - see my TODO(discuss) comments in the PR above.
Btw I do find raw as the param name to be too ambiguous and as you can see in my code, I resorted to calling the value rawSpecifier in my code — we should consider renaming it.
Interestingly, I found that workerd resolved specifier is still useful to detect when a redirect is needed, which implies that we actually need both the workerd-resolved specifier as well as the raw specifier. This surprised me, but it's likely a good news for us as we don't need to deprecate and remove the original specifier.
Let's discuss this a bit before this change is merged.
side note: I had to employ 301 redirects to get everything to work, but I think that is expected, as this is exactly why the fallback service supports the redirects at all.
btw I can't give you review on the c++ code as I'm not familiar with the code base, so my approval is simply just stating that from the external point of view the code does what we asked for it to do. It would be good to have someone from the runtime team to confirm the correctness of the implementation.
@fhanau @dom96 @garrettgu10 ... would like to get this landed soon to unblock @IgorMinar's team. Can I ask one of y'all to do a quick review on this?