Skip to content

Enforce laziness of deferred libraries in dev_compiler #27776

@munificent

Description

@munificent

As of 8daf4cf, dev_compiler now supports the loadLibrary() function on deferred libraries. However, it does not validate that you call that before the library is used. This currently runs:

import "something.dart" deferred as something;

main() {
  // No loadLibrary() call.
  something.someFunction();
}

It would be great if dev_compiler threw an error here. Otherwise, users can iterate on programs that work fine in dev_compiler but fail when a production build is run.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-web-jsIssues related to JavaScript support for Dart Web, including DDC, dart2js, and JS interop.web-dev-compiler

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions