Quantcast
Browsing all 1787 articles
Browse latest View live

Compile-step frontend frameworks and rescript

Will eliminating Vue SFCs allow seasmless integration? Vue components can be written like this: import { ref, h } from 'vue' export default { props: { /* ... */ }, setup(props) { const count = ref(1)...

View Article


Resi conflict when uncurried (v11)

I don’t know then. I actually also tried to use @@uncurried to gradually migrate our codebase to uncurried mode. But I failed because uncurried and curried code got mixed it and didn’t work well...

View Article


$$prefix from build output

in this case, should gentype respect the prefixed name? the name of the generated type is original(non-prefixed), but the js isn’t. Yes, it should. That sounds like a bug

View Article

"in-source" config bleeds into node_modules?

One useful trick is to register the JS modules as an exports entry in package.json. { "name": "my-package", "exports": { "./js-impl": "./src/path/to/impl.js" } } then you can use...

View Article

Weird error with module type

I’m getting this error and I do not understand why, made this minimal repro: module M: { let f: (~a: option<int>=?) => unit } = { let f = (~a: option<int>=?) => { () } } which gives...

View Article


Reasoning about "inheritance"

so i’ve been away from rescript for a while, delving into a typescript project for work for some time. coming back, i’m having a hard time getting back into the proper mindset. right now, i’m...

View Article

Weird error with module type

The sintax for optional arguments is different for signatures and actual implementation. You don’t specify the option part in the signature. module M: { let f: (~a: int=?) => unit } = { let f =...

View Article

Reasoning about "inheritance"

To start, an http server and a tcp server are two different things and probably have two different implementations, what are you trying to achieve my extending it?

View Article


Reasoning about "inheritance"

Incorrect inference about the “is-a” relationship is a pitfall of the class inheritance syntax. The HTTP protocol “consumes” TCP’s interface, not as part of it. In layered architecture, we call it...

View Article


Reasoning about "inheritance"

I mean this is an interesting discussion in and of itself, I guess you could theoretically build an UDP HTTP server. I still don’t think the “has-a” relationship is the correct way to go...

View Article

Reasoning about "inheritance"

it might actually be an incorrect understanding of the relationship between the two - it’s not like inheritance is not misused (by me and everyone else) in more object-oriented languages for the sake...

View Article

Rescript bindings for Graphql Codegen

Managed to get a initial plugin for @zth’s rescript-embed-lang up-and-running on a separate branch. Mostly seems to work, though it feels like I need to tweak the API a bit. Also need to ponder if...

View Article

A few small questions

Why doesn’t type inference work in this scenario? module M = { type t = {foo: string} } let a = [] let b: array<M.t> = a->Array.map(x => {foo: x}) It says the record field foo can’t be...

View Article


Image may be NSFW.
Clik here to view.

Rescript bindings for Graphql Codegen

Nice job! Open a PR and ping me and I can give some feedback if you want.

View Article

Image may be NSFW.
Clik here to view.

Rescript bindings for Graphql Codegen

Will do, once I’m done tinkering.

View Article


Reasoning about "inheritance"

Then you can use mixins for simple cases. The only difference is that there is no implicit dispatch table and you manage it yourself. module Circle = { include Shape let method = () => { let _ =...

View Article

A few small questions

Record fields are found based on being scope in the current module. If the field is defined in a nested module, then it is not in scope in the current module. You can follow the instructions in the...

View Article


Reasoning about "inheritance"

Thanks, I looked into that but it seems to be heavily discouraged. It works pretty well, except that you can’t e.g. add fields to types, so unless you want to manage any state whatsoever, you probably...

View Article

Reasoning about "inheritance"

IT related que. and information this post, Thank you!

View Article

Gleams use expression

The Gleam hype started and I was curious about some language goodies. While reading the language tour (a lot of similar stuff to Rescript), I stopped at the use expression. Use what? The use...

View Article
Browsing all 1787 articles
Browse latest View live