-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Where is 'dart_sdk.js'? #46376
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
Comments
Look for this file in FWIW, I don't think dev compiler is intended for production usage. It is a development compiler after all, but I let @sigmundch comment on that. |
I believe the goal (if not already done) is to remove these files and have you compile them yourself, in order to make the shipped SDK smaller. In general the process for compiling and bootstrapping a JS app with dartdevc is undocumented, and not stable. It is recommended you use Note that if you use the |
Thanks for the answer folks!
The problem with dart2js is realy only one: it requireds a Do you think that what I am trying to achieve is not possible with Dart? That is the answer I am trying to find on various websites and I can't find. Yes, there is a lot about dart and javascript but only as web apps, but for libraries. |
The short answer is Dart does not generally support creating shared libraries for the web, no. Technically you can kind of sort of work your way around that with JS interop for some use cases, but it probably isn't a good solution for what you are trying to actually achieve. |
Thanks a lot @jakemac53, I think I will stop trying them. But would be amazing if dart could provide a way of doing it, right? |
I created another issue for that feature request: #46378 |
This has definitely come up before but I don't have a link handy. Ultimately, my personal opinion is that Dart is just simply not a good fit for this task, and I think that is likely why it hasn't been done yet. There are a lot of reasons it isn't a good fit, but mostly it comes down to the overhead of the Dart SDK itself, and the difficulties that you would face trying to overcome that. If you simply included the dart_sdk.js library (compiled by dartdevc), that is several megabytes in size on its own. Generally we rely on tree shaking, minification, and other mechanisms to get rid of some of this overhead, and also when you are talking about a full app the cost tends to get amortized. But none of those mechanisms really work well when you are talking about a library, for a few reasons:
|
Hello everyone! I am trying to create a POC on my company showing that Dart superpowers to javascript are reall awesome.
But I am really stuck =(
This is the sample class I want to create a library for usage on javascript evironment:
Then, I run the following command on it:
dartdevc -o lib/dart_js_poc.js lib/src/awesome.dart --modules es6
I am using es6 because I want this library to run on our React server.
Here comes the JS generated by the dart compiler:
The problem is on this line:
import { core, dart, dartx } from 'dart_sdk.js';
. Where is this file? Without it I can't use this library.Is this a bug on the compiler?
The text was updated successfully, but these errors were encountered: