Skip to content

VM and Dartium don't respect @lazy and DeferredLibrary #10171

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
DartBot opened this issue Apr 24, 2013 · 6 comments
Closed

VM and Dartium don't respect @lazy and DeferredLibrary #10171

DartBot opened this issue Apr 24, 2013 · 6 comments
Labels
area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. closed-obsolete Closed as the reported issue is no longer relevant type-enhancement A request for a change that isn't a bug

Comments

@DartBot
Copy link

DartBot commented Apr 24, 2013

This issue was originally filed by @sethladd


Consider this code:

import 'dart:html';
import 'dart:async';

@lazy
import 'reverser.dart';

const lazy = const DeferredLibrary('reverser', uri: './part.js');

void main() {
  print('in main');
  new Timer(const Duration(seconds:3), () {
    lazy.load().then((_) {
      print('library loaded');
      query("#sample_text_id")
        ..text = "Click me!"
        ..onClick.listen(reverseText);
    });
  });
}

void reverseText(MouseEvent event) {
  query("#sample_text_id").text = reverse(query("#sample_text_id").text);
}

In the network panel of Dev Tools, I see the request for reverser.dart immediately on page load. I was expecting now to see the request until after the Timer fires.

@DartBot
Copy link
Author

DartBot commented Apr 24, 2013

This comment was originally written by @mhausner


Is there an agreed upon spec that defines semantics of annotations that the VM has to recognize and follow?

@DartBot
Copy link
Author

DartBot commented Apr 24, 2013

This comment was originally written by ventura....@gmail.com


This seams like a very important performance feature that must be included in the vm and dartium. Could this also applies to html imports? I have followed the posts from ilya grigorik about 1 second load times for web pages and js deferring and other code loading is fundamental so i dont see any reason not to do it on the vm. I hope it comes soon to the vm also

@kasperl
Copy link

kasperl commented Apr 25, 2013

We haven't really discussed this in details yet. It isn't clear what the VM is supposed to do -- I think dart2dart translation might be a part of the answer here.

Changing to an "enhancement request".


cc @peter-ahe-google.
Removed Type-Defect label.
Added Type-Enhancement, Area-VM, Triaged labels.

@iposva-google
Copy link
Contributor

As Kasper said in comment 3, so far this has been discussed a deployment feature which you will get with dart2dart. The VMs involvement in supporting this ends with giving the dart2dart generated code access to loading sources lazily through a library call. This library API still needs to be specified though.

@iposva-google
Copy link
Contributor

Removed Priority-Medium label.
Added Priority-Unassigned label.

@sethladd
Copy link
Contributor

Added AssumedStale label.

@DartBot DartBot added Type-Enhancement area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. closed-obsolete Closed as the reported issue is no longer relevant labels Jan 29, 2015
@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-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. closed-obsolete Closed as the reported issue is no longer relevant type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

No branches or pull requests

5 participants