-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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
[Discussion] Best way to provide JavaScript builds with Deno #4298
Comments
CC @kitsonk |
We are ignoring an error in the TypeScript compiler which is protecting possibly overwriting the source, which we do all the time in the internal of Deno. I am not totally sure it is an error, though we need to surface up what is there, because even if What happens when you set |
|
So I don't think this is a bug in functionality, but needs better error messages instead of the obscure emit skipped. |
Writing it down while it is on my mind. Currently we squash a whole set of errors from the TypeScript compiler that cover over things that aren't relevant in the Deno runtime, but |
Not sure about a different set of errors, but definitely more clearer ones. It might be the moment to discuss something that's been bugging me for a while. Renaming |
Like what? |
If compilation through Deno becomes a feature inside the program a rename would be necessary, to not mention the fact that this is not compiling at all Also, |
Transpile, to me, means to convert from one syntax to another.
|
In the most traditional meaning of the word, a compile process realizes both transpiling and bundling to deliver one single target(binary or not) Deno compile doesn't really works by itself currently since it can't erase references to other modules in the spirit of not breaking anything. And Deno bundle doesn't make any real sintax transpilation other than converting module references to embedded code. Deno compile should do both. Since current behavior doesn't actually deliver a functional output into say ES3. |
Is there a sensible way to merge them both into |
I see no use case on Bundling without specyfing a target runtime. Thumbs up for unification. Edit: Perhaps to bundle or not might be an option inside |
So is
|
My biggest concern about combining |
I do consider that Deno.compile provides more value than just resources to work on top of Deno.bundle, however Deno.bundle seems to have no place when we are talking about compilation, since it should be achieved in the same step or simply skipped if the target is not a single file.
Consistency is important, but oversimplify the operations behind this commands only diminishes the worth they might have. Deno Commands such as those should translate into one or more operations that resemble what we are trying to achieve manually here, and not expect the user to make manual scripts for building their projects unless they require a really specific setting. Without leading into magic territory, to resolve an app structure and produce and efficient build should be no manual task |
You gotta forgive my ignorance in this matter. I don't know if TypeScript compiler is the one producing the final standalone build or how much is Deno playing with it to allow us to do so. |
So a bit of clarity what happens... First some terminology:
Now the different ways these work together:
|
If merging the API's is such a hassle then probably we shouldn't do that, but rather provide a simplified version (maybe named differently and treat Edit: I'm up for this, but vote for leaving this inside the Deno core and not std. |
@kitsonk In the meanwhile, some problems regarding the |
This was resolved in Deno 1.5.1. |
Deno version: 0.35.0
Trying to compile a
.js
file results inUncaught Error: Unexpected skip of the emit.
Attempting the following
./app.js
./compile_app.js
Results in:
Quite probably because the resulting filename matches the original filename, however since
Deno.compile
does not write anything into the filesystem this should not be a problem.Same thing happens when attempting to compile a JS and TS file named the same on the same route. Ex:
mod.js
&mod.ts
,The text was updated successfully, but these errors were encountered: