Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Proposal][WEB]: Ability to skip loading auto-generated manifest files. #104398

Open
luckydaemon opened this issue May 23, 2022 · 5 comments
Open
Labels
c: new feature Nothing broken; request for a new capability c: proposal A detailed proposal for a change to Flutter engine flutter/engine repository. See also e: labels. P3 Issues that are less important to the Flutter project platform-web Web applications specifically team-web Owned by Web platform team triaged-web Triaged by Web platform team

Comments

@luckydaemon
Copy link

I'm want to release my app as embedded web app on social network platform (namely VK.com). Theirs documentation says, that in order for my app to be visible in apps catalog for end users who uses iOS client of this platform, I have to prepare app as an ODR archive and I have problem running my app in this form. Unfortunately, I cannot access any debug information on their iOS client. Documentation says, that I should try to open app as local web page (without using any web server). In browser console I'm getting next error:

Access to XMLHttpRequest at 'file:///home/web/assets/FontManifest.json' from origin 'null' has been blocked by CORS policy: 
Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, chrome-untrusted, https.

And, I think that exact same error happens in platform client app.
Is there any way to change, how flutter loads its manifests on application start or maybe disable this function at all, so I can load any necessary assets some other way?
I saw this issue, but there is not much details about whats going on, and linked issue describes different use case.

@darshankawar darshankawar added the in triage Presently being triaged by the triage team label May 23, 2022
@darshankawar
Copy link
Member

Can you check if this helps ?

@darshankawar darshankawar added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label May 23, 2022
@luckydaemon
Copy link
Author

I think this is not exactly what is needed for me. It sure will help, but first, I need to overcome initialization step.
After I wrote this issue, I digged in a bit more and found out that flutter engine generates and tries to load FontManifest.json and AssetManifest.json even if I remove every asset and font from pubspec.yaml and code will contain single print() function (even without calling runApp()). The resulting json files are empty, but generated main.dart.js still tries to load them, and fails to do this due to CORS policy.
Also, I only now noticed that with flutter 3.0 there is now exist an option to customize web initialization with _flutter.loader JS API (for which I unfortunately cannot find any documentation). So now I'm preparing a test environment in virtual machine, to try out flutter 3.0 and maybe I can do something with initialization on this version.

@github-actions github-actions bot removed the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label May 23, 2022
@darshankawar darshankawar added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label May 23, 2022
@luckydaemon
Copy link
Author

So, I tried latest stable version of flutter, and, sadly, I don't see any way to affect engine initialization in web build and force it to skip loading of auto-generated manifest files (or at least I can't figure out how to do so). Can this be added as feature request? Not sure, what will be the best way to describe it, but maybe something like: "Ability to skip loading auto-generated manifest files, so developers will be able to manually register and load any necessary file after engine initialized"?

@github-actions github-actions bot removed the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label May 24, 2022
@darshankawar
Copy link
Member

Thanks for the update. Updating the issue title and will label as proposal and for further insights from the team.

@darshankawar darshankawar changed the title [WEB] Flutter web app startup problem when using ODR [Proposal][WEB]: Ability to skip loading auto-generated manifest files. May 24, 2022
@darshankawar darshankawar added platform-web Web applications specifically c: proposal A detailed proposal for a change to Flutter and removed in triage Presently being triaged by the triage team labels May 24, 2022
@yjbanov yjbanov added c: new feature Nothing broken; request for a new capability engine flutter/engine repository. See also e: labels. P3 Issues that are less important to the Flutter project labels May 28, 2022
@yjbanov
Copy link
Contributor

yjbanov commented May 28, 2022

Currently the engine makes certain assumption, which is probably something we should relax. I'll take it as a feature request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: new feature Nothing broken; request for a new capability c: proposal A detailed proposal for a change to Flutter engine flutter/engine repository. See also e: labels. P3 Issues that are less important to the Flutter project platform-web Web applications specifically team-web Owned by Web platform team triaged-web Triaged by Web platform team
Projects
None yet
Development

No branches or pull requests

4 participants