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 摘要。