Import shorthand syntax
Most recent version: https://github.com/dart-lang/language/blob/main/accepted/future-releases/unquoted-imports/feature-specification.md Original design below (which also has some good parts, a final result might be something in-between). ----------------------------- This is a proposal for a shorter import syntax for Dart. It is defined as a shorthand syntax which expands to, and coexists with, the existing import syntax. It avoids unnecessary repetitions and uses short syntax for the most common imports. ## Motivation Dart package imports are fairly verbose because they are based on URIs with no shorthands. A fairly typical import would be: ```dart import "package:built_value/built_value.dart"; ``` The repetition alone is grating, and Dart imports can typically be split into three groups: * Platform libraries, `import "dart:async";`. * Third-party packages, `import "package:built_value/built_value.dart";`. * Same package relative import, `import "src/helper.dart";`. The package imports are the ones with most overhead. For the rest, the surrounding quotes and trailing `.dart` are still so ubiquitous that they might as well be assumed. ## Syntax The new syntax uses no quotes. Each shorthand library reference is provided as a *URI-like* character sequence containing no whitespace, and consisting only of identifiers/reserved words separated or prefixed by colons (`:`), dots (`.`) and slashes (`/`). The allowed formats are: * A single shorthand Dart package name. *
Posted by lrhn on Oct 29, 2019, 2:52 AM
Tags
Related issues
- [Meta] Feedback on granular control over Copilot changes
- unexpected status 401 Unauthorized issue
- [MODEL] Measurable quality regression in Claude generation 5 (Fable 5 / Opus 5 / Sonnet 5): worse nonsense detection, ~2x verbosity, under-disclosed model fallb
- [CRITICAL] Subagent spawning and subagent pattern bugs trigger infinite recursion, infinite token usage, grossly inefficient token usage, and lost accumulated s
- Video stops playing after some minutes
- [MODEL] Claude verbose code comments by default — ignores instructions to stop.
Raise real-world problems, find people facing the same issue, and discuss solutions.3,500 issues0 comments
github (Software)
[Meta] Feedback on granular control over Copilot changes
unexpected status 401 Unauthorized issue
[MODEL] Measurable quality regression in Claude generation 5 (Fable 5 / Opus 5 / Sonnet 5): worse nonsense detection, ~2x verbosity, under-disclosed model fallb
[CRITICAL] Subagent spawning and subagent pattern bugs trigger infinite recursion, infinite token usage, grossly inefficient token usage, and lost accumulated s
Video stops playing after some minutes
[MODEL] Claude verbose code comments by default — ignores instructions to stop.
Scope Codex VS Code chats to the current workspace/project
Update on "Co-authored-by: Copilot" in commit messages
Import shorthand syntax
Most recent version: https://github.com/dart-lang/language/blob/main/accepted/future-releases/unquoted-imports/feature-specification.md Original design below (which also has some good parts, a final result might be something in-between). ----------------------------- This is a proposal for a shorter import syntax for Dart. It is defined as a shorthand syntax which expands to, and coexists with, the existing import syntax. It avoids unnecessary repetitions and uses short syntax for the most common imports. ## Motivation Dart package imports are fairly verbose because they are based on URIs with no shorthands. A fairly typical import would be: ```dart import "package:built_value/built_value.dart"; ``` The repetition alone is grating, and Dart imports can typically be split into three groups: * Platform libraries, `import "dart:async";`. * Third-party packages, `import "package:built_value/built_value.dart";`. * Same package relative import, `import "src/helper.dart";`. The package imports are the ones with most overhead. For the rest, the surrounding quotes and trailing `.dart` are still so ubiquitous that they might as well be assumed. ## Syntax The new syntax uses no quotes. Each shorthand library reference is provided as a *URI-like* character sequence containing no whitespace, and consisting only of identifiers/reserved words separated or prefixed by colons (`:`), dots (`.`) and slashes (`/`). The allowed formats are: * A single shorthand Dart package name. *
Comments (0)
No comments yet. Start the discussion.