Skip to content
This repository has been archived by the owner on Sep 15, 2021. It is now read-only.

Provide a way to import observe without mirrors #86

Open
yjbanov opened this issue Mar 31, 2016 · 9 comments
Open

Provide a way to import observe without mirrors #86

yjbanov opened this issue Mar 31, 2016 · 9 comments

Comments

@yjbanov
Copy link

yjbanov commented Mar 31, 2016

Currently, package:observe pulls in package:smoke which pulls in dart:mirrors. Flutter is allergic to dart:mirrors and crashes immediately. Please provide a way to import package:observe without mirrors.

@yjbanov
Copy link
Author

yjbanov commented Mar 31, 2016

/cc @matanlurey @jmesserly

@sigmundch
Copy link
Contributor

This is just to support PathObservers, and even then package:smoke has a transformer that removes the import to mirrors automatically. It's only there if you use it without using pub-serve or pub-build.

Where is this being used from? What is it used for?

@sigmundch
Copy link
Contributor

If you are only using ObservableList/Map then one possible short-term fix could be to refactor our code internally to not import pacakge:observe/observe.dart to get to a dependency within the package. Instead depend directly on the subset that we need. At that point, we might be able to have no dependency between ObservableLIst/Map and PathObserver, so you could import directly observable_map/observable_list.dart without an issue.

@yjbanov
Copy link
Author

yjbanov commented Mar 31, 2016

I am using it in a Flutter app, which doesn't use pub serve/build.

@sigmundch
Copy link
Contributor

@yjbanov - I'm about to look at this, just wanted to confirm with you that you are not using PathObserver, but only using ObsevableList/Map?

@sigmundch
Copy link
Contributor

actually - I'm curious also about your uses of the Observable type directly, since the default implementation based on dirty-checking depends on having mirrors as well. If it's easier, feel free to share a pointer where I can look more closely at in your code

@yjbanov
Copy link
Author

yjbanov commented Apr 28, 2016

This came up when I tried to get package:streamy to run in a Flutter app, so the subset we need is the one streamy uses. AFAIK, streamy does not use PathObserver.

@sigmundch
Copy link
Contributor

thanks!

@tvolkert
Copy link
Contributor

tvolkert commented Sep 8, 2016

I just ran into this as well. Any updates?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

No branches or pull requests

3 participants