Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

feature: add an API that works on ASTs instead of pre-evaluated values

未关闭
#57 0 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
35/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
停滞
技术栈
javascript
领域
tooling

调研方向

首先检查 static-module 对预先求值的值的处理方式,以及它对作为 callbacks 的函数参数所采用的特殊情况,然后比较 issue 中提到的 static-eval 补丁。完成的标准是提供一个基于 AST 的 API 或选项,使 cwise 之类的项目能够选择性地求值原始值,并保留函数参数的 AST,以便使用 escodegen 进行字符串化。

由索引模型根据 Issue 内容生成。

描述

enhancement

static-eval doesn't support function expressions like the body option in:

cwise({
  body: () => {}
})

I think because of this patch https://github.com/substack/static-eval/pull/18

static-module has a special case for function arguments as callbacks:

readFile('xyz', function () {})

A possible solution may be to have a static-module option or a method like staticModule.ast that passes the parsed AST nodes to functions, instead of statically evaluated values. Projects like cwise could then use static-eval to selectively evaluate strings and other primitive types, and stringify the AST for function arguments using escodegen.

Originally posted by @goto-bus-stop in https://github.com/browserify/static-module/issues/48#issuecomment-443202592

主要语言
JavaScript
星标
75
派生
22
PR 合并指标
30 天内没有已合并 PR

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

browserify/static-module 的其他 Issue

查看 browserify/static-module 的全部 Issue

相似的 Issue

更多 JavaScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。