Skip to content

Conversation

@dominique-roux
Copy link
Contributor

Checklist before merging

  • [ X] I added an appropriate entry to CHANGELOG.md

@dominique-roux dominique-roux marked this pull request as draft January 21, 2026 13:29
@dominique-roux dominique-roux marked this pull request as ready for review January 22, 2026 07:46
@tcompa tcompa requested review from tcompa and zonia3000 January 22, 2026 07:52
@dominique-roux dominique-roux changed the base branch from main to ihb-develop January 22, 2026 07:58
import { getValidPath } from "./path.js";
import { getLogger } from "./logger.js";
import { Authorizer } from "./authorizer.js";
import { S3 } from '@aws-sdk/client-s3';
Copy link
Collaborator

Choose a reason for hiding this comment

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

I see that the aws dependency has been added as optional. However, when importing this from clean repo and running npm install, this import results in missing dependency error.

src/data.ts:8:20 - error TS2307: Cannot find module '@aws-sdk/client-s3' or its corresponding type declarations.

8 import { S3 } from '@aws-sdk/client-s3';

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, npm install does not install aws
npm run install:aws does (it is in the readme)
I thought you would like to keep the default without aws but I'm happy if the default is with aws

Copy link
Collaborator

Choose a reason for hiding this comment

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

I prefer to keep the default without aws, but it's not straightforward. If you mark the dependency as optional but then you import it, compilation will fail in the configuration without aws.

Dynamic imports could solve this, but they complicate the code. See e.g.: https://stackoverflow.com/questions/70247008/create-a-typescript-library-with-optional-dependencies-resolved-by-application

Please use the optional dependency only if you can easily implement a dynamic import that allows the code to compile in both scenarios. Otherwise, just include the dependency as required.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah OK, I didn't realize it was making the compilation fail
I already used dynamic import in python (for cuda), and if was pretty simple.I'll check it it works te same way in ts

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