Skip to content
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

Not obvious how to import a Dart package #3858

Closed
DartBot opened this issue Jun 25, 2012 · 4 comments
Closed

Not obvious how to import a Dart package #3858

DartBot opened this issue Jun 25, 2012 · 4 comments
Labels
area-language Dart language related items (some items might be better tracked at github.com/dart-lang/language). closed-duplicate Closed in favor of an existing report type-enhancement A request for a change that isn't a bug

Comments

@DartBot
Copy link

DartBot commented Jun 25, 2012

This issue was originally filed by [email protected]


Libraries declare their 'name' in their #library directive. This is the name that a user browsing the code sees, and the name that tools like dartdoc and the editor see and expose, but it has no relationship to the name that the user actually needs - the name that should be imported.

This currently causes much confusion around libraries that ship with the SDK but aren't built-in (see mailing list and e.g. bug 3702) and will equally cause confusion when people start using user libraries through pub.

These names should be the same, at least by convention.
E.g. built in libraries should be #library('dart:html'), user libraries should be #library('package:mypkg');
SDK libraries should be #library('$SDK_ROOT/lib/i18n') or similar, however is the recommended way of importing them.

@sethladd
Copy link
Contributor

Added Area-Language, Language-Import, Triaged labels.

@DartBot
Copy link
Author

DartBot commented Jun 25, 2012

This comment was originally written by @jinmingjian


no need. the behavor of importing a uri is nice. The spec has suggested a good usage of library directive: "In the future it may also serve to define a default prefix when importing". But, it is "in the future":) waits Gilad's refinement!

@DartBot
Copy link
Author

DartBot commented Jun 25, 2012

This comment was originally written by @seaneagan


if the metadata proposal (http://news.dartlang.org/2012/06/proposal-to-add-metadata-to-dart.html) included library-level annotations, then #library('package:mypkg') could just merely be @­Library('package:mypkg') or similar.

@gbracha
Copy link
Contributor

gbracha commented Jun 26, 2012

Expect improvements in this space.


Removed Type-Defect, Language-Import labels.
Added Type-Enhancement, Duplicate labels.
Marked as being merged into #1378.

@DartBot DartBot added Type-Enhancement area-language Dart language related items (some items might be better tracked at github.com/dart-lang/language). closed-duplicate Closed in favor of an existing report labels Jun 26, 2012
@kevmoo kevmoo added type-enhancement A request for a change that isn't a bug and removed type-enhancement labels Mar 1, 2016
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-language Dart language related items (some items might be better tracked at github.com/dart-lang/language). closed-duplicate Closed in favor of an existing report type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

No branches or pull requests

4 participants