OpenFn / core

The central job processing module used in OpenFn v1.

Home Page:https://www.openfn.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Use compiler in execute command

stuartc opened this issue · comments

Currently the execute command on Diesl does not use the compiler.
The command is also only used during development flows, and so has been
safely ignored for now.

Execute is extremely useful as it has no static dependency tracking - sacrificing safety for ease of use.

There appears to be a happy middle ground, by dropping doclets from the compile step.
We can achieve a similar level of safety by introspecting the language pack module for exports
during compile, and then detect call expressions in the user expression using the scope lookup facility in ast-types and esprima.

The compile step has become a little cumbersome to work with, and efforts to align execute and compile will go a long way in bringing developing and testing expressions and language packs closer to how production executes them.