JavaScript Icon

JavaScript

JavaScript is an object-oriented programming language used alongside HTML and CSS to give functionality to web pages.
610 Stories
All Topics

Shlomo Kraus github.com

Mockshot – automatic mock generation from snapshot tests

We made a silly joke on Twitter yesterday (this is what Twitter is for, no?) about test doubles and that unfortunate moment when they inevitably surprise you. This prompted Shlomo Kraus to reach out and tell us about Mockshot. In brief: Imagine you could: Never manually write a mock again Have a guarantee that your mocks are always valid Sounds nice! It works by using Jest’s snapshot tests output to generate mocks to be used in other tests. This is purposeful coupling, which seems like it could backfire in the long-run. However, the team behind the library has been using it for over a year and are still singing its praises. For more on their experience creating and using it, read this.

read more

Carmen Bourlon carmalou.com

How to version your service worker cache

Carmen Bourlon, writing on her personal blog: A browser will check in with a service worker every 24 hours and re-initiate the process, but only if there are changes. You might change your app’s CSS or JavaScript, but without a change to the service worker, the browser will never go and update your service worker. And if the service worker never gets updated, the changed files will never make it to your user’s browser! Fortunately, there’s a pretty simple fix – we’ll version our cache… Thanks to Carmen for this fresh take on service workers from an offline-first point of view. If you dug this, you might want to get on the list for her book “Let’s Take This Offline” — a book about service workers with a focus on helping users without a consistent internet connection.

read more

JavaScript github.com

Pika brings that nostalgic, 2014 simplicity to 2019 web development

Install npm dependencies that run natively in the browser… without a bundler! Pika’s mission is to make modern JavaScript more accessible by making it easier to find, publish, install, and use modern packages on npm. There’s a lot to digest here in terms of how it works (spoiler: Rollup), which packages you can use with it (spoiler: ESM required), and how it performs. On that topic: When served with HTTP/2, @pika/web installations perform better in production than single “vendor” JavaScript bundles and most custom dependency bundling strategies due to the comparable load performance + more efficient cache usage.

read more

Manuel Vila github.com

Deepr – an alternative to GraphQL?

Manuel Vila: What makes GraphQL so exciting is the ability to compose method calls, and Deepr is a way to achieve that and only that. Because everything else, we believe, would be better implemented somewhere else in the stack. Deepr is being built by folks who’ve been using GraphQL for awhile, love it, and have some ideas about how things might be even better by changing some key decisions. Worth a look, for sure.

read more

JavaScript gpu.rocks

GPU.js — GPU accelerated JavaScript

A JavaScript acceleration library for GPGPU (General purpose computing on GPUs) in JavaScript. GPU.js will automatically compile simple JavaScript functions into shader language and run them on the GPU. In case a GPU is not available, the functions will still run in regular JavaScript. Perform massively parallel GPGPU computations using GPU. Graceful pure JavaScript fallback when GPU is not available.

read more

Bits and Pieces Icon Bits and Pieces

Should I use Apollo for GraphQL?

The author’s answer to that question is a resounding, ‘yes’. The Apollo platform is an implementation of GraphQL that can transfer data between the cloud (server) to the UI of your app. In fact, Apollo builds its environment in such a way that we can use it to handle GraphQL on the client as well as the server side of the application. In this post, I will present some of the great reasons why Apollo is considered to be one of the popular choices for using GraphQL in JavaScript-based apps. He lays out what Apollo has to offer and then lists 6 advantages of using the Apollo Platform.

read more

Chris Garret pzuraq.com

Coming soon in Ember Octane

If you’ve been paying attention in Ember lately you may have heard the term “Octane” floating around here and there recently, and wondered what all the excitement was about. It may seem like a bit of a big deal - and that’s because it kind of is! Part 1 in a 5-part series covering: native classes, angle bracket syntax & named arguments, tracked properties, modifiers, and Glimmer components. Part 2 is out as well.

read more

Max Stoiber mxstbr.com

Why I write CSS in JavaScript

You might be on the fence with CSS-in-JS — especially after hearing from Rich Harris about Svelte on The Changelog #332. Max Stoiber writing on his personal blog with his take on the matter: Primarily, CSS-in-JS boosts my confidence. I can add, change and delete CSS without any unexpected consequences. My changes to the styling of a component will not affect anything else. If I delete a component, I delete its CSS too. No more append-only stylesheets!

read more

JavaScript whatisjasongoldstein.com

Help! None of my projects want to be SPAs

There’s a lot of wisdom in this post alongside some opinions that I find myself nodding along with: My strategy for dealing with the absurd pace of change in web development has been as follows: ignore 99% of it and see if it goes away. While we cover (and talk about) new technologies on a daily basis here at Changelog, that doesn’t mean we adopt everything that hits our radar. Given the hype cycle, it works pretty well. Mongo isn’t exciting anymore, Angular 1 is dead, CoffeeScript is obsolete, I haven’t heard a word about Meteor since it launched… These are all specific technologies. But what about the Single Page App pattern in general? Back in the early days of SPAs, some people argued that it would be faster to only pass the data you need as JSON than to render whole pages. Nearly a decade later, this is almost never true. He goes on to explain how he’s building a side project SPA-style and all the repercussions of that decision. Really insightful stuff here, please do click through and read for yourself.

read more

Rust swc-project.github.io

swc – like Babel, but 16-20 times faster (because Rust)

You can install swc (the speedy web compiler) from npm just like you’re used to, which will download a pre-built binary. That only works on mac (x64)/linux (x86_64)/win32-x64. For other environments, you’ll need the Rust nightly build. Supports ES 2019, JSX, and TypeScript out of the box. You might want to jump straight to the migrating from Babel section. 😉

read more

Bits and Pieces Icon Bits and Pieces

Understanding Service Workers and caching strategies

Solid tutorial on Service Workers: You can think of the service worker as someone who sits between the client and server and all the requests that are made to the server pass through the service worker. Basically, a middle man. Since all the request pass through the service worker, it is capable to intercept these requests on the fly.

read more

JavaScript eslint.org

Funding ESLint’s future

ESLint began as a side project 6 years ago and has grown into the most popular JavaScript linter in the world with over 6.5 million npm downloads every week. In short, we’ve realized that in order for ESLint to continue to grow and evolve, we need to get more organized and set up a way to fund ESLint’s development going forward. Today, we are happy to announce the ESLint Collective on Open Collective. Support ’em if you got ’em

read more

0:00 / 0:00