Comments (12)
If you need someone with React Native and Expo experience to help with this feel free to email me at adrian at g2i dot co
I'm good friends with the Expo team :)
from console-ninja.
I'd choose the paid version if it had support for React Native. 🥲
from console-ninja.
hello! i work on expo. feel free to email me at brent at expo dot dev if you have any questions about how to integrate
from console-ninja.
Console Ninja won't work when running on iPhone / Android (it only connects to your localhost right now)
@smcenlly is there any plans to add support for that?
I think many react-native projects are targeting only Android/iOS as platforms. And I (as a react-native developer) would love to see support for Android/iOS.
Anyway, the project is really great and I can only wish you the success in the development of this plugin 😊
from console-ninja.
We tried Console Ninja on a fresh expo
project, using npm run web
and it worked for us without needing to do anything special.
Console Ninja won't work when running on iPhone / Android (it only connects to your localhost right now), but it should work when running using the web version.
If it's not working for you, please create a new issue and provide us with steps to reproduce your problem.
from console-ninja.
@kirillzyusko - I don't expect we'd be able to target Android/iOS as runtime platforms any time soon. There will likely be some network isolation problems as well as possibly some runtime problems.
I'll re-open this issue and change the title to be more explicity about Android and iOS since browser runtime for expo/react-native is supported.
from console-ninja.
If you're modifying environment for local development somehow, then react-native provides a way how to remove "development only" code in production builds. You can use:
if (__DEV__) {
// ... your code
}
or if you are modifying env via babel plugin, then you can use process.env.BABEL_ENV === "production"
check.
from console-ninja.
@smcenlly sorry for a long response! Sure, I will share. We did it only for Android, but I think a similar approach could be applied to iOS too.
Basically we've opened logcat
process in NodeJS script:
const { spawn } = require("child_process");
const child = spawn("adb", ["logcat"]);
And we added a listener to stdout
:
child.stdout.on("data", (data) => {
const output = data.toString();
});
Every new log will emit a new event. It will look like:
01-20 20:44:18.525 25066 25124 I ReactNativeJS: TAG: 1083
ReactNativeJS
means that it has been logged by JS side of react-native. In my case the output above has been generated by next code in JS:
const tag = findNodeHandle(ref.current);
console.log('TAG: ' + tag);
Using simple transformation you can split up only part that has been logged by JS:
if (output.includes("ReactNativeJS")) {
const jsOutput = output.split(" ")... // take the output from 6-index and concat with remaining part of array, but it can be optimised through regular expression
}
That's how we gathered data from console.log
statements. Do you think it will be possible to use a similar approach in console-ninja
?
from console-ninja.
Our app on the simulator is logging into VS Code via react-native-logs, and it's running watchman for file changes. There must be something you can do!
from console-ninja.
@smcenlly got it. Do you have any architecture docs on how your plugin works?
I'm asking because in the past I had a need to capture console.log
statements in android app (we had kind of performance benchmarks and we measured startup metrics). Once they've been captured we've sent them as HTML report to GitLab comments.
Just thought that maybe the same mechanism (or partially) can be used in console-ninja
plugin?
from console-ninja.
@smcenlly got it. Do you have any architecture docs on how your plugin works?
Unfortunately, we don't have anything public we can share.
--
If you're able to share a sample of how you've sent console.log
statements from Android/iOS runtime to a remote system, that could definitely help.
from console-ninja.
Thanks for the details. Unfortunately we're not very familiar with react-native development so we'll need to set it up and try what you've suggested to make sense of the details you've provided.
The key concern that we have is that right now, Console Ninja has no side-effects on your application/code unless it's running locally. If we were to modify your react-native runtime on a separate device, we may not have a mechanism to know it's running in localhost/dev mode. Probably just that we're not familiar with react-native, hopefully such a mechanism already exists that we could check.
from console-ninja.
Related Issues (20)
- [Feature]: Add a setting to launch console ninja when VSCode is opened HOT 6
- [Bug]: console.time() bug in Chrome with Live Preview HOT 2
- [Bug]: rt.toLowerCase is not a function with Next.js 14.2.1 HOT 1
- [Feature]: Neovim support for Console Ninja HOT 1
- [Bug]: Console Ninja including message to STDOUT for Serverless commands HOT 3
- [Feature]: Remove log message from browser console about connection status HOT 1
- [Bug]: TypeError: Cannot read properties of undefined (reading 'fetchStack') HOT 1
- [Feature]: Warn when Next.js is started with turbo pack HOT 3
- [Bug]: Vue error: "VueCompilerError: Element is missing end tag" HOT 8
- Facing security error while running command on node application HOT 2
- [Bug]: Console Ninja breaks debug console HOT 3
- [Bug]: Ninja Artefacts in Committed Source Code HOT 2
- [Bug]: ConsoleNinja doesn't work with Remix HOT 2
- [Bug]: Console Ninja disconnects in SPFx solution HOT 4
- [Feature]: Support Svelte 5 snippets and native TypeScript HOT 1
- [Feature]: Sublime Text Support HOT 1
- [Bug]: Console Ninja is not connecting to a running instance of an Angular project after latest update HOT 1
- [Feature]: Copy object or field from VALUES HOT 1
- [Feature]: Make copying the array length optional
- [Feature]: Support for Shopify CLI HOT 1
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 console-ninja.