Ship great products!
github.com/rescript-lan...
github.com/rescript-lan...
We are currently kicking off this year's ReScript Retreat with a talk about editor tooling by @z-th.bsky.social and @nojaf.com.
We are currently kicking off this year's ReScript Retreat with a talk about editor tooling by @z-th.bsky.social and @nojaf.com.
Records is a corner stone in ReScript. However, they can't be nested without explicit definitions. Until now!
Will be especially useful for deeply nested records (like options objects) not intended to be reused.
Records is a corner stone in ReScript. However, they can't be nested without explicit definitions. Until now!
Will be especially useful for deeply nested records (like options objects) not intended to be reused.
Playground: rescript-lang.org/try?version=...
Playground: rescript-lang.org/try?version=...
This will make some of the common use cases for records more ergonomic.
This will make some of the common use cases for records more ergonomic.
Objects are structurally typed, doesn't need a type definition, and are quite useful in some scenarios.
Completion for object fields will be more ergonomic and get better discoverability with this addition.
Objects are structurally typed, doesn't need a type definition, and are quite useful in some scenarios.
Completion for object fields will be more ergonomic and get better discoverability with this addition.
And additionally, you can even configure per type to have the editor give completions from additional modules, not just the module it belongs to.
And additionally, you can even configure per type to have the editor give completions from additional modules, not just the module it belongs to.
To fix this, you now get pipe completions from dots as well.
So the experience is like in JS, but an actual pipe is inserted on completion.
To fix this, you now get pipe completions from dots as well.
So the experience is like in JS, but an actual pipe is inserted on completion.
A consequence of this is that prop drilling is really simple, because you rarely have to annotate props. Just using the prop in the component defining it is usually enough.
A consequence of this is that prop drilling is really simple, because you rarely have to annotate props. Just using the prop in the component defining it is usually enough.
This is a common gotcha for JS/TS devs who come to ReScript. To ease the transition we're experimenting with letting the editor tooling complete pipes also via dots.
This is a common gotcha for JS/TS devs who come to ReScript. To ease the transition we're experimenting with letting the editor tooling complete pipes also via dots.
Massive readability and productivity boosters, and you'll love it if you haven't written in a language with it before.
Massive readability and productivity boosters, and you'll love it if you haven't written in a language with it before.
Partial application of functions is useful in many scenarios, and this explicit syntax makes code easier to read and reason about.
Partial application of functions is useful in many scenarios, and this explicit syntax makes code easier to read and reason about.
It's just a syntax transform, so it compiles to regular, efficient JS function calls.
It's just a syntax transform, so it compiles to regular, efficient JS function calls.
A useful JS technique that's important for interop, and lends itself well to some pretty interesting use cases!
A useful JS technique that's important for interop, and lends itself well to some pretty interesting use cases!
For file modules, you simply await the module itself.
For single functions, you use the `import` function.
Makes things like React.lazy easy to use.
For file modules, you simply await the module itself.
For single functions, you use the `import` function.
Makes things like React.lazy easy to use.
Image shows Preact, but there are examples in the community even for non-client side fws, like emitting plain HTML server side.
Image shows Preact, but there are examples in the community even for non-client side fws, like emitting plain HTML server side.
You can pattern match directly on the await, and handle errors in the pattern match as well.
No need to wrap things manually in try/catch, the compiler still emits the right thing.
You can pattern match directly on the await, and handle errors in the pattern match as well.
No need to wrap things manually in try/catch, the compiler still emits the right thing.
It'll produce a warning by default, and it's easy to configure the compiler so that it emits a hard error in for example CI.
It'll produce a warning by default, and it's easy to configure the compiler so that it emits a hard error in for example CI.
Core replaces the current standard lib and most of Belt, with one unified experienced that's built to look and feel more like the JavaScript APIs you're used to, while not sacrificing ergonomics.
Core replaces the current standard lib and most of Belt, with one unified experienced that's built to look and feel more like the JavaScript APIs you're used to, while not sacrificing ergonomics.
- First class regex syntax (previously needed wrapping in %re("<pattern>"))
- Remainder operator
- Use +, -, / and * for any number type, dedicated operators per type not needed
And more coming!
- First class regex syntax (previously needed wrapping in %re("<pattern>"))
- Remainder operator
- Use +, -, / and * for any number type, dedicated operators per type not needed
And more coming!
This allows you to refine variant types and easily match on a whole subset type without having to enumerate it.
This was always possible with polyvariants, and now also with regular variants.
This allows you to refine variant types and easily match on a whole subset type without having to enumerate it.
This was always possible with polyvariants, and now also with regular variants.