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

Add a note about required compilerOptions.lib or compilerOptions.target to SES readme #2270

Open
adamscybot opened this issue May 6, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@adamscybot
Copy link

adamscybot commented May 6, 2024

What is the Problem Being Solved?

Since the use of AggregateErrorConstructor was added you need to be using at least es2021 (or more granular, es2021.promise) in the compilerOptions.lib of the tsconfig.json on the consuming project for it to compile.

If the consumer doesn't use the compilerOptions.lib option, TS infers sensible defaults from the compilerOptions.target and I determined es2021 is also the target that is the least required in that scenario.

Note there was another definition added in es2022.error. Not sure which one is relevant, or maybe both are.

This took me some time to understand where this was supposed to be coming from. Probably just a note in the docs about the required support and relevant TS config would suffice.

I think there are other options here but I haven't put too much thought into if they are appropriate. However, they could nuke it entirely from being a consumer concern:

  • Use /// <reference lib="es2021.promise" /> in types.d.ts. I think this also includes it in the consuming project though.
  • (typeof globalThis)['AggregateErrorConstructor'] lets you see if it's there and potentially use a conditional type to dynamically not include it if it's not available which may or may not make sense depending on the SES API around this feature.

Description of the Design

N/A

Security Considerations

N/A

Scaling Considerations

N/A

Test Plan

N/A

Compatibility Considerations

N/A

Upgrade Considerations

N/A

@adamscybot adamscybot added the enhancement New feature or request label May 6, 2024
@adamscybot adamscybot changed the title Add a note about required to SES readme Add a note about required compilerOptions.lib to SES readme May 6, 2024
@adamscybot adamscybot changed the title Add a note about required compilerOptions.lib to SES readme Add a note about required compilerOptions.lib or compilerOptions.target to SES readme May 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant