📣 Introducing MDXTS v1 📣
A new tool for building content and documenting libraries with MDX, TypeScript, and React.
Read about the release below and try it out today:
npm create mdxts
Introducing Restyle 🌈
A new CSS-in-JS library for React
- Zero-runtime
- Atomic class names
- De-duplicates styles
- Works in Server and Client Components
- Supports `css` prop
- Loads styles on demand
- Allows shipping CSS in NPM packages
📝 New article on how to get buttery layout animations using the FLIP technique in React 🧈⚛. We take a look at the nuances of this method as well as some resources at the end to help you get started!
I started an article about building an infinite Page component in Framer Motion over a year ago that I never published. Here's the Codesandbox until I get around to the article 🙃
Yesterday was my last day at Vercel. I'm extremely grateful for the opportunity to have worked with such a talented team pushing the web forward.
I've been struggling with depression the last few years and came to realize I wasn't doing the work I was truly passionate about.
Web development needs to get on SwiftUI's level. The dev experience is unmatched right now. With the right primitives you can actually be productive AND ship amazing apps.
I'm starting a new SwiftUI livestream series where I'll be prototyping a bunch of interactions. Let's start with a super simple workflow from
@figmadesign
- tomorrow 10:30am EST
MDXTS 0.16.0 was just released and it's the best version yet 🚀
The CodeBlock component was fully rewritten with minimal breaking changes and now exposes four new descendant components:
- LineHighlights
- LineNumbers
- Tokens
- Toolbar
You get all of the same type-checking and
📝 New post on building your own code playground 🤹♀️
Ever wonder how code playgrounds like Codesandbox or Codepen work? In this post, we'll dive into how to build a simple playground by bundling code with SWC and displaying it in a sandbox.
I firmly believe the confusion/frustration around CSS is because of shorthand properties. For instance, these are all the combinations for the flex property 😳. Writing out each property individually would be slightly more work and way more clear about what the code is doing.
Shipped a little library for locking scrollbars programmatically: npm i lock-scrollbars
The site is built with
@mdxts_
using the new CodeBlock line focusing and git provider link features ✨
It was also fun to test using JS Doc types and Tailwind 😎
GitHub Action cron jobs are _amazing_. Currently pinging a Figma file for changes, building icons when it does change, and then auto-committing changes into a generated PR 🤯
Happy New Year, everyone! 💫
Some personal news, I recently joined
@vercel
as a Software Engineer. Grateful to be working alongside such a talented group of folks and can't wait to see what this next year brings 🚀
TIL there is a media query that allows you to apply styles only to devices that support hover and now I wonder why this isn't baked in by default to the hover pseudo selector🤦♂️
I've spent the majority of my React career trying to solve the index problem in React since it deals directly with accessibility and layout.
If you don't mind possibly getting fired for using react internals, you can get the index from the fiber:
Here's a problem for you: Using React, how would you create a tree structure where nodes are assigned IDs like this that uniquely identify them and describe their relationship in the tree. Using context/etc, do not manually iterate over children
Excited to share that today is my first day with
@replayio
where I'll be helping lead visual debugging! 🎨🖼🔎📐. This is a problem space I've been deeply involved in throughout my career and am excited to go even deeper with a wonderful team and community! 1/3
I've gone through probably 100 iterations of layout APIs to come full circle back to a Stack component for layout 🙃. Love where it's at now though and feels like the ergonomics are super close!
I've been writing more isomorphic React components lately and just realized this is the easiest way to determine which rendering environment you're in:
I absolutely love
@reactjs
❤️. Once you have component APIs figured out, it's easy to write, easy to read, and easy to refactor. I don't want to write code any other way (at least for now 😛).
📝 New post about how Stack layouts are being used across the industry from design to development. This is part one of two, we'll look at how to implement this concept in a component in the next post!
📝 New post on getting started with
@figmadesign
webhooks. We learn how to set up a local webhook service that notifies us when team files are updated ✨
@sebmarkbage
We use a set of layout components at my work with similar APIs ColumnView, StackView, TileView, and WrapView. Numeric values are all scaled by 8 to adhere to an 8-pixel grid. Makes laying out views extremely easy.
Just wrapped up my holiday project! The holy grail for code examples:
💾 Server-side rendered
🗡 Shiki for highlighting
🏰 Enhanced with Monaco Editor on click
🕹 Live editable using SWC
Does anyone know if there are any plans for a JSX v2? Playing around with ideas today and think it would be neat to treat attributes like an object so you can work with them more naturally and reduce noise. Example:
If you haven't used no-scroll yet, you should check it out 😁. Really nice for modal backgrounds and other dimmed, focused tasks. It also gets rid of that ugly scrollbar jitter when triggering it on/off🤘 and it plays well with React 😛
You know how overflow containers don't span the entire scroll width and it results in weird shit like content getting cut off or padding not behaving as expected?
Let me save you hours of frustration and get you kudos with your designers:
✨ width: max-content ✨
Object.fromEntries is one of my favorite JavaScript methods for constructing and manipulating existing objects, especially when working with promises ⤵️
A week ago I released Restyle a new CSS in JS library for React.
It generates the most minimal amount of CSS possible and supports all of the new React features like Server Components and Suspense. You can even ship CSS styles for your NPM packages!
Check out all of the
My favorite part about the component model is it allows you to determine what the developer is doing. CSS will silently let you shoot yourself in the foot, but what if we had better erroring when we want it? Playing around with helpful errors when you want an explicit CSS grid:
I can't believe how easy it was to get
@popmotionjs
and
@brian_d_vaughn
's react-window working together 😍 I think lazy rendering for react-view-pager has been figured out now 🎉
Finally got a chance to play with the new React APIs. They're so simple! Huge thank you to the
@reactjs
team for all of the hard work on the latest release 🙏. I'm so excited for the future 🤩
Huge thank you
@gatsbyjs
and everyone that has made this the best dev experience ever ❤️. It's so freaking nice! I can't believe how easy it is to setup a fairly complex site in a couple of hours, AND it's server side rendered! 🎉
Framer Motion is so underrated. I've tried almost every frontend animation library and it's the best I've ever used. Since it's based on FLIP, it works with pretty much anything you throw at it. Your code stays declarative AND you get beautiful performant animations 🎩
Used the new Popmotion release as an excuse to revisit some old FLIP work. Finally got interruptible animations working! Going to release an article on the process next week 😁
It doesn't feel real that it's this easy to ship CSS alongside your React components now, but it is.
import { css } from 'restyle'
No extra build configuration required.
Y'all this is an AMAZING workflow. I can create a component in my Figma file, point to the layer in my NextJS app, save the file, and it's just there. Come to my React Finland talk on Monday if you want to find out more 😎
It's been almost three years since I started
@jsxui
. I've been working on it consistently nights and weekends since then and am ready to finally release the initial alpha version. May 28, 2023 👀
The autoFocus property is helpful for more than just focusing an element on page load. Here's an example in React using
@popmotionjs
PoseGroup + autoFocus to focus an input when it enters the DOM:
Started writing a post on Data Tables that's turned into three posts. We'll be covering using Grid for styling, accessibility, sticky headers/columns, and more 🙃
Huge thanks to
@kentcdodds
for his frontend masters course on ASTs! I finally realized it's just a big API and a bunch of Javascript. I already wrote my first codemod to upgrade an API at work 🙌.