Comments (3)
@CraigMacomber Hi!
I believe setting the module to ESNext was a good choice, but when that was done "target" was changed as well, which I think should be avoided. The TypeScript documentation on the subject...
Hey, thanks for spotting this, and I agree! There were many updates done to prepare TypeBox for dual publishing CJS/ESM on the 0.32.x PR, and it appears the the ESNext target for ESM was an oversight. Would be keen to fix the target to ES2020 (inline with the current CJS target).
In accordance with contribution guidelines in the readme I'm filing this as an issue and not a PR, but if you would like a PR making these changes I can provide one.
If you would like to submit a PR to help fix this up, that would be really appreciated :)
Many thanks!
S
from typebox.
@CraigMacomber Hi,
Have gone ahead and fixed this up and published a revision on 0.32.33 which is using the ES2020 target for ESM. Figured I'd resolve this as I'm trying to catch up on backlog of issues (currently working different 5 projects atm) :D
FluidFramework
I work on https://github.com/microsoft/FluidFramework, a happy user of TypeBox, and was working on our JS runtime compatibility story when I noticed TypeBox has its target set to ESNext
I actually meant to leave you a follow up comment the other week when you submitted this #865 (comment). I'm actually a fan of FluidFramework, and had noticed the project was using TB quite extensively. I'd paid attention to a couple of notes on the project around bundling size, and partially implemented isolated type imports (added on 0.32.x) as a possible means to help reduce bundling sizes (at a cost of having to import types individually). These may be worth checking out if you've not seen this before.
As an aside, I'm actually very open to receiving feedback from users who really push TypeBox far (which FluidFramework certainly does), this mostly to help identify any pain points when using the type system at scale (hundreds of types). All suggestions and feedback are taken onboard for future revisions, so if you are able to provide any insights, suggestions or general feedback it would really help the project along as well as give focus to new features.
Will close up this issue for now
All the best!
S
from typebox.
I actually meant to leave you a follow up comment the other week when you submitted this #865 (comment). I'm actually a fan of FluidFramework, and had noticed the project was using TB quite extensively. I'd paid attention to a couple of notes on the project around bundling size, and partially implemented isolated type imports (added on 0.32.x) as a possible means to help reduce bundling sizes (at a cost of having to import types individually). These may be worth checking out if you've not seen this before.
I had not seen that. We use most of the types, so I'm not sure if it will help our case, but its good to know its an option when I get time to look into our bundles size more.
As an aside, I'm actually very open to receiving feedback from users who really push TypeBox far (which FluidFramework certainly does), this mostly to help identify any pain points when using the type system at scale (hundreds of types). All suggestions and feedback are taken onboard for future revisions, so if you are able to provide any insights, suggestions or general feedback it would really help the project along as well as give focus to new features.
Once we are done getting our 2.0 release ready (hopefully this week), we should have time to work on things like bundle size. For now though I have filed #907 which I think is the main cause of unexpected bundling (other than some things on our end we need to clean up in our usage of TypeBox accidently pulling in the compiler when we shouldn't).
from typebox.
Related Issues (20)
- Should `IsValueType` guard consider `Date`? HOT 1
- Trying to do codegen from Drizzle schemas HOT 1
- Make `default` and `examples` schema options properties type-safe HOT 2
- Indicate which files don't have "sideEffects" in package.json for improved tree shaking HOT 3
- Type.String().Optional() is accepted on ts-hint / ts-lint, and even build successfully; but of course, "Optional()" does not exists HOT 2
- Dynamic Template Literals can't be Mapped HOT 2
- How should TypeBox types be used with TS type predicates? HOT 2
- TypeCompiler.Compile incorrectly parsing `Record<any, any>`
- Error when using Composite with Ref (Unable to dereference schema with $id 'undefined') HOT 3
- Transform type keys in Record HOT 2
- Is it possible to add support to the Type.String additional properties for the enum keyword HOT 2
- Support for async validations? HOT 1
- Transform + Map/Index does not work HOT 4
- Update the error message for required properties
- Covariance issue with `TypeCheck<TSchema>` and `TypeCheck<TObject<{}>>`
- Default values in nested objects are not generated HOT 1
- Doubt on Record HOT 2
- TypeCompiler compile on Type.Strict(T) - Preflight validation check failed to guard for the given schema
- Max call stack size exceeded
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from typebox.