5 ms·
I feel like this sort of organic growth (for typescript) is a very healthy sign for a project. ES6 (or whatever we’re supposed to refer to it as now) is good e
by shadowmint 8y ago
I feel like this sort of organic growth (for typescript) is a very healthy sign for a project.
ES6 (or whatever we’re supposed to refer to it as now) is good enough for many things, but when you see it used heavily with, for example, proptype hints... you get the feeling that there really is a trend these days towards flavoring static type checking and the error checking that offers.
I think its an interesting shift, with python and javascript both being poster child dynamic languages, but people who use them seriously going... ‘yeah, type checking is actually pretty handy...’.
- lugg 8y agoI feel like for production I would want a clean upgrade path to whatever JavaScript implements in the future. Can typescript and code converters provide this? (The article sort of touched on it.) Sadly, standards seem to be sitting on their thumbs with weak excuses - people doing it different ways therefore we do nothing. Just take the larger market share compiler, add a few handy features from others and call it a day. https://ecmascript-daily.github.io/pages/status-of-static-typing-in-ecmascript/ https://ecmascript-daily.github.io/pages/status-of-static-ty...
- whatever_dude 8y agoOne of the goals of Typescript is to be closer to what JavaScript _will be_, rather than create something new. You won't see chunks of code that need to be rewritten. That said, yes, you can compile TS to JS with no ecmascript compatibility constructs to just remove types and essentially "eject" TS into JS.
- EE84M3i 8y agoSorry if this is a well known term but what is a "proptype hint" in this context? I can't seem to find any references for '"proptype hint" "javascript"' or any variations that come to mind on Google. Edit - changed previous sentence to "proptype hint". I originally erroneously read the parent as saying "prototype hint" which I couldn't find results for, but even after correcting my reading error my question still stands.
- MBCook 8y agoI believe they’re referring to the PropTypes Library that grew out of React. It’s extremely limited in scope compared to something like TypeScript, but it does give you some benefit. https://www.npmjs.com/package/prop-types https://www.npmjs.com/package/prop-types
- acemarke 8y ago`PropTypes` are a library for runtime type checking of props for React components. It was originally part of the React core, but split out into a separate library with React 16. PropTypes are used for a combination of debugging during development ("you accidentally passed a string instead of a number", or "you forgot to include a required prop"), as well as documentation for a component. React devs have traditionally used PropTypes to act as readable documentation of a component's expected props, and there are tools that can extract PropTypes usages and generate documentation files. However, with the rise of TS and Flow as static type systems, the need for a runtime-based type checker has gone down, especially since people using TS/Flow have probably already declared types for a given component's props.
- shadowmint 8y agogithub.com/facebook/prop-types is the 2nd google search result for this term, and is what I was referring to, although the first result (devhints.io/react#property-validation) is arguably a better summary. Ie. ‘lite’ type checking, used in react. (did you perhaps see the results for ‘javascript prop type hint’ as a google autocorrect suggestion or something? This is a well known term, but I’m pretty amazed two seconds of google didn’t discover what it was...)
- rounce 8y agoI read it and thought you were referring to something related to some proptype based code completion. The use of 'hinting' threw me off completely, especially when you're talking about checking & validating.
- EE84M3i 8y agoYes I found the prop-types library, but it doesn't include the word "hint" and I couldn't find any documentation that did. I assumed there this was an obscure term of art you were refering to.
- h1d 8y agoAt this point I feel JS won't have to evolve much unless some useful feature needs JS itself to be extended but let AltJS take care of usability and just concentrate on rock solidness, performance and portability between runtimes and developers can just use whatever shiny new version they want to use that runs on old but battled tested runtime without waiting for the whole internet to upgrade.
- jeremyjh 8y agoThat isn't going to happen with Typescript. Aside from the type system, Typescript won't be implementing new features until they are in the ECMAScript standard.