Skip to content

Refactor storage types#126

Draft
iflan wants to merge 1 commit intowhscullin:mainfrom
iflan:refactor-storage-types
Draft

Refactor storage types#126
iflan wants to merge 1 commit intowhscullin:mainfrom
iflan:refactor-storage-types

Conversation

@iflan
Copy link
Copy Markdown
Contributor

@iflan iflan commented Jun 5, 2022

Today, lots of information about how a file or JSON becomes a disk
image is embedded in the metadata for the image and/or disk. This
makes it hard to write back to the source when the in-memory disk
image changes.

This refactoring is an attempt to break out all of the bits of logic
into composable pieces. While this is mestly concerned with reading
right now, the idea is that it will eventually allow configuring
writing as well. The main goal is to allow round-tripping to the same
file on disk, but, in theory, it could also save to a different file
or the local database, too.

Note that this is a work in progress.

Today, lots of information about how a file or JSON becomes a disk
image is embedded in the metadata for the image and/or disk. This
makes it hard to write back to the source when the in-memory disk
image changes.

This refactoring is an attempt to break out all of the bits of logic
into composable pieces.  While this is mestly concerned with reading
right now, the idea is that it will eventually allow configuring
writing as well.  The main goal is to allow round-tripping to the same
file on disk, but, in theory, it could also save to a different file
or the local database, too.

Note that this is a work in progress.
@iflan
Copy link
Copy Markdown
Contributor Author

iflan commented Jun 5, 2022

@whscullin This is very much a work in progress, but I wanted to give you an idea of what I was thinking about. Please let me know if you think this is the wrong direction.

Copy link
Copy Markdown
Owner

@whscullin whscullin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the ideas here. The names are a bit verbose but they are descriptive and naming is hard, so 🤷 .

Comment thread js/formats/po.ts
import type { byte } from '../types';
import { NibbleDisk, DiskOptions, ENCODING_NIBBLE } from './types';
import { NibbleDisk, DiskOptions, ENCODING_NIBBLE, TrackSectorSource } from './types';
import { ByteArrayArrayTrackSectorSource, ByteArrayByteSource, ByteTrackSectorSource, ProdosOrderedTrackSectorSource, TrackSector6x2NibbleTrackSource } from './sources';
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a mouthful 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants