#2922 In-Process ES Compilation

SlimerDude Sun 23 Jun

I've recently been doing a lot of work on a new LSP (and on an update to F4). In both cases it is a struggle to incorporate ES Compilation.

It stems from having one long running Fantom process (the LSP or F4 IDE) that needs to compile Fantom code without loading the dependencies of the compiling code into memory.

The problem is in:

  • JsPod.writeRequire() which uses
  • Pod.flattenDepends() which uses
  • Pod.find()

It's a problem because Pod.find() uses the current Fantom Env to find and load dependant pods - which will either not exist or be of the wrong version (to the currently executing Fantom Env).

The rest of the (non ES) compilation steps do not use Pod.find(), but instead use the CNamespace provided in the CompilerInput to look up Pods.

The ask: Could JsPod.writeRequire() be updated to use its own special version of Pod.flattenDepends() that uses CNamespace and not Pod.find()?

(Note: JsPod also calls Pod.find() directly itself.)

matthew Tue 25 Jun

I can take a look at this.

matthew Tue 25 Jun

I pushed an update for this

SlimerDude Tue 25 Jun

Oh wow - that was quick. Thank you!

Login or Signup to reply.