im not fucking sorry i needed this rant [[For Me, Not You]] worst programming lang
It's a terrible language, but given its status as the de-facto language of the web, it has an incredible ecosystem of tools developed to help out.
HTMX:: tools for seamless HTMl. The web should be more like this
Fantasyland:: Specification for algebra in JavaScript
Folktale:: A corresponding standard library
Staticland:: Fantasyland but without classes
Cosmiconfic:: Load configuration from anywhere
Lerna:: Manage JavaScript projects with multiple packages
Create React App with Babylon and TypeScript React for Babylon
Phaser:: 2d game framework
https://github.com/davidkpiano/flipping :: flipping animation https://github.com/davidkpiano/xstate :: state machines for the web
Acorn:: js parser in js
The compiler for Javascript. Babel macros
Hardcore config functional config
https://github.com/apollographql/eslint-plugin-graphql:: graphql support
https://github.com/gajus/eslint-plugin-sql :: sql support (kind of)
https://github.com/azeemba/eslint-plugin-json :: json support
https://github.com/Bkucera/eslint-plugin-json-format :: json autoformat
https://github.com/mysticatea/eslint-plugin-node :: nodejs rules
https://github.com/BenoitZugmeyer/eslint-plugin-html :: eslint for raw html
https://github.com/dustinspecker/awesome-eslint :: eslint resources
ImmutableJS: Immutable data structures Ramda: Better JS functional programming Typescript with these two is the de factor pure programming ecosystem
Organice:: Org mode without emacs automerge:: a CRDT that allows concurrent modification Turbolinks:: framework agnostic way of rendering views on server side and swapping in throuhg a socket tty.js:: terminal for the browser sanctuary:: strict javascript functions composed functionally https://github.com/sindresorhus/speed-test cli for speedtest.net https://github.com/calmm-js/kefir.atom :: reactive state with lenses https://github.com/spcask/mdme :: embed self rendering md content https://github.com/inkandswitch/cambria bidirectional lenses https://github.com/padenot/ringbuf.js ring buffers https://github.com/typeorm/typeorm/blob/master/README.md super flexible js and ts orm that runs anywhere phantomjs browser control excellent article on javascript generators https://ionicframework.com/react apps everywhere with single react code base? seems too good to be true https://github.com/kach/nearley javascript parser toolkit
an excellent resource on conflict-free replicated datatypes https://github.com/sweet-js/sweet-core https://github.com/replit/clui build quick cli apps with js https://github.com/atom/node-spellchecker
automating with nodejs advanced javascript optimizer https://github.com/calmm-js/partial.lenses lenses in javascript
manage js project with multiple packages alloyjs browser based visualizations https://github.com/vercel/serve static file listing and serving denosecure js runtime type safe ui library for purescript
read directory content into an object Parsing in JavaScript: all the tools and libraries you can use Parsing in JavaScript: Tools and Libraries Native mobile apps with Angular, Vue.js, TypeScript, JavaScript - NativeScr Deep JavaScript: Theory and techniques Chess programs in C, Java and Javascript, also 8080 emulator javascript is so hard to use now! https://nh2.me/ host gpg key on my website like this person does. i also like the 'tell me something' button with the hidden (black on black) text!
http://www.jsfuck.com/ cool scroll! https://codepen.io/DonKarlssonSan/pen/abNjZaQ https://healeycodes.com/creating-randomness/ https://www.edwinwenink.xyz/https://technomancy.us/184 https://snufk.in/blog/ssg-1.html https://hao-w.github.io/ https://leosaenger.com/ https://github.com/xiaohanyu/understanding-modern-frontend https://www.linkedin.com/in/leosaenger/ https://aaronweiss.us/posts/2014-06-04-write-up-l1.html Floating island /w Threejs & GSAP JavaScript End to End Testing Framework | cypress.io
https://news.ycombinator.com/item?id=24259688 using xpath for js
[2019-09-29]
Practical Ways to Write Better JavaScript - Stack Overflow Blog [2020-03-13]
Wes Bos on Twitter: "π₯ Optional Chaining (deep property checking) is now in Chrome, Firefox and babel-preset-env 7.8.0. This is a huge improvement in checking if nested properties exist! https://t.co/ypmHeQ8rGw" / Twitter [2019-11-10]
fuck, replace
only replaces first occurence if string is used?? [2019-07-14]
Enabling Async/Await and Generator Functions in Babel and Node JS [2019-07-14]
javascript - Is it safe to use async/await now? - Stack Overflow [2020-11-10]
javascript - Is async await truly non-blocking in the browser? - Stack Overflow [2020-03-10]
Why Svelte is our choice for a large web project | Hacker News [2019-06-30]
Implementing infinite scrolling : reactjs [2019-08-01]
google chrome extension - Injecting iframe into page with restrictive Content Security Policy - Stack Overflow [2020-05-02]
Patching an NPM dependency without going completely insane [2019-08-18]
stidges/jquery-searchable: Tiny, fast jQuery plugin to search through elements as you type. [[search]][2019-08-18]
flexsearch - npm [[search]][2020-01-30]
Svelte 3: Rethinking reactivity [2020-07-18]
javascript - Easiest way to sort DOM nodes? - Stack Overflow [[js]][2020-06-21]
A little bit of plain JavaScript can do a lot | Hacker News [2019-09-06]
A small trick on using console.log to print data in JavaScript | Lobsters [[js]][2020-06-05]
MaterialFuture: "Tried out DenoJS to play around with Vue and it wβ¦" - Merveilles [[js]][2020-04-02]
How to manage HTML DOM with vanilla JavaScript only? [2021-01-03]
IMO, long names like appendChild, getElementById, createTextNode, etc discourage use of vanilla js [[plt]] [[js]][2020-04-08]
antonmedv/codejar: An embeddable code editor for the browser π― [2019-08-28]
Flow vs Typescript /r/javascript [[flow]] [[js]][2019-09-01]
npm vs. yarn - which one and why? : javascript [2019-07-22]
things that js has: destructing objects, named arguments https://simonsmith.io/destructuring-objects-as-function-parameters-in-es6 [2019-01-04]
eslint is best apparently [[js]][2019-09-21]
addyosmani/es6-tools: An aggregation of tooling for using ES6 today [2018-12-13]
javascript - Inserting large quantities in IndexedDB’s objectstore blocks UI - Stack Overflow [2019-07-07]
Testing: Jest or Mocha? /r/vuejs [[js]][2019-07-07]
How to Fix JavaScript Callbacks Variable Scope Problems | Pluralsight | Pluralsight [2021-01-07]
vasturiano/react-force-graph: React component for 2D, 3D, VR and AR force directed graphs [[viz]] [[js]][2020-11-11]
Advanced features in Flow | sitr.us [2019-12-22]
BigInt Eilish π on Twitter: "@sveltejs Rewrote my Twitter search from React to Svelte @Reactjs 42kb Code: https://t.co/4fDXi7hqwG Site: https://t.co/Ync9baSs2n @Sveltejs 5kb Code: https://t.co/lD1gywleNp Site: https://t.co/pgmavoPLBy Had trouble w/ eslint/prettier, but overall much less code to write cc @wgao19 https://t.co/BthQ2I6C77" / Twitter [2020-06-04]
Show HN: Grid.js β Advanced table library that works everywhere [2020-07-21]
Show HN: Datagridxl.js β No-nonsense fast Excel-like data table library [2021-03-13]
Vanilla List β’ The Vanilla JavaScript Repository [[javascript]][2021-04-30]
Use console.log() like a pro - Marko Denic - Web Developer [[drill]] [[javascript]][2019-09-29]
Practical Ways to Write Better JavaScript - Stack Overflow Bloghttps://stackoverflow.blog/2019/09/12/practical-ways-to-write-better-javascript/
[2020-03-13]
Wes Bos on Twitter: "π₯ Optional Chaining (deep property checking) is now in Chrome, Firefox and babel-preset-env 7.8.0. This is a huge improvement in checking if nested properties exist! https://t.co/ypmHeQ8rGw" / Twitter<https://twitter.com/wesbos/status/1238468738946646017 >
Optional Chaining (deep property checking) is now in Chrome, Firefox and babel-preset-env 7.8.0.
This is a huge improvement in checking if nested properties exist!
[2019-11-10]
fuck, replace
only replaces first occurence if string is used??SCHEDULED: [2022-03-25]
http://www.datejs.com/ looks ok, supports fuzzy stuff like ‘next week’, ‘previous month’, etc
[2019-07-14]
Enabling Async/Await and Generator Functions in Babel and Node JSUncaught ReferenceError: regeneratorRuntime is not defined
I found this answer to my troubles and it worked when I implemented it. Just change .babelrc to the following:
{
"presets": [
[
"@babel/preset-env",
{
"targets": {
"node": "10"
}
}
],
"@babel/preset-react"
]
}
[2019-07-14]
javascript - Is it safe to use async/await now? - Stack Overflowhttps://stackoverflow.com/questions/42183155/is-it-safe-to-use-async-await-now
So depending on what you think is acceptable it is either safe or not safe. Note the following:
This question was originally asked on 2017, and we have come a long way so async/await is much more safe to use now.
By 2019, most mobile devices already support async/await.
Node 8 is released on May 2017 so it should be safe to use async/await on Node.js unless your Node.js servers are very outdated.
[2020-11-10]
javascript - Is async await truly non-blocking in the browser? - Stack OverflowPoints for the worker without an external file. That's one cool trick
[2020-03-10]
Why Svelte is our choice for a large web project | Hacker Newshttps://news.ycombinator.com/item?id=22534639
[2019-06-30]
Implementing infinite scrolling : reactjshttps://www.reddit.com/r/reactjs/comments/7z87o9/implementing_infinite_scrolling/
ssuming its only 100 items, i'd just display them all from the start, and let scroll do what scroll does. if you're trying to simplify a real world example where you might have 1000's of initially returned items, then something similar to /u/pqnst but instead of just slicing 0,(page * 20), you'd have to slice(20 * (page - 1), 20 * page) and account for the height of the sliced out elements in the scrollTop of the scrolling container
[2019-08-01]
google chrome extension - Injecting iframe into page with restrictive Content Security Policy - Stack Overflow[2020-05-02]
Patching an NPM dependency without going completely insanePeriodic reminder that `await import('//dev.jspm.io/[pkg]')` allows you to import anything from npm in the browser instantly. I often use this in the console to test things out.
<https://twitter.com/guybedford/status/1202022281633030145 >
[2019-08-18]
stidges/jquery-searchable: Tiny, fast jQuery plugin to search through elements as you type. [[search]]https://github.com/stidges/jquery-searchable
Tiny, fast jQuery plugin to search through elements as you type.
[2019-08-18]
flexsearch - npm [[search]]https://www.npmjs.com/package/flexsearch
[2020-01-30]
Svelte 3: Rethinking reactivityhttps://svelte.dev/blog/svelte-3-rethinking-reactivity
Svelte is a component framework β like React or Vue β but with an important difference. Traditional frameworks allow you to write declarative state-driven code, but there's a penalty: the browser must do extra work to convert those declarative structures into DOM operations, using techniques like
that eat into your frame budget and tax the garbage collector.
Instead, Svelte runs at build time, converting your components into highly efficient imperative code that surgically updates the DOM. As a result, you're able to write ambitious applications with excellent performance characteristics.
[2020-07-18]
javascript - Easiest way to sort DOM nodes? - Stack Overflow [[js]]By using list.children instead of list.childNodes, you can avoid the check for text nodes.
[2020-06-21]
A little bit of plain JavaScript can do a lot | Hacker NewsA bit more minified/modern version of this that I'm using:
function $e(t='div',p={},c=[]){
let el=document.createElement(t);
Object.assign(el,p);
el.append(...c);
return el;
}
var $t=document.createTextNode.bind(document);
[2019-09-06]
A small trick on using console.log to print data in JavaScript | Lobsters [[js]]https://lobste.rs/s/u2dyrr/small_trick_on_using_console_log_print
console.log("User(%o)", user)
console.table is also useful
faitswulff avatar faitswulff 3 hours ago | link |
Iβve started to use console.table for pretty much everything. Itβs so nice.
[2020-06-05]
MaterialFuture: "Tried out DenoJS to play around with Vue and it wβ¦" - Merveilles [[js]]Tried out DenoJS to play around with Vue and it was very pleasant to use.
I'm going to have to read more into it, but I think any personal JS projects will be using Deno simply due to the lack of dependencies and speed.
[2020-04-02]
How to manage HTML DOM with vanilla JavaScript only?[2021-01-03]
IMO, long names like appendChild, getElementById, createTextNode, etc discourage use of vanilla js [[plt]] [[js]]let util = require('util')
console.log(util.inspect(resp, {showHidden: false, depth: 1}))
[2020-04-08]
antonmedv/codejar: An embeddable code editor for the browser π―https://github.com/antonmedv/codejar
CodeJar honey_pot can be used via modules:
<script type="module">
import {CodeJar} from 'https://medv.io/codejar/codejar.js'
</script>
[2019-08-28]
Flow vs Typescript /r/javascript [[flow]] [[js]]Having used both (Flow for one very large project and TypeScript for a few less large projects) I am very much in the TypeScript camp now.
Firstly, DefinitelyTyped has vastly more library defs available than flow-typed, which matters a whole lot more than you might realize. It's pretty rare that `npm install @types/name-of-package` comes up empty.
Secondly, Flow feels slower and buggier; I use VS Code full-time and have found that TS reacts to code changes far more quickly and accurately than Flow (almost instantaneously across an entire project), and provides much more useful error messages (I lost count of the number of times I saw `merge_strict_job exception: Utils_js.Key_not_found("LeaderHeap")`, which I believe usually indicates a bug in Flow itself but is also completely useless and extremely difficult to debug). Of course I realize that TS and Code are both Microsoft products so it's not surprising that TS works better, but even in Atom with Nuclide I found that Flow was a bit slow to catch up to things, and still sometimes threw very cryptic errors.
Finally, TS has a pretty solid built-in compiler which tracks the official spec, and natively supports features like `async`/`await`.
To your original question, I'm currently working on a React-heavy project with TS and have found it to have excellent support. Flow works very well with React as well, which is to be expected since both come from Facebook. I think either would be a fine decision, but definitely feel TS has the edge in stability and speed.
[2019-09-01]
npm vs. yarn - which one and why? : javascripthttps://www.reddit.com/r/javascript/comments/ad6zoj/npm_vs_yarn_which_one_and_why/
npm has greatly improved since the original days of yarn. With lock files and better dependency tree management, I find very few reasons to use yarn nowadays.
I'd say use npm until you find a feature from yarn that requires you to switch. npm is included with every Node.js install.
[2019-07-22]
things that js has: destructing objects, named arguments https://simonsmith.io/destructuring-objects-as-function-parameters-in-es6[2019-01-04]
eslint is best apparently [[js]][2019-09-21]
addyosmani/es6-tools: An aggregation of tooling for using ES6 todayhttps://github.com/addyosmani/es6-tools#readme
[2018-12-13]
javascript - Inserting large quantities in IndexedDB’s objectstore blocks UI - Stack Overflow[2019-07-07]
Testing: Jest or Mocha? /r/vuejs [[js]]Jest is amazing! It is out of the box , takes way less time to run the tests than mocha. A small side note: If you're using a vue js app, you are going to want to take a look at [Vue Test Utils](https://vue-test-utils.vuejs.org/). Makes life so much easier. Also sinon.js for spies and fakes. PM me if you need tips and tricks to start with automated testing.
[2019-07-07]
How to Fix JavaScript Callbacks Variable Scope Problems | Pluralsight | Pluralsighthttps://www.pluralsight.com/guides/javascript-callbacks-variable-scope-problem
ECMAScript 6 introduces the let keyword which allows you to declare a variable scoped to the nearest enclosing block and not global like var does. Thus the closure problem can be solved simply by replacing var with let:
[2021-01-07]
vasturiano/react-force-graph: React component for 2D, 3D, VR and AR force directed graphs [[viz]] [[js]][2020-11-11]
Advanced features in Flow | sitr.us[2019-12-22]
BigInt Eilish π on Twitter: "@sveltejs Rewrote my Twitter search from React to Svelte @Reactjs 42kb Code: https://t.co/4fDXi7hqwG Site: https://t.co/Ync9baSs2n @Sveltejs 5kb Code: https://t.co/lD1gywleNp Site: https://t.co/pgmavoPLBy Had trouble w/ eslint/prettier, but overall much less code to write cc @wgao19 https://t.co/BthQ2I6C77" / Twitter<https://twitter.com/swyx/status/1208461215069945856 >
Rewrote my Twitter search from React to Svelte
@Reactjs 42kb
Code: https://github.com/sw-yx/bettertwitter/tree/reactapp
Site: https://inspiring-fermat.netlify.com
@Sveltejs 5kb
Code: https://github.com/sw-yx/bettertwitter/tree/master
Site: https://bettertwitter.netlify.com
Had trouble w/ eslint/prettier, but overall much less code to write
[2020-06-04]
Show HN: Grid.js β Advanced table library that works everywhere[2020-07-21]
Show HN: Datagridxl.js β No-nonsense fast Excel-like data table library[2021-03-13]
Vanilla List β’ The Vanilla JavaScript Repository [[javascript]][2021-04-30]
Use console.log() like a pro - Marko Denic - Web Developer [[drill]] [[javascript]]console.group() and console.groupEnd()
Creates a new inline group, indenting all following output by another level. To move back out a level, call groupEnd().
console.time() and console.timeEnd()
console.time() β Starts a timer with a name specified as an input parameter. Up to 10,000 simultaneous timers can run on a given page. console.timeEnd() β Stops the specified timer and logs the elapsed time in seconds since it started.
JavaScript (or js) is the primary programming language interpreted by web browsers. That is, it runs on the client’s browser rather than on a backend server.
Rendering context...