Skip to content

package:github is reported as Web-only #2926

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

Closed
filiph opened this issue Oct 17, 2019 · 8 comments
Closed

package:github is reported as Web-only #2926

filiph opened this issue Oct 17, 2019 · 8 comments

Comments

@filiph
Copy link

filiph commented Oct 17, 2019

https://pub.dev/packages/github has both web and io support. See: https://github.com/SpinlockLabs/github.dart/tree/master/lib.

cc @robrbecker, the author

@jonasfj
Copy link
Member

jonasfj commented Oct 18, 2019

Yes, the classification is not ideal, it contains two libraries from what I can see, one for server and one for browser.

And it doesn't contain a github.dart library, so it's hard to know which is the primary.

I think our classification logic is scheduled for a bit of improvement.

@robrbecker
Copy link

I've noticed this too and wanted to use conditional import/exports with one entry point to work around it. Looks like someone coincidentally just yesterday put up a PR to do just that SpinlockLabs/github.dart#183

In general, I don't love the split between io and html. Maybe this will make things easier to work everywhere dart-lang/sdk#35969

@jonasfj
Copy link
Member

jonasfj commented Oct 18, 2019

Support for conditional imports in package analysis is still missing #2763.

But I'm sure we'll get that sorted out at some point.

@jonasfj
Copy link
Member

jonasfj commented Oct 18, 2019

Note: for http, just use package:http/http.dart it does conditional imports on its own... So you'll only need to do the env variable thing by importing a different file.

@robrbecker
Copy link

@jonasfj I've started refactoring to a single cross platform entry point. Will this layout work better with detection in pub? https://github.com/SpinlockLabs/github.dart/tree/dev

@jonasfj
Copy link
Member

jonasfj commented Oct 29, 2019

@robrbecker, not yet, but I strongly suspect we'll eventually need to support conditional imports in the platform detection logic -- which is going to be refactored soon, anyways.

@robrbecker
Copy link

I've released version 6 which seems to detect correctly, even with conditional imports.
image

Looks like you can close this issue.

@jonasfj
Copy link
Member

jonasfj commented Nov 10, 2019

Ah, it doesn't detect anything when you use an empty stub as the default case... Or so I think..

We still don't have proper support for conditional imports in pana. But we are look at this soon.

@jonasfj jonasfj closed this as completed Nov 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants