JavaScript Icon

JavaScript

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

JavaScript jrsinclair.com

Elegant error handling with the JavaScript Either monad

This is an absolute mindbender if you’re not already deeply in the functional world, but this post by James Sinclair is also a readable & fascinating look at how to incrementally move from a try/catch error management approach to a fully functional approach. In this article, we’ll assume you already know about function composition and currying. If you need a minute to brush up on those, that’s totally OK. And a word of warning. If you haven’t come across things like monads before, they might seem really… different. Working with tools like these takes a mind shift. And that can be hard work to start with.

read more

Amila Welihinda amilajack.com

compat-db determines the browser compatibility of ALL browser APIs

This tool aims to go above & beyond what MDN and caniuse have accomplished by automating the generation of the compatibility tables for others to use. Access to the output is programmatic, which scales to more developers via tooling such as static analyzers. Click through for a deep-dive on how it works (spoiler: browserstack is involved) and how Amila optimized its required test executions by 95%.

read more

React github.com

200 bytes to never think about React state management libraries ever again

Gotta love when a library is so small that Logbot can JIT inline it in the News and save us precious clicks… import React from "react" export interface ContainerProviderProps { children: React.ReactNode } export interface Container<Value> { Provider: React.ComponentType<ContainerProviderProps> useContainer: () => Value } export function createContainer<Value>(useHook: () => Value): Container<Value> { let Context = React.createContext<Value | null>(null) function Provider(props: ContainerProviderProps) { let value = useHook() return <Context.Provider value={value}>{props.children}</Context.Provider> } function useContainer(): Value { let value = React.useContext(Context) if (value === null) { throw new Error("Component must be wrapped with <Container.Provider>") } return value } return { Provider, useContainer } } export function useContainer<Value>(container: Container<Value>): Value { return container.useContainer() }

read more

Iain Reid github.com

Drowsy - The laziest REST client you'll ever see

This is the perfect tool for any prototype project or proof-of-concept application needing to integrate quickly with RESTful APIs, but it’s also ideally suited as a convenience tool in larger projects that too rely on RESTful interfaces. Just hand Drowsy a hostname for the API to consume and you’re off to the races. Just look how easy it is to get started with the Gists API: const github = drowsy(request, "https://api.github.com/"); github.getGists({ headers: { "User-Agent": "Octo-app" } });

read more

Electron electronjs.org

Electron 5.0.0 has been announced

Find out what’s new and what’s next with Electron. Much of Electron’s functionality is provided by the core components of Chromium, Node.js, and V8. Electron keeps up-to-date with these projects to provide our users with new JavaScript features, performance improvements, and security fixes. Each of these packages has a major version bump in Electron 5: Chromium 73.0.3683.119, Node.js 12.0.0, and V8 7.3.492.27. Electron 5 also includes improvements to Electron-specific APIs. A summary of the major changes is below; for the full list of changes, check out the Electron v5.0.0 release notes. So what’s next? Although we are careful not to make promises about release dates, our plan is release new major versions of Electron with new versions of those components approximately quarterly.

read more

Chris Coyier CSS-Tricks

Using Netlify functions to send emails with a JAMstack-style site

How do you send email from a JAMstack-style site? Chris Coyer writes on CSS-Tricks: Let’s say you’re rocking a JAMstack-style site (no server-side languages in use), but you want to do something rather dynamic like send an email. Not a problem! That’s the whole point of JAMstack. It’s not just static hosting. It’s that plus doing anything else you wanna do through JavaScript and APIs. Here’s the setup…

read more

Rich Harris svelte.dev

Svelte 3: rethinking reactivity

After several months of being just days away, we are over the moon to announce the stable release of Svelte 3. This is a huge release representing hundreds of hours of work by many people in the Svelte community, including invaluable feedback from beta testers who have helped shape the design every step of the way. Lots of folks (myself included) have been eagerly awaiting this release after Rich teed it up on The Changelog #332. We’d love to hear your first impressions!

read more

Matthew Rayfield matthewrayfield.com

Animating URLs with JavaScript and Emojis

Have fun in this rabbit hole. You can use emoji (and other graphical unicode characters) in URLs. And wow is it great. But no one seems to do it. Why? Perhaps emoji are too exotic for normie web platforms to handle? Or maybe they are avoided for fear of angering the SEO gods? Whatever the reason, the overlapping portion on the Venn diagram of “It’s Possible v.s. No One Is Doing It” is where my excitement usually lies. So I decided to put a little time into the possibilities of graphical characters in URLs. Specifically, with the possibility for animating these characters by way of some Javascript.

read more

Jeremy Wagner A List Apart

Responsible JavaScript (Part 1)

This pretty much sums up the point Jeremy is trying to get across with this post on A List Apart and the future parts to this story of “Responsible JavaScript.” I’m not here to kill JavaScript — Make no mistake, I have no ill will toward JavaScript. It’s given me a career and—if I’m being honest with myself—a source of enjoyment for over a decade. Like any long-term relationship, I learn more about it the more time I spend with it. It’s a mature, feature-rich language that only gets more capable and elegant with every passing year. Yet, there are times when I feel like JavaScript and I are at odds. I am critical of JavaScript. Or maybe more accurately, I’m critical of how we’ve developed a tendency to view it as a first resort to building for the web…

read more

Chi Wang deskgap.com

Deskgap — build cross-platform desktop apps with web technologies

Stop me if you’ve heard this one before…the difference is DeskGap leverages the operating system‘s webview instead of baking a browser in with it (like Electron). DeskGap is a framework for building cross-platform desktop apps with web technologies (JavaScript, HTML and CSS). To enable native capabilities while keeping the size down, DeskGap bundles a Node.js runtime and leaves the HTML rendering to the operating system‘s webview.

read more

0:00 / 0:00