endojs / endo

Endo is a distributed secure JavaScript sandbox, based on SES
Apache License 2.0
762 stars 68 forks source link

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

Open adamscybot opened 2 months ago

adamscybot commented 2 months ago

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:

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