NativeScript / NativeScript/nativescript-cli

Add `console` command to open live REPL on running NativeScript application

Offen
#4,468 2 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

feature help wanted
Vorherrschende Sprache
JavaScript
Sterne
1.1k
Forks
204
Ø Merge
1 T. 9 Std.
Gemergte PRs (30 T.)
8

Beschreibung

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.

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginne mit den REPL-Tools von Node und dem bestehenden Befehl tns debug, der im Issue beschrieben ist. Definiere die Einstiegspunkte tns console ios und tns console android --device UUID, einschließlich sowohl des Startens als auch des Verbindens mit einer Anwendung. Als abgeschlossen gilt die Aufgabe, wenn lokal eingegebene Ausdrücke auf dem Gerät ausgewertet und ihre Ergebnisse im lokalen REPL ausgegeben werden.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
javascript, node.js
Bereich
cli, mobile-dev
Issue-Typ
Feature
Schwierigkeit
5/5
Geschätzter Aufwand
Über eine Woche
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
25/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.