4 ms·
If preserving the purity of JS is a goal it probably makes sense to not present examples in TypeScript. TS is awesome but if I know TS I know how to add types a
by have_faith 6y ago
If preserving the purity of JS is a goal it probably makes sense to not present examples in TypeScript. TS is awesome but if I know TS I know how to add types and if I don't know TS the examples become hard to follow (remembering from when I didn't know TS). I guess it comes down to your target audience but my assumption is Forgo is targeted more towards people who prefer "traditional" for lack of a better word JS concepts.
The biggest red flag I noticed was the use of the "rerender" function. It reminds me a bit of writing code in jQuery and manually having to keep track of when the DOM needs updating. Obviously not a huge burden for something small but would be very interested in how it effected larger apps. Seems like a big tradeoff to have to take on that responsibility again.
Saying that, the general API of the library is easy to understand and I could imagine being productive with it very quickly.
- jeswin 6y agoPoint taken on TypeScript, I'll clean up that example later today. Perhaps I should move TS to a separate section. I totally expected rerender to be a bit controversial. But if you look at React, the user does provide (strong) hints in the form of the setState() invocation - which could be done here as well. But then again, it's a tradeoff. Simplicity, and Python's Explicit is better than implicit.
- dfee 6y agoI disagree. At worst you can let a user switch between a TS / JS code block, but really we don’t want to hunt around your .d.ts files to discover what the docs should tell us.
- lux 6y agoOr make it a toggle instead of a separate section. I really appreciate being able to toggle between languages in API docs.
- eyelidlessness 6y agoI’d highly recommend keeping TS first class. There are components/tools available to group TS/JS examples in tabs and let the user consume whichever they prefer. (Forgive me for not linking I’m on phone and gotta run.)