dart-pad
dart-pad copied to clipboard
Support for `dart:web_gl`
I cannot remember if we've discussed this particular library or not over the last few months, but I got a question from @slightfoot about whether we could support dart:web_gl
. He's been doing some incredible 3D demos of late, so it'd be cool if we could host them here.
The dart:web_gl
package is allowed by the import filters: https://github.com/dart-lang/dart-services/blob/master/lib/src/project.dart#L145
Does someone have a small web_gl
sample that works on the desktop? My google searches keep turning up code from Dart 1 days...
@RedBrogdon @domesticmouse Created a gist sample and it actually runs if you press the RUN button. But it shows lots of syntax errors in the dartpad editor and says it can't import it. So perhaps this is an issue on the front-end / analysis server.
https://dartpad.dev/4a2c9f33ea9668770d1cbbf8cedcb473
@srawlins do we need to reconfigure the analysis server?
I haven't had a chance to look at the dart-services logic yet, but:
It seems most of the web libraries besides dart:html
, dart:js
, and dart:js_util
are not supported. I don't know much about it but I believe the Flutter/Dart SDK does not support the other web libraries(web_ql
, web_audio
, etc) when a dependency on Flutter is included.
dart-services may be improperly analyzing this file with the Flutter project analysis server instead of the Dart project based one or the Dart one is misconfigured.
Curious, it looks as though we should already:
https://github.com/dart-lang/dart-services/blob/061e9b4e1422b17592f71966bb2416ed24f2aac3/lib/src/project.dart#L145
I'm updating this to p1 as this is a bug with the previously supported functionality of proper analysis around core SDK libraries.
From an initial investigation, the Dart project analysis server is being used, but it looks like certain packages are causing the issue. It seems any of the packages which have a dependency on Flutter pull in various Flutter dependencies into package_config.json
disabling analyzer support for most web based SDK libraries including dart:web_gl
.
So it seems we are improperly including some dependencies which don't support the Dart SDK. I've removed some of them in https://github.com/dart-lang/dart-services/pull/831 but it seems the Firebase packages are causing issues as well.
@domesticmouse looks like this still is a problem. any news?
I'm unsure what the required fix is. More than happy to accept PRs on this one.
I'm going to close this as dart:html
and friends (including dart:web_gl
) are now legacy, and support for them in DartPad is now deprecated and limited. So I don't think we'll be able to spend the time to get the library working.
Consider migrating to package:web
and package:js_interop
for any interaction with DOM/browser libraries, both in DartPad or elsewhere. https://dart.dev/go/next-gen-js-interop has some more details :)
Thanks! And sorry we weren't able to resolve this earlier.