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

Proxy is not typed in a useful way #11829

Closed
stevemessick opened this issue Jul 15, 2013 · 8 comments
Closed

Proxy is not typed in a useful way #11829

stevemessick opened this issue Jul 15, 2013 · 8 comments
Assignees
Labels
area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. P2 A bug or feature request we're likely to work on type-enhancement A request for a change that isn't a bug

Comments

@stevemessick
Copy link
Contributor

Code completion not working in example chrome app.

For example,

// ...
bounds.left -= boundsChange ~/ 2;

appWindow.setBounds(bounds);
appWindow.set|

Popup does not list "setBounds".
////////////////////////////////////////////////////////////////////////////////////
Editor: 0.1.2_r24980 (2013-07-12)
OS: Windows 7 - amd64 (6.1)
JVM: 1.7.0_05

projects: 1

open dart files: 1

auto-run pub: true
localhost resolves to: 127.0.0.1
mem max/total/free: 889 / 351 / 289 MB
thread count: 24
index: 150985 relationships in 34300 keys in 147 sources

SDK installed: true
Dartium installed: true
analysis engine: new

@stevemessick
Copy link
Contributor Author

In the generated Chrome Packaged App the variable is initialized:

var appWindow = js.context.chrome.app.window.current() as AppWindow;

The value of 'js.context' is a Proxy instance wrapping a JS object. I was going to suggest rewriting the generated code to include specific types, but even that won't work here. About half the methods documented for AppWindow are not even defined in the Dart class.

I'm not sure what to do about Proxy in general.


cc @devoncarew.
Set owner to @bwilkerson.

@stevemessick
Copy link
Contributor Author


Attachment:
screenshot.png (93.99 KB)

@vsmenon
Copy link
Member

vsmenon commented Jul 15, 2013

Adding justin, who's thinking about how to improve this from the js interop library point of view.


cc @justinfagnani.

@devoncarew
Copy link
Member

var appWindow = js.context.chrome.app.window.current() as AppWindow;

You definitely don't want to do this. appWindow is a Proxy, not an AppWindow. AppWindow lives in the dart:chrome library, which is a totally separate way of accessing the chrome apis. This example is using js interop.

@justinfagnani
Copy link
Contributor

I think we want to allow exactly that in the future. DOM objects that are sent via js-interop should be seamlessly "serialized" (by reference) instead of using proxies.

In any case, currently there's no real way to type Proxy objects, that's a future goal.

@kasperl
Copy link

kasperl commented Jul 10, 2014

Removed this from the Later milestone.
Added Oldschool-Milestone-Later label.

@kasperl
Copy link

kasperl commented Aug 4, 2014

Removed Oldschool-Milestone-Later label.

@stevemessick stevemessick added Type-Enhancement area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. labels Aug 4, 2014
@kevmoo kevmoo added P2 A bug or feature request we're likely to work on type-enhancement A request for a change that isn't a bug and removed triaged labels Feb 29, 2016
@bwilkerson
Copy link
Member

Closing as stale.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-analyzer Use area-analyzer for Dart analyzer issues, including the analysis server and code completion. P2 A bug or feature request we're likely to work on type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

No branches or pull requests

7 participants