dedent
proposal-private-fields
dedent | proposal-private-fields | |
---|---|---|
3 | 7 | |
880 | 320 | |
- | - | |
6.7 | 0.0 | |
22 days ago | over 2 years ago | |
TypeScript | HTML | |
MIT License | - |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
dedent
-
All JavaScript and TypeScript features of the last 3 years explained
and so `dedent` would not strip any indentation. That is, `dedent` is meant to identify the maximal common leading indentation in the template as written by the developer, which should not depend on the values of the interpolands.
A stale GitHub issue on the dmnd/dedent repo has a real-world example where this matters and led to a subtle bug: https://github.com/dmnd/dedent/issues/22
-
I thought I knew what I was doing
There is also some other interesting use cases.
proposal-private-fields
- What do you mean by “encapsulation” / “hard private”?
-
All JavaScript and TypeScript features of the last 3 years explained
> - # private... not sure why they didn't just use the "private" keyword, but I don't care. I almost always use TypeScript anyways
One of the reasons was to allow private and public fields of the same name, so that subclasses are free to add own public fields without accidentally discovering private fields. There were many more considerations that went into the design: https://github.com/tc39/proposal-class-fields/blob/main/PRIV....
There was a heated debate about this and the choice of the # sigil back in 2015 at the time private fields were being designed: https://github.com/tc39/proposal-private-fields/issues/14.
-
why java developers always hate Node/javascript? why they don't face the truth that javascript now is not javascript year 1995?
The inability to correctly polyfill this, which still keeping the variables private, was a subject of debate in TC39. One of the explicit advantages of moving to a "soft private" model (as discussed here: https://github.com/tc39/proposal-private-fields/issues/33) was that it could be polyfilled correctly.
- Is TypeScript inevitable future of webdev or will it die out some day?
-
Do decorators have a future?
There was a long and thoughtful article explaining why the private keyword was not enough; but now I can't find it :-( Here's the best replacement I could find: https://github.com/tc39/proposal-private-fields/issues/14 Effectively, what they are saying, is that you need to be able, within a class method, to disambiguate whether you are dealing with a private field of an identically named public field, and the keyword doesn't help with this.
-
Implementing Private Fields for JavaScript
This is all covered here:
https://github.com/tc39/proposal-private-fields/blob/master/...
-
Implementing Private Fields for JavaScript – Mozilla Hacks - the Web developer blog
As well, the Issues section of that proposal repo, as well as the Issues section of the original Private Fields repo (before it was merged with the Class Fields proposal) contain lots of discussion about this topic.
What are some alternatives?
node-sql-template-strings - ES6 tagged template strings for prepared SQL statements 📋
proposal-class-fields - Orthogonally-informed combination of public and private fields proposals
core-js - Standard Library
javascript - JavaScript Style Guide
webpack - A bundler for javascript and friends. Packs many modules into a few bundled assets. Code Splitting allows for loading parts of the application on demand. Through "loaders", modules can be CommonJs, AMD, ES6 modules, CSS, Images, JSON, Coffeescript, LESS, ... and your custom stuff.
graphql-tag - A JavaScript template literal tag that parses GraphQL queries
type-fest - A collection of essential TypeScript types
html-es6cape - :zap: - Escape HTML special characters (including `)