anthonychu / azure-functions-deno-worker

Run Deno 🦕 on Azure Functions ⚡️
MIT License
110 stars 17 forks source link

Bundle cache files for dynamic imported modules #11

Closed horihiro closed 4 years ago

horihiro commented 4 years ago

According to this issue https://github.com/denoland/deno/issues/6156, the module files which is imported with variables dynamically are not bundled.

This PR creates cache files in /PATH/TO/WORK_DIR/.cache and bundle the cache into package file.

This cache bundling can aoid cold start by this PR https://github.com/anthonychu/azure-functions-deno-template/pull/1, I re-opened.

Please look into this.

anthonychu commented 4 years ago

Thanks @horihiro. This is an interesting approach to this problem but I feel it's hacky and depends on internal caching behavior in Deno that can change in future versions.

I don't think dynamically including functions is needed at this time. If we add support for it one day, I'd like to do it without using the cache. I like the idea of deploying a single bundled JS file.

In the future, it may be better to discuss in an issue before submitting a PR. I appreciate your interest and effort though!

horihiro commented 4 years ago

Thanks @anthonychu for your comment.

As you wrote, the bundling issue should be resolved by Deno side.

I close this.