NativeScript / NativeScript/nativescript-cli
Add `console` command to open live REPL on running NativeScript application
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 1.1k
- Forks
- 204
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 8
Description
Is your feature request related to a problem? Please describe.
A REPL is a developer's best friend. Sometimes you just want to play with the native JavaScript integration, or do a quick debug session without all the rigamarole of starting up a devtools session. There's nothing quite like it in terms of exploration.
Describe the solution you'd like
Add a console command that fires up a remote node REPL session to Read expressions from the local machine, Evaluate them on the device, and Print them on the local machine.
Build the app, load it onto a device, and startup a new REPL:
$ tns console ios
{N}> UIButton
[Function: UIButton]
{N}>
or attach to an existing process:
$ tns console android --device UUID
{N}> android.widget.Button
[Function: Button]
{N}> android.widget.Button
Describe alternatives you've considered
You can use the chrome devtools coupled with the the tns debug command. It just doesn't feel as breezy.
Additional context
Node comes with repl tools out of the box that give you pretty fine grained control over where evaluation happens, how completion and history are achieved, etc....
The only thing would be to implement the remote connection to the nativescript app.
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.
Research direction
Start with Node's REPL tools and the existing tns debug command described in the issue. Define the tns console ios and tns console android --device UUID entry points, including both launching and attaching to an application. Done means expressions entered locally are evaluated on the device and their results are printed in the local REPL.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, node.js
- Domain
- cli, mobile-dev
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100