You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With refactored DenoDir flow for obtaining compiled modules looks much better but still it's not perfect.
Namely: for all modules TsCompiler.compile_async is called and it short-circuits for non-TS files. Additionally there's SourceFile.js_source() function that shouldn't exist on SourceFile.
Solution proposal:
change return type of TsCompiler.compile_async to CompiledModule returning only URL and compiled code
introduce JsCompiler and JsonCompiler structs. First one would be pass-through and second one would wrap JSON file source code into default export (see:
each compiler registers what file extensions/content type it can compile - NOTE: in case of JS files we might use either JsCompiler or TsCompiler depending on the settings (this will be referenced in separate issue)
The text was updated successfully, but these errors were encountered:
I think we should return
CompiledModule
fromfetch_source_file_and_maybe_compile_async
:It'd be made from:
Originally posted by @bartlomieju in https://github.com/_render_node/MDExOlB1bGxSZXF1ZXN0Mjk2NzUxMTk3/timeline/more_items
Additionally:
#2636 (comment)
With refactored
DenoDir
flow for obtaining compiled modules looks much better but still it's not perfect.Namely: for all modules
TsCompiler.compile_async
is called and it short-circuits for non-TS files. Additionally there'sSourceFile.js_source()
function that shouldn't exist onSourceFile
.Solution proposal:
TsCompiler.compile_async
toCompiledModule
returning only URL and compiled codeJsCompiler
andJsonCompiler
structs. First one would be pass-through and second one would wrap JSON file source code into default export (see:deno/cli/deno_dir.rs
Lines 43 to 62 in ac98bd8
The text was updated successfully, but these errors were encountered: