Comments (13)
You have a few options here, all of which are documented in AppDelegate.m:
- Run the server on your computer, change
localhost
to<your computer's IP>
, and do it that way. cURL
the file and change it so it references the saved file. You'll have to add the downloaded file to the app binary.
Hope that helps. If you have any trouble, just post here and hopefully we can get that sorted for you.
from react-native.
@a2 is there any plan to streamline the process?
from react-native.
@vjeux Most definitely. We plan on putting in some sort of build step that "compiles" the JS source directly into a resource file in the app bundle. Obviously in production you wouldn't have a server running nearby.
from react-native.
For App Store submission, perhaps you have no choice but to include the JS in the bundle if you wish to comply with 2.7 ("Apps that download code in any way or form will be rejected").
from react-native.
Yes, we're not looking to download code over the internet for exactly the reason you mention. The Facebook Groups app in the store bundles all of the JS locally.
from react-native.
+1 for better way
from react-native.
This should at least be documented on the website -- I'm sure it's going to confuse a lot of people initally until updated. (react native rules!)
from react-native.
Under option 2).
Where exactly is the 'main.jsbunle' meant to be saved.
Have tried.
- top level.
- inside "AwesomeProject.xcodeproj"
"You'll have to add the downloaded file to the app binary":
Where is this? :)
from react-native.
@freshteapot - check this issue out: #240
from react-native.
- Not the best approach, Issue #240 is clearer, however either approach requires you to run this everytime you want to see your changes. A trade off :) *
To answer my own question:
"You'll have to add the downloaded file to the app binary":
Open Xcode -> Project (I will assume AwesomeProject)
Look in the folder Products, click "once" on 'AwesomeProject.app', look on the rightside and it should display "Full Path".
At this point, jump to the terminal, and navigate to the same directory.
Afterwards.
cd FULL_PATH
curl http://localhost:8081/index.ios.bundle -o main.jsbundle
Now at this point. You could do
curl http://localhost:8081/index.ios.bundle -o FULL_PATH/main.jsbundle
At this point, it works. At least on xcode 6.2.
from react-native.
@brentvatne thank you!
from react-native.
@freshteapot Thanks, It works~
from react-native.
Now possible
from react-native.
Related Issues (20)
- Error: package com.facebook.react.modules.storage does not exist import com.facebook.react.modules.storage HOT 4
- Heap snapshot throwing `RangeError: Invalid typed array length: -1` on latest chrome version HOT 8
- ☂️ Help us migrate Android tests to AssertJ HOT 23
- Accessibility issue - Android with TalkBack - accessibilityRole="link" is not available when user tries to navigate via links (TalkBack menu)
- App Crash when using ReactNativeFile in apollo upload client HOT 4
- createBundleReleaseJsAndAssets\index.android.bundle:1322:18: warning: the variable "DebuggerInternal" was not declared in function "__shouldPauseOnThrow" typeof DebuggerInternal !== 'undefined' HOT 7
- automaticallyAdjustKeyboardInsets doesn't work in the new arch HOT 2
- App Crashes - On upgrading to Android 14(SDK 34) for "react-native": "0.68.2", HOT 4
- No hot reloading when change font scale
- react-native 0.74.3 new project sync error HOT 3
- Codegen: Int32 generate double on Java HOT 2
- Issue with Top Padding in Text Component on Android (includeFontPadding : false not working🥹) HOT 5
- RTL Layout Direction Not Updating after app reload with New React Native Architecture HOT 10
- Unable to handle hardware back press in Brownfield Setup with BackHandler HOT 5
- App could not Build when trying upgrade sdk 33 to 34 HOT 4
- App could not Build when trying upgrade sdk 33 to 34 (Unexpected error during link, AAPT2 aapt2-4.2.2-7147631-linux Daemon) HOT 4
- react native android crashed in the real device when target API level is changed from 33 to 34. HOT 7
- Upgrade pretty-format to 29 HOT 2
- What is the future of Headless JS? HOT 6
- The react-native environment calls null as a function if it's passed in the finally block HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-native.