a14n / dart-js-wrapping

With that package you will be able to easilly wrap JS library in Dart.
https://pub.dartlang.org/packages/js_wrapping
Other
43 stars 16 forks source link

Upgrade source_gen dependency to 0.5 #8

Closed enyo closed 8 years ago

enyo commented 8 years ago

This would be great since we aren't able to use google_maps otherwise

a14n commented 8 years ago

For google_maps source_gen is only used to generate source files. If you only use google_maps you can ignore the source_gen dependency by using :

dependency_overrides:
  source_gen: 0.5

Let me know if it works or not.

enyo commented 8 years ago

Great, thanks!

enyo commented 8 years ago

If it's only used to build the library, shouldn't they go to dev_dependencies?

enyo commented 8 years ago

Oh... unfortunately it only worked in dartium, and not Chrome.

a14n commented 8 years ago

Actually, there's a generator that does use source_gen to generate files. Thegenerated files depend on lib/js_wrapping.dart but don't need source_gen to work. google_maps has been generated with source_gen but the package can be used without this source_gen dependency.

a14n commented 8 years ago

I just tried https://github.com/a14n/dart-google-maps/tree/master/example/01-basics/map-simple and removing the packages/source_gen directory. It works with Dart 1.15.0 in Dartium and dart2js.

enyo commented 8 years ago

When I try to compile to js I get

[Error from Dart2JS on exitlive|web/default.bootstrap.initialize.dart]:
packages/google_maps/src/core/map/map.dart:19:3:
External method without an implementation.
  external factory _GMap(Node mapDiv, [MapOptions opts]);
  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[Error from Dart2JS on exitlive|web/default.bootstrap.initialize.dart]:
packages/google_maps/src/core/map/map_options.dart:19:3:
External method without an implementation.
  external factory _MapOptions();
  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[Error from Dart2JS on exitlive|web/default.bootstrap.initialize.dart]:
packages/google_maps/src/core/controls/map_type_control_options.dart:19:3:
External method without an implementation.
  external factory _MapTypeControlOptions();
  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
a14n commented 8 years ago

What Dart version are you using ?

enyo commented 8 years ago

Actually, there's a generator that does use source_gen to generate files. Thegenerated files depend on lib/js_wrapping.dart but don't need source_gen to work. google_maps has been generated with source_gen but the package can be used without this source_gen dependency.

So the correct way would be to add js_wrapping as a dependency, and source_gen as a dev_dependency?

I'm using dart 1.15.

EDIT:

source_gen 0.4.8
js_wrapping 0.2.0+1
google_maps 3.1.0
a14n commented 8 years ago

Not really because the generator (used in google_maps) need this transitionnal dependency. dev_dependency would make the generator only usable inside js_wrapping which is not what is needed.

enyo commented 8 years ago

Do you have any idea why it wouldn't work or what I could try?

a14n commented 8 years ago

Is your project public ? Do you have a URL ?

enyo commented 8 years ago

No unfortunately not.

enyo commented 8 years ago

So, the problem was that we imported a server package in the client. :-/