question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

suggestion: move closer towards single-export files

See original GitHub issue

The std/collections, std/async and std/fs modules are great. They’re structured so that each file essentially has one export. This makes the purpose of each file clear. They also have the added benefit of allowing the developer to keep dependencies lean but provide an alternative of importing multiple functions via their respective mod.ts files if needed.

On the other hand, other modules like std/streams and std/io do not follow this “single-export-per-file” rule. Instead, they’re further sub-categorised, which can sometimes be unclear, requiring the developer to read the file before understanding its purpose (io/files.ts comes to mind). Furthermore, multiple functions are grouped together. For example, if I want to use writeAll() from streams/conversion.ts, I also pull in 14 other functions/classes/interfaces.

For these reasons, I suggest we:

  1. Move functions to their own files, where appropriate, along with testing counterparts. Async and sync siblings can remain in the same file.
  2. Ensure a mod.ts file exists within each module that exports all functions/interfaces/classes within that module.
  3. Point internal imports to their new locations.
  4. Deprecate the old locations with a clear explanation and ample time until their removals.

This needs to be done for the following modules:

  • tar
  • bytes
  • crypto
  • datetime
  • io
  • streams
  • testing?
  • media_types
  • encoding

Issue Analytics

  • State:open
  • Created 10 months ago
  • Reactions:6
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
lino-levancommented, Dec 27, 2022

I will restate my previous opinion that we should keep testing the way it currently is. Curious to hear what the broader community thinks.

1reaction
lino-levancommented, Nov 24, 2022

I’d like to see what this would look like, but I’m a little bit skeptical as this seems like it will be a very noisy change. Would be a big fan of seeing a draft PR though.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Import or copy the AutoComplete list to another computer
Step 1: Export the AutoComplete mailbox message. Exit Outlook, and then close Outlook on the web on all workstations that are connected to...
Read more >
The Ultimate Guide to Exporting Your Tracks Out of Logic Pro X
Want more out of LPX? Supercharge Your Logic workflow with this Free 10-Point Checklist: ...
Read more >
Exporting from Clipchamp - troubleshooting
Here are some suggestions for what to do if your video doesn't export or exports too slowly from Clipchamp. Suggested steps that can...
Read more >
Export your data from Google Docs, Sheets, Slides, Drawings ...
You can export and download your data from Google Drive, which includes items from Google Docs, Sheets, Slides, Drawings, Sites, Drive, Forms, and...
Read more >
Import or export calendars on Mac - Apple Support (MO)
In Calendar, import and export calendars stored on your Mac. ... You can export an individual calendar's events to a calendar (.ics) file....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found