Replies: 2 comments 2 replies
-
|
See #1739 and https://deno.land/manual@v1.11.0/typescript/faqs#why-don#39t-you-support-language-service-plugins-or-transformer-plugins. Above that, I think we would only support what can be done with [import assertions(https://github.com/tc39/proposal-import-assertions). Now, having some sort of loader hooks for |
Beta Was this translation helpful? Give feedback.
2 replies
-
|
I guess another community ecosystem approach that could be taken would be similar to this: https://github.com/cevek/ttypescript However I really really dislike this pattern. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Objective: I'd love for Deno to provide a builtin solution to pluggable processing at build time. This would make it easier for tools like Protocol Buffers to integrate more seamlessly with the deno command line tooling without requiring additional steps.
I'm formulating in my mind a more formalized proposal but I wanted to brainstorm a bit with the community to see how this could evolve with more input. Here's some unorganized thinking I've done:
Registering Loaders
I think the best way to do this is using flags, for example:
deno run --loaders=path/to/loader1.ts,path/to/loader2.tsI thought about alternatives here, such as a config file, or a special
.loadersfolder but there's really no prior art to justify it, so it probably should be expressed as a flag.loader capabilities should be constrained by the declared permissions specified in the command for the intended entrypoint file.
It didn't seem feasible to have a runtime op that handled registration because I believe that would be evaluated too late in the process.
Loader Definitions
The model that esbuild uses for plugins could be adopted nearly identically, with a slight modification that I'd want to require a loader file to have a single default export which represents the loader that should be installed. Something like this:
And its usage would be:
Loader Execution
Loaders could be spawned off as separate WebWorker instances (or a single instance with all the loaders installed). There's at least 2 modes that need to be supported 1) The initial static resolving/loading of imports before execution begins, and 2) any dynamic calls to
import().Any other thoughts?
Beta Was this translation helpful? Give feedback.
All reactions