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

Wildcard Exports – Because Typing Every File Name is for Cavemen #60347

Open
stan-at-work opened this issue Mar 18, 2025 · 1 comment
Open
Labels
area-language Dart language related items (some items might be better tracked at github.com/dart-lang/language). type-enhancement A request for a change that isn't a bug

Comments

@stan-at-work
Copy link

The Struggle is Real

Look, we love Dart, but manually exporting every single file in our project is like sorting our laundry by individual thread count. Painful. Time-consuming. Possibly a form of cruel and unusual punishment.

Wouldn't it be great if we could just do something like this?

export 'src/**/*.dart';  // Just grab everything. Yes, everything.
export 'lib/*';          // Take my files. All of them.
export '**/*.dart';      // Absolute chaos, but in a good way.

Current Reality

Right now, we have to type out every single export like some sort of unpaid intern:

export 'src/models/user.dart';
export 'src/models/post.dart';
export 'src/utils/helper.dart';
export 'src/utils/logger.dart';
export 'src/utils/whyDoIHaveToDoThis.dart';
export 'src/config/constants.dart';
// ...and 500 more files later

This isn't 1995. Computers should be doing the tedious work for us.

Why This is Important

  • Less typing = fewer typos = happier developers
  • More time for actual coding (or pretending to code while scrolling memes)
  • Other languages have this feature; let's not get left behind in the stone age

Conclusion

Please, Dart team, spare our fingers. Let us unleash the power of wildcards and export like true modern developers.

Sincerely,
Every Dev Who’s Ever Had to Manually Export 100+ Files

@RohitSaily
Copy link
Contributor

RohitSaily commented Mar 18, 2025

In addition to exports I would like to see it for imports too. It would make it consistent and it could be useful for treating a folder as a single component that gets imported. This could be useful for grouping internal code without having to make export files for every grouping.

import 'package:mypackage/src/menu_widgets/*.dart';
//The rest of this file assembles the various components defined across multiple files in the "menu_widgets" folder.

@a-siva a-siva added area-language Dart language related items (some items might be better tracked at github.com/dart-lang/language). type-enhancement A request for a change that isn't a bug labels Mar 18, 2025
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). type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

No branches or pull requests

3 participants