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

Need a way to re-export elements from imported library #760

Closed
rakudrama opened this issue Dec 8, 2011 · 11 comments
Closed

Need a way to re-export elements from imported library #760

rakudrama opened this issue Dec 8, 2011 · 11 comments
Assignees
Labels
area-language Dart language related items (some items might be better tracked at github.com/dart-lang/language). P1 A high priority bug; for example, a single project is unusable or has many test failures type-enhancement A request for a change that isn't a bug

Comments

@rakudrama
Copy link
Member

We need to be able to re-export imports for ~100 type definitions (classes or interfaces) that should be common between dart:dom and dart:html.

(1) dart:dom defines the class, e.g CanvasPixelArray.

(2) html:dart imports dart:dom as an implementation library.

(3) The user imports dart:html only and expects to have CanvasPixelArray. The user does not import dart:dom as that is discouraged - it would be mixing library layers.

Today we have to create a new html.CanvasPixelArray that wraps the dom.CanvasPixelArray. In cases where dart:html is adding significant functionality, that is OK, but there are ~100 classes where there is no value-add.

I propose that typedef can be used to introduce a new name for an existing type, not just to name a function type.
That new name is exported just like any other name (i.e. if not library-private).

library('dart:html');

import('dart:dom', prefix:'dom');

typedef dom.CanvasPixelArray CanvasPixelArray;

I have put this at high priority since we are currently maintaining ~100 inefficient wrapper classes to 're-export'. As we fill out the DOM we have a huge tax maintaining both.

@rakudrama
Copy link
Member Author

Added this to the Release1.0 milestone.
Added m label.

@gbracha
Copy link
Contributor

gbracha commented Dec 12, 2011

Making typedef work as a general type alias is something we plan to do. I agree that would address this issue.


Set owner to @gbracha.
Removed Type-Defect label.
Added Type-Enhancement, Accepted labels.

@gbracha
Copy link
Contributor

gbracha commented May 3, 2012

Issue #1185 has been merged into this issue.

@rakudrama
Copy link
Member Author

Marked this as blocking #2901.

@sethladd
Copy link
Contributor

sethladd commented May 8, 2012

Removed this from the Release1.0 milestone.
Removed m label.

@vsmenon
Copy link
Member

vsmenon commented May 10, 2012

Any update on this one? It's blocking a pretty bad dart:html bug (see 2901). Stephen's suggested workaround for 2901 (without typedef) will result in significant code expansion, so we'd rather not go that route.


cc @kasperl.
cc @larsbak.

@gbracha
Copy link
Contributor

gbracha commented May 10, 2012

We will be discussing a proposal for explicit re-export support at the Monday language meeting.

@gbracha
Copy link
Contributor

gbracha commented May 15, 2012

Fixed in spec 0.1


Added Done label.

@gbracha
Copy link
Contributor

gbracha commented Jun 11, 2012

For the VM, issue #3071; for dart2js, issue #3070.

@gbracha
Copy link
Contributor

gbracha commented Jun 11, 2012

And issue #3083 for the analyzer.

@vsmenon
Copy link
Member

vsmenon commented Jul 16, 2012

Marked this as blocking #2901.

@rakudrama rakudrama added Type-Enhancement P1 A high priority bug; for example, a single project is unusable or has many test failures area-language Dart language related items (some items might be better tracked at github.com/dart-lang/language). labels Jul 16, 2012
@kevmoo kevmoo added type-enhancement A request for a change that isn't a bug and removed type-enhancement labels Mar 1, 2016
copybara-service bot pushed a commit that referenced this issue Oct 18, 2022
…ions)

https://dart.googlesource.com/protobuf/+log/1d175bef6043..ba29983968de

2022-10-18 [email protected] protoc_plugin: Reword some of the documentation (#766)
2022-10-18 [email protected] protoc_plugin: Improve "is map field" check (#765)
2022-10-18 [email protected] Update CHANGELOG: mention #751
2022-10-18 [email protected] Add CHANGELOG entry for #760, #763
2022-10-18 [email protected] Fix `null` handling in proto3 JSON deserializer (#763)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/dart-protobuf-dart-sdk
Please CC [email protected] on the revert to ensure that a human
is aware of the problem.

To file a bug in Dart Protobuf Support: https://github.com/dart-lang/protobuf/issues
To file a bug in Dart SDK: https://github.com/dart-lang/sdk/issues

To report a problem with the AutoRoller itself, please file a bug:
https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md

Tbr: [email protected]
Change-Id: I5502c8ee170701888956534cbd92473a24435fea
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/264664
Reviewed-by: Nate Bosch <[email protected]>
Commit-Queue: Nate Bosch <[email protected]>
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). P1 A high priority bug; for example, a single project is unusable or has many test failures type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

No branches or pull requests

6 participants