-
Notifications
You must be signed in to change notification settings - Fork 13
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
Debug index.worker.js #10
Comments
Sorry for my absence, my work and freelances was making me crazy. Runnning on Android you should be able to debug by enabling the debug mode with a shake as usual. On iOS since all modules are "singletons", if you enable debug mode for one, it will enable for the worker. |
hi... is it true if i want to change my code on worker then i must re-run this script: |
if it is in debug mode, you should be able to reload the code using "Reload" in the shake menu. |
wow...great info for me... my application have realm database... when i put this code my goal with this worker is check to my realm database |
I don't like to give bad news, but... On Android you need to add the RealmPackage using RNWorker.Builder and you should not load the realm package in your main bundle. final RNWorker worker = new RNWorker.Builder(this, false)
.entryPoint(RNWorker.DEFAULT_JS_ENTRY_POINT)
.bundleAsset(RNWorker.DEFAULT_JS_BUNDLE_ASSET)
.port(8088) //Realm already use 8082 to load a nano server to connect to chrome debug
.packages(
new RealmReactPackage()
).build(); |
so the conclusion i can query from worker "ON ANDROID", but its unstable... finally thanks for the information... you have any advice to run background service like case that i faced? |
No, sorry :( In my project I was even considering using native realm instead of realm-js because of the chrome debug performance. |
@fabriciovergal, is this caused by the realmjs requirement for the tx to be sourced from the main thread? |
Actually I could not find exactly why its not work. On iOS was even more problematic, because I could not found a way to keep the main bundle with debug mode on and the worker with debug mode off, because this settings is managed by a singleton object. And with it, come the chrome debug performance issue. |
Yes, that chrome debugging perf makes it almost unusable. |
Great library! |
Hi Fabricio, would u share how i can query my react native DB with native realm on android and ios.. |
@apuyapuy, before I switched earlier this year, realmdb didn't support cross-thread access in realmjs. |
big thanks, this is a nice componen... its really help me to create a background service...
every time i want to test my index.worker.js using this script :
node node_modules/react-native/local-cli/cli.js start --reset-cache
node node_modules/react-native/local-cli/cli.js start --port 8082 --reset-cache
concurrently --kill-others "npm run start-app" "npm run start-worker"
adb reverse tcp:8081 tcp:8081 && adb reverse tcp:8082 tcp:8082
node node_modules/react-native/local-cli/cli.js bundle --dev false --assets-dest ./android/app/src/main/res/ --entry-file index.android.js --platform android --bundle-output ./android/app/src/main/assets/index.android.bundle --sourcemap-output ./sourcemap/android.main.map
node node_modules/react-native/local-cli/cli.js bundle --dev false --assets-dest ./android/app/src/main/res/ --entry-file index.worker.js --platform android --bundle-output ./android/app/src/main/assets/index.worker.bundle --sourcemap-output ./sourcemap/android.worker.map
npm run bundle-app-android && npm run bundle-worker-android
concurrently --kill-others "npm run bundle-ios" "run bundle-android\
but i can not debug...
can u give me the tutorial to debug my index.worker.js file?
thanks in advanced
The text was updated successfully, but these errors were encountered: