NativeScript / NativeScript/nativescript-cli

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

未關閉
#4,468 2 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

feature help wanted
主要語言
JavaScript
星號
1.1k
分支
204
平均合併
1 天 9 小時
30 天內合併 PR
8

描述

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.

貢獻指南

開啟貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

研究方向

從 Node 的 REPL 工具和 issue 中描述的現有 tns debug 命令開始。定義 tns console iostns console android --device UUID 進入點,包括啟動應用程式和附加至應用程式。完成標準是:在本機輸入的運算式會在裝置上求值,且其結果會輸出到本機 REPL 中。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
javascript, node.js
領域
cli, mobile-dev
Issue 類型
功能
難度
5/5
預估耗時
一週以上
活躍度
停滯
描述清晰度
基本清楚
新手友好度
25/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。