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

Web target with hash included in wasm pkg files to solve cache issues #2384

Open
Slixe opened this issue Nov 2, 2024 · 3 comments · May be fixed by #2387
Open

Web target with hash included in wasm pkg files to solve cache issues #2384

Slixe opened this issue Nov 2, 2024 · 3 comments · May be fixed by #2387
Labels
awaiting Waiting for responses, PR, further discussions, upstream release, etc enhancement New feature or request

Comments

@Slixe
Copy link

Slixe commented Nov 2, 2024

Is your feature request related to a problem? Please describe.
I have an web application using WebAssembly behind cloudflare, even if the cache is fully disabled, some browsers still keep the old WASM & js files when we do an update.

Describe the solution you'd like
Having a hash concatened to the filename for easier update would be better.

Describe alternatives you've considered
Doing by hand using a bash script. But I don't know where it's exactly loaded by flutter.

@Slixe Slixe added the enhancement New feature or request label Nov 2, 2024
@fzyzcjy
Copy link
Owner

fzyzcjy commented Nov 2, 2024

Looks reasonable! Looks like it is loaded in

final script = web.HTMLScriptElement()..src = '$root.js';
, loaded from https://github.com/fzyzcjy/flutter_rust_bridge/blob/master/frb_dart/lib/src/loader/_web.dart. It may not be too hard, and we even has some (pseudo) content hash computed in .

Feel free to PR for this! Alternatively, I may work on this feature request later.

@fzyzcjy fzyzcjy added the awaiting Waiting for responses, PR, further discussions, upstream release, etc label Nov 2, 2024
@Slixe Slixe linked a pull request Nov 2, 2024 that will close this issue
5 tasks
Copy link

stale bot commented Jan 2, 2025

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix This will not be worked on label Jan 2, 2025
@svr2kos2
Copy link

svr2kos2 commented Jan 7, 2025

I encountered this cache issue too and after following the discussion in PR #2387, I found the proposed solution is great but it might not be implemented immediately.
As a workaround, I’ve created my own temporary solution, I hope it can help someone.
master...svr2kos2:flutter_rust_bridge:master
In your pubspec.yaml, use the following configuration:

flutter_rust_bridge: 
    git:
      url: https://github.com/svr2kos2/flutter_rust_bridge
      path: frb_dart
      ref: d8d23f7

For CI, since I’m using GitLab, my build command looks like this:
flutter build web --release --build-number $CI_PIPELINE_IID
This approach allows me to avoid the cache problem for now while waiting for the official fix.

@stale stale bot removed the wontfix This will not be worked on label Jan 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting Waiting for responses, PR, further discussions, upstream release, etc enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants