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

Retry-plugin cache-busting option #3507

Open
2 tasks done
DeveshSapkale opened this issue Feb 11, 2025 · 4 comments
Open
2 tasks done

Retry-plugin cache-busting option #3507

DeveshSapkale opened this issue Feb 11, 2025 · 4 comments

Comments

@DeveshSapkale
Copy link

Clear and concise description of the problem

I am using webpack host with dynamic remote loading using module federation runtime
Remote 1 webpack
Remote 2 vite

Retry-plugin's script option doesn't provide "cache busting" option.
If remote chunk is getting loaded from memory cache of browser and due to some reason (err_cahe_read_failure) happens and chunk load fails, retry plugin will keep retrying to get the chunk from memory cache which is not available or corrupted.

There should be an option in retry plugin where cache busting string can be provided.

Somewhat similar to
https://rsbuild.dev/plugins/list/plugin-assets-retry

@ScriptedAlchemy can you please tag someone who is actively working on this part or if you can provide some workaround?

Suggested solution

Somewhat similar to
https://rsbuild.dev/plugins/list/plugin-assets-retry

Alternative

No response

Additional context

No response

Validations

  • Read the Contributing Guidelines.
  • Check that there isn't already an issue that request the same feature to avoid creating a duplicate.
@danpeen
Copy link
Contributor

danpeen commented Feb 11, 2025

@DeveshSapkale Thank you! I'll take a look.

@DeveshSapkale
Copy link
Author

DeveshSapkale commented Feb 18, 2025

@danpeen did you got any time to have a look at above issue?
Currently I have used below package in case of webpack..
https://www.npmjs.com/package/webpack-retry-chunk-load-plugin

But this is bundler specific solution which is against MF v2. I also have vite based remotes and RSbuild based remotes, and this solution is not scalable.

Can we have something like this plugin (options like this plugin)
https://www.npmjs.com/package/webpack-retry-chunk-load-plugin

In MF retry plugin?
Fyi @ScriptedAlchemy

@ScriptedAlchemy
Copy link
Member

chunk retry depends on the underlaying bundler runtime. we can retry on the remoteEntry file, but if theres chunks in the remoteEntry file that fail - thats beyond the scope of federation and would be something the bundler runtime would need to support, we can do it in rspack/webpack - but vite - it would require implementation changes outside of our runtime since bundlers pass us a object of references to promises, not script urls that we manully inject,

button: ()=>Promise(someBundlerResponsibility)

and we just do await button() -

@danpeen
Copy link
Contributor

danpeen commented Feb 21, 2025

@DeveshSapkale Sorry, I have been very busy recently. I will take a look at this issue in the next two days. Sorry again, I appreciate your patience~

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants