How would people feel if everything was private by default in ReScript instead of the opposite?
Using a signature file to hide details feels cumbersome, especially since I often use this for React components. This requirement is necessary for fast refresh to work, and it all feels a bit backward to me.
What if ReScript had an export keyword like JavaScript? Then public information could be determined explicitly instead.
I think we are a bit hesitant to do such a big change after the massive “uncurried by default” change.
Other than that there are benefits in interface files concerning compilation speed. It’s basically the secret sauce for scalability.
That said I wholly agree that it’s not a great fit for everything that utilizes fast refresh. But I also think it is great for prototyping if you don’t need to export every single function separately.
I’d be happy with a private keyword instead of having to make a .resi file. I have gotten used to the .resi files, but it’s not super intuitive to JS programmers.
While I would prefer a “private by default” setting I mostly don’t care.
Sometimes I try to use the %%private approach, but my LSP doesn’t work for code inside. So I use a nested module to “hide” the functions etc.
Is it a known issue?
I’m using neovim with @rescript/language-server@1.58.0
cristianocon Apr 30, 2021
We need a better representation rather than apply reverse reconstructive surgery in the IDE.
I think that is still not improved, but nowadays as both the LSP and the compiler are developed alongside in the same repository, we might have a shot at this? @cristianoc@zth
Oh, right, forgot about those. I think the assessment @cristianoc has still holds - we should find a better representation for this instead. And yeah, I think we’re better off than ever to do that now that we’re getting our own AST.