> You can write performant JS manually too, but it takes a lot of experience and discipline.
There are a lot of times I specifically write less performing code for clarity... Unless it's a real world performance issue in a given use case. To me, TS is a lot like testing, it guides you into thinking things through. Writing testable code, and having a disciplined directory/feature/module structure helps a lot too.
What it comes down to for me... I prefer JS over say C# for even server-side development. Mainly because the lack of typing enforcement and flexibility. If I'm using TypeScript, I may as well be using C# even if it's costing me in terms of time and velocity.
Rehash of some prior reporting. Also, I wouldn't consider Go that similar to C.
What's interesting is the uptake in TypeScript ... personally, I don't like taking the time to enforce all the typing over JS. But I do see the appeal.
In most of my projects, I compose a "base.js" that brings in settings and environment configuration. It attaches to a global of __BASE__ … I then have another base.js inside my project that maps and exports portions out of __BASE__ for other portions of my project to use. This way I can test those pieces separately and __BASE__ is never part of my source maps.
I have a separate config/settings project that composes yaml files for deployment(s) into configuration JSON ... this is combined server-side to response to a request for `/base.js` which injects the appropriate values for the application as loaded.
Been using the redux hooks for a project, and really been enjoying it. My actions modules are exposing a default useActions that wraps useReducer, useMemo and bindActions which keeps the action bindings with the actions instead of each component, which has been really nice.
import { useMemo } from 'react';
import { bindActionCreators } from 'redux';
import { useDispatch } from 'react-redux';
...
const doSomething = (input) => ({ type: 'sometype', ... });
...
...
export default deps => {
const dispatch = useDispatch();
return useMemo(
() =>
bindActionCreators(
{
doSomething,
...
},
dispatch
),
deps ? [dispatch, ...deps] : [dispatch]
);
};
Irked that the React Material Admin[1] project doesn't link to the github source.. but the flathub page that kind of hides it. Also, material-ui[2] in and of itself is probably the single best component library for any web platform.
[1] https://github.com/flatlogic/react-material-admin
[2] https://material-ui.com/
Been using the redux hooks for a project, and really been enjoying it. My actions modules are exposing a default useActions that wraps useReducer, useMemo and bindActions which keeps the action bindings with the actions instead of each component, which has been really nice. import { useMemo } from 'react'; import { bindActionCreators } from 'redux'; import { useDispatch } from 'react-redux'; ... const doSomething = (input) => ({ type: 'sometype', ... }); ... ... export default deps => { const dispatch = useDispatch(); return useMemo( () => bindActionCreators( { doSomething, ... }, dispatch ), deps ? [dispatch, ...deps] : [dispatch] ); };