How to loading bundles from cdn?
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- javascript, react-native, webpack
- Domain
- build-system, mobile
Research direction
Start with the bundle command and the resolver in host-app/index.js, then compare the CDN URL with the working localhost resolver. Reproduce the load from host-app/src/screens/MiniAppScreen.js and verify whether the generated MiniApp.container.bundle is accessible and usable from jsDelivr; done means the MiniApp loads from the CDN.
Written by the indexing model from the issue text.
Description
Ask your Question
I followed your example, everything runs fine on localhost, but when I want to load bundle from cdn, it doesn't seem to work.
- I generated bundle by running command:
react-native webpack-bundle --entry-file=index.js --dev=false --platform='ios' --bundle-output ios/MiniApp.container.bundle - Bundle cdn:
https://cdn.jsdelivr.net/gh/tungnt93/test_bundle/MiniApp.container.bundle - host-app/index.js:
ScriptManager.shared.addResolver(async (scriptId, caller) => {
const resolveURL = Federated.createURLResolver({
containers: {
MiniApp: "https://cdn.jsdelivr.net/gh/tungnt93/test_bundle/[name][ext]"
},
});
const url = resolveURL(scriptId, caller);
if (url) {
return {
url,
query: {
platform: Platform.OS,
},
};
}
});
If i change containers to localhost, everything runs fine
const resolveURL = Federated.createURLResolver({
containers: {
MiniApp: "http://localhost:9000/[name][ext]"
},
});
This is the image of host-app/src/screens/MiniAppScreen.js when i load from cdn: https://i.imgur.com/cX3B1Ut.png
So I want to ask, is my bundle generating command correct? If so, does uploading it to jsdelivr work, or do i have to upload it to another cdn?
Thank you!
- Dominant language
- Java
- Stars
- 40
- Forks
- 23
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from callstack/super-app-example
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
callstack/super-app-example#9 · 7 comments ·
-
question
Difficulty 3/5 1-2 days Newbie friendliness 30/100
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
-
question
Difficulty 3/5 1-2 days Newbie friendliness 20/100
callstack/super-app-example#4 · 16 comments ·
All issues in callstack/super-app-example
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
infinispan/infinispan#18150 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
opensearch-project/k-NN#3597 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100