fix: add support for non-root base-href
Description
if a web-app is deployed using --base-href=/path/to/deployed/flutter/app during build, the URLs starting with ./assets won't work anymore. Using assetManager will properly resolve them. It uses assetBase from the loader config specified here
NB :warning:
I only tested the url.startsWith('assets/') code path as it's the only one used in the library. It should work the same for ./ though
@holzgeist Please let me know if you're still gonna work on this change. Otherwise, I can commandeer it for you and take it to the finish line. Thanks.
Hi @diegotori ,
thanks for the feedback. I'm going to work on it, probably today, maybe tomorrow
@diegotori actually I need to solve some other issues before I have a working web-build to test this one. If you could commandeer this, it would be great, thanks :pray:
@holzgeist please verify the fixes made to this PR. I was able to do a bit of cleanup and/or fixes. Thanks.
@holzgeist If you have an angle on the latest no_sleep.js changes that I made, which now awaits for the web layer to enable the wakelock before considering it enabled, please feel free to review.
@ditman the above also applies to you as well, if you're able to review the JS changes that I made. Thanks.
@diegotori thanks for working on this. But unfortunately this grew way outside of my comfort zone wrt flutter/web so I have to pass on reviewing this :see_no_evil:
I left some comments, but I'm not an actual owner of the plugin, so please, take/ignore as you please from my comments.
Thanks for getting this fix over the finish line, and apologies for the delay in the review, it took me a long while to see this notification!
Thanks for reviewing this. Since you have a better handle on the JS side of things, I'll let you take point on what I should modify. Feel free to call out more things as you see them.
Hi there! I'm back to actively working on a flutter/web port of our app. Is there anything I can help with on this PR?
ok, thanks to @ditman 's super detailed review and suggestions I actually was able to understand everything that's going on and apply the suggestions (apart from testing). They definitely all look and feel like improvements, thanks again for the through review :pray:
@diegotori @ditman any thoughts?
@holzgeist I'll definitely take a look hopefully this week.
Thanks for your contributions thus far.
@holzgeist so far, it LGTM. @ditman, any thoughts on his changes?
I added a commit to prevent _nativeEnabledCompleter from being null in the catch branch. Since then I realized that I had two requests running in parallel which interfered with each other. I'll still leave the commit there because it doesn't hurt :)