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

Write JUMBF data into assets #45

Merged
merged 9 commits into from
Aug 8, 2024
Merged

Write JUMBF data into assets #45

merged 9 commits into from
Aug 8, 2024

Conversation

cyraxx
Copy link
Contributor

@cyraxx cyraxx commented Aug 1, 2024

No description provided.

src/asset/PNG.ts Outdated Show resolved Hide resolved
@cyraxx cyraxx changed the title [WIP] Write JUMBF data into assets Write JUMBF data into assets Aug 6, 2024
Copy link
Contributor

@UlrichEckhardt UlrichEckhardt left a comment

Choose a reason for hiding this comment

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

Seems like a good way forward. I raised two issues, but those could also be changed later without causing much overhead in between. LGTM.

/**
* Fills in the manifest store JUMBF into the previously created sapce.
*/
writeManifestJUMBF(jumbf: Uint8Array): Promise<void>;
Copy link
Contributor

Choose a reason for hiding this comment

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

Stupid question, why did you make these return promises? I would understand it if it was an async operation that possibly blocked on remote communication or took really long, but that isn't the case here. Also, those are the only two methods like that in this interface.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I had the original idea that Asset implementations could also represent something that's not backed by a Uint8Array but by some other data repository that would require async operations – maybe reading from disk on demand instead of keeping the entire asset in memory, or some native implementation. No specific plans for that currently though.

tests/manifest-data-insertion.test.ts Show resolved Hide resolved
Comment on lines 54 to 56
if (!asset) {
this.skip();
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Style question: Like this or inline

if (!asset) this.skip();

I have myself not been consistent in this and wonder if there's a styleguide, like e.g. PHP's PSR-12.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not aware of a styleguide, but ESLint has a corresponding curly rule.

I've added 'curly': ['error', 'multi-or-nest', 'consistent'] to the ESLint config as a test, however that led to a lot of instances where we'd have to remove braces, and on first glance I'm not sure if I agree with all of them. Might be interesting to try this in a PR.

@cyraxx cyraxx merged commit 14788b8 into main Aug 8, 2024
3 checks passed
@cyraxx cyraxx deleted the feature/jumbf-into-assets branch August 8, 2024 09:21
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