kantord/emuto

idea: try testing generated code using a minifier

オープン

#339 opened on 2019/03/17

 (0 件のコメント) (0 件のリアクション) (0 人の担当者)JavaScript (8 件のフォーク)github user discovery
good first issue

Repository metrics

Stars
 (222 個のスター)
PR merge metrics
 (30d に merged PR はありません)

説明

As generating human-readable code is not a current aim, and we're quite far from having it anyway, it would make sense to generate a code that is already "minified". (i. e. cannot be reduced more by a minifier).

This might not be possible to achieve to 100% without implementing some complicated compiler logic (for example determining whether some parenthesis are needed). Implementing those should not be an aim in emuto, as we should try not to increase the compiler size, and if someone cares so much about the output being minified, they can still run a minifier on top of emuto.

As we already have a lot of code examples in interpreter.test.js, it would only make sense to utilize that test file to implement this, by adding a new test cases that uses a minifier internally to calculate what % of the output bytes were removed by the minified. The test should not fail the CI just yet, we'll get to actually improving the generated code after we have tests for it.

コントリビューターガイド