-
Notifications
You must be signed in to change notification settings - Fork 12.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
createProgram: provide file content with file objects independent of fs access - I. e. for Meteor Build System #4382
Comments
|
Simply replacing the host when instantiating a service should usually suffice, but failing that, assigning |
I would consider replacement of |
Thanks @vladima! |
If all you need is transpilation without diagnostics on inter-file dependencies, check out the transpile functionality. If you need more (you mentioned incremental builds and diagnostics) then I think you should use the language service instead. I used the language service to build something like what you're talking about for webpack, and while it has a lot of webpack-specific stuff it may help guide you. In particular take a look at the getScriptSnapshot implementation which answers your initial question about loading from memory. |
Exactly, a simple transpile would defeat the purpose of compile assurance :) Since the meteor build system plays the role of the file watcher, starting and killing the process at will, I'd need to check how to translate that into some cache layer. |
looks like the original issue has been handled. please reopen if this is not the case. |
Hi @D1no, I have the same needs as yours. |
To enable meteor developers the use of TypeScript in meteor packages and application code, we are currently working on a compiler plugin that needs to integrate into the meteor specific build system.
_note: the 9th most stared Github repo, before ruby/rails, is the meteor js framework
The problem is that the meteor build system instruments a caching and bundling system that obfuscates access to the file system, which seems to challenge the fs and typescript api coupling.
I. e. during meteor build an [1]array of input file objects that each incl. filename, -path, -hash and -content (data) properties is passed to the compile plugin (here typescript) and expected to be returned as [2]transpiled content via a method handler. Without touching the file-system.
Analog to the "A minimal compiler" API example, it seems to be easy to cover [2] by providing a custom
compileHandler: ts.WriteFileCallback
intoprogram.emit(undefined, compileHandler)
to pass the transpiled content back upstream.But can [1] lead to a full
Program
instance without providing fs-access just with "virtual" file paths and file contents?ts.createProgram
accept file objects that encapsulate file properties such as content etc. to make the compiler file-system agnostic.Any given advice to prevent redundant disk access while maintaining source maps, incremental builds and diagnostics inside this build chain?
The text was updated successfully, but these errors were encountered: