Tagged “rescript”
-
De-Microsofting Your Development Environment
commentary javascript rescript toolingAnyone who has been following the web ecosystem over the last few years knows it has been rapidly consolidating under Microsoft. That consolidation economically threatens the open web. Diversifying your tooling could protect you as much as diversifying any investment, and it's much more convenient than you might think.
-
Continuously Deploying to GitLab's NPM Package Registry
devops gitlab javascript npm rescriptIn a previous article, we explored how to continuously deploy to the npmjs.com package registry. This is all well and good, but an advantage of CI/CD is that we can easily deploy wherever we want. This article will explore how to deploy an npm package to both npmjs.com and GitLab's own package registry, including how to change package names when necessary.
-
Writing Elm Ports in ReScript - 0.3
documentation elm rescriptThis is an update to a previous article following a breaking change in the
res-elm
binding. In short, theinit
function has been broken up intoinit
andinitWithOptions
to allow for Elm initialization flags and Elm web applications. Recently I've published an npm package called res-elm and put it into production on a couple of projects. It's documented briefly by its README, but I think it deserves a full post. This post will walk through how to set up ports both into and out of an Elm 0.19 project using ReScript.
-
Binding to a JavaScript Function that Returns a Variant in ReScript
javascript indexeddb rescript variantNote from the future: In the current year, none of this article is relevant anymore. Use Rescript's
@unboxed
attribute instead. It solves the whole problem I was trying to solve with this article, but much more cleanly. I will leave this article here as a historical record. ReScript provides easy ways to bind to most JavaScript functions in a way that feels both native and safe. Conveniently, it even provides an@unwrap
decorator for parametric polymorphism. However, there are a few places where we still have to fill in the gaps. This article documents how to bind to a JavaScript function that can return any one of several different types using ReScript variants.
-
Writing Service Workers in ReScript
bucklescript documentation progressive-web-app reasonml rescript service-workerDoes your SPA work fully offline? Would you like to define a caching strategy in an exhaustively type-safe way? If so, you might be interested in this Service Worker binding for ReScript (formerly BuckleScript / ReasonML). This article documents the binding by example, including two different caching strategies and a service worker registration example.
-
Setting Up Webpack for ReScript
bucklescript progressive-web-app reasonml rescript webpackAs much as I strongly prefer ES6 modules, using them with ReScript (formerly BuckleScript / ReasonML) and ServiceWorkers just isn't practical right now. I'm writing this article so that I can easily grab the configuration the next time I need it. This is a beginner's guide because I am a webpack beginner, and, well, everyone is a ReScript beginner right now.
-
Displaying Notifications in ReScript
documentation progressive-web-app rescriptThis article will serve to document and demonstrate the
rescript-notifications
npm package, a complete set of bindings for the JavaScript-compiling ReScript language (formerly BuckleScript/ReasonML). At the close of this article, the reader should be able to enable and display notifications in an entirely type-safe and functional way.
-
Writing Elm Ports in ReScript
bucklescript documentation elm reasonml rescriptThis is a post-rebrand update to my previous post, "How to Write Elm Ports in ReasonML." I rewrote the package in the new ReScript syntax so that people who aren't familiar with the old syntax can still read it. Recently I've published an npm package called res-elm and put it into production on a couple of projects. It's documented briefly by its README, but I think it deserves a full post. This post will walk through how to set up ports both into and out of an elm 0.19 project using ReScript.
-
Parsing JSON in ReScript Part III: Getting to the Point
bucklescript rescript reasonml monadAfter having established some requirements and some basic utilities, we're ready for the fun part: putting the pieces together. At the end of this post, we will have our working parser.
-
Parsing JSON in ReScript Part II: Building Blocks
bucklescript rescript reasonml monadThis is the second in a series of articles on how to build one's own, general-purpose parsing library. After having established a few expectations in the previous post, we are ready to begin building our utilities for our library. Let's start with some highly generalized utilities for functional programming.
-
Parsing JSON in ReScript Part I: Prerequisites and Requirements
bucklescript monad rescript reasonmlThere are few things more satisfying than a slick, readable, and safe JSON parser. It's one of the joys of functional programming. Using a good JSON parsing pipeline can feel like magic. This series seeks to lift the veil and empower readers (and, importantly, my future self) to build their own customizable and extensible parsing libraries. This article, the first of several, will be a skimmable introduction to the subject as I see it.
-
How to Upgrade from BuckleScript to ReScript
bucklescript emacs rescript reasonmlI have a weakness: I have never seen an update I didn't want to adopt immediately. Betas? No thanks. Give me the nightly build. New major version of the Linux kernel? I'll just run the installation without stopping to grab my charger. So when BuckleScript announced a whole new language syntax (along with a rebrand to "ReScript"), I got excited and immediately wanted to transpile everything. This post will document the simple process step-by-step.
-
ReScript: The Module or File Can't Be Found, Unabridged
rescript bucklescript reasonmlIf you work with BuckleScript, now ReScript, you'll likely come across the common build error message, "The module or file $name can't be found" followed by a few helpful suggestions for how to properly install a ReScript module. It's a good error message, but I've found it underestimates me in my ability to get things wrong, especially if I'm the one who wrote the missing module to begin with. I'm going to write a guide while one of these problems is still fresh in my mind so that I have a checklist to go through the next time I get frustrated.
See all tags.