You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A goal for Core is to provide a really solid developer experience. One important piece in doing that is providing good documentation, and good docstrings. For those who don't know, docstrings are the strings you prepend functions etc with to explain what they are. They show up via the editor tooling on hovering, auto completion, etc. Example from Promise.resi: https://github.com/rescript-association/rescript-core/blob/main/src/Core__Promise.resi#L11-L17
We will need help to do this. Crafting good docstrings takes time, and there's a fairly large API surface to cover.
Eventually, these docstrings will also be extracted and used for real documentation, via the doc extraction project that's in the works.
Current state
Array
AsyncIterator
Console
Date
Dict
Error
Float
Global
Int
Iterator
JSON
List
Map
Math
Null
Nullable
Option
Promise
RegExp
Result
Set
String
Type
Undefined
Symbol
BigInt
Intl Collator
Intl DateTimeFormat
Intl Locale
Intl NumberFormat
Intl PluralRules
Intl RelativeTimeFormat
Object
ArrayBuffer
BigInt64Array
BigUint64Array
Float32Array
Float64Array
Int8Array
Int16Array
Int32Array
TypedArray
Uint8Array
Uint8ClampedArray
Uint16Array
Uint32Array
WeakMap
WeakSet
DataView
Suggested format
Describe the thing in a sentence or two. Keep this short. Good to be inspired by MDN for example.
Write a ReScript example in code, inside ```rescript notation. This is important and I think we should aim to have this for everything it makes sense for.
Look up a module in the project that you want to start working on.
Generate a .resi file for the module, if it doesn't have one already. We aim for all modules having resi files, and to keep the documentation in there.
Write in this thread that you'll start working on said module.
Start working, and open a WIP PR. Commit and push often. This is so that others can pick up where you left off if needed.
I can recommend having the compiler running as you work on docstrings, and then use TempTest.res to get immediate feedback on your changes. Just use whatever you're working on and hover it in there and you'll see how the docstrings render immediately.
Editor integration
We want to make using Core an as pleasant experience as possible. Part of that is also that the editor tooling behaves the way we want it to with regards to docstrings etc. #3 this issue covers that, feel free to post things you discover in there.
Open questions
First off, please give feedback on the format, so we can ensure we cover everything we want to cover. Here are some additional open questions:
Should we suggest alternatives in the docstrings? This is particularly important for things like mutable APIs, like Map which binds to the native JS Map, where Belt.Map is an immutable alternative.
A goal for
Coreis to provide a really solid developer experience. One important piece in doing that is providing good documentation, and good docstrings. For those who don't know, docstrings are the strings you prepend functions etc with to explain what they are. They show up via the editor tooling on hovering, auto completion, etc. Example fromPromise.resi: https://github.com/rescript-association/rescript-core/blob/main/src/Core__Promise.resi#L11-L17We will need help to do this. Crafting good docstrings takes time, and there's a fairly large API surface to cover.
Eventually, these docstrings will also be extracted and used for real documentation, via the doc extraction project that's in the works.
Current state
ArrayAsyncIteratorConsoleDateDictErrorFloatGlobalIntIteratorJSONListMapMathNullNullableOptionPromiseRegExpResultSetStringTypeUndefinedSymbolBigIntIntl CollatorIntl DateTimeFormatIntl LocaleIntl NumberFormatIntl PluralRulesIntl RelativeTimeFormatObjectArrayBufferBigInt64ArrayBigUint64ArrayFloat32ArrayFloat64ArrayInt8ArrayInt16ArrayInt32ArrayTypedArrayUint8ArrayUint8ClampedArrayUint16ArrayUint32ArrayWeakMapWeakSetDataViewSuggested format
This example (and the rest in that file) is a good guide: https://github.com/rescript-association/rescript-core/blob/main/src/Core__Promise.resi#L11-L17
Workflow
I propose the following workflow:
.resifile for the module, if it doesn't have one already. We aim for all modules havingresifiles, and to keep the documentation in there.I can recommend having the compiler running as you work on docstrings, and then use
TempTest.resto get immediate feedback on your changes. Just use whatever you're working on and hover it in there and you'll see how the docstrings render immediately.Editor integration
We want to make using
Corean as pleasant experience as possible. Part of that is also that the editor tooling behaves the way we want it to with regards to docstrings etc. #3 this issue covers that, feel free to post things you discover in there.Open questions
First off, please give feedback on the format, so we can ensure we cover everything we want to cover. Here are some additional open questions:
Mapwhich binds to the native JSMap, whereBelt.Mapis an immutable alternative.