22: Promise Accessibility with Ryan Florence
Chantastic talks with Ryan Florence about Reach UI and why accessibility is important for everyone. They discuss the balance of physical and mental activity, Ryan’s foray into programming and entrepreneurship, the inspiration behind his accessibility-first component library, and why none of us are really full-stack developers.
Featuring
Links
- reach.tech
- Reach UI — The accessible foundation of your React-based design system.
- Voice Over — The screen Reader built into macOS.
- NVDA — The screen reader typically paired with Firefox.
- JAWS The screen reader typically paired with IE11 or Edge.
- React Spring — Helping react-motion and animated to become best friends
- Gatsby v2 Announcement
- MDX — A format that lets you seamlessly use JSX in your Markdown documents.
- Tweet from Zack — "As someone who recently learned they're going blind, thank you. I never realized quite how important this work is until now and I regret not putting more effort into it in previous projects." — Zack
- Brent Jackson
Transcript
[00:00:06] Sponsor: This episode of React Podcast is brought to you by ReactTraining.com. In-person, hands-on training for development teams from React community leaders and experts. Visit ReactTraining.com to learn more.
[00:00:20] Michael Chan: Hi, this is React Podcast. I'm Chantastic. And today I am joined by Ryan Florence, good friend, megastar on the Twitter and in the open source community. Um, we're gonna talk about a lot of things, um, but first, how are you doing today, Ryan?
[00:00:43] Ryan Florence: I I am good. I just finished a workout. My body's still a little warm, so I'm gonna start sweating a lot during this conversation, I think. But fortunately there's no video.
[00:00:53] Michael Chan: That's exactly the mental image I think people were hoping for.
[00:00:56] Ryan Florence: I'm working hard writing open source, just sweating over here onto my keyboard.
[00:01:00] Michael Chan: What kind of workout are you doing these days? How are you staying fit?
[00:01:02] Ryan Florence: Uh, I do uh mostly P90X3, and then uh there's this beautiful little lake right by my house about a mile away, and I can just run out my front door and within like 15 seconds I'm in the woods. Uh, it's beautiful up here in Washington, and then I just run through some trails. And uh actually today, um, I ran around the lake and there's like there's like branches that are just the right height for pull-ups.
[00:01:29] Michael Chan: Okay, nice.
[00:01:30] Ryan Florence: So like whenever I see one of those branches, I do 10 pull-ups and then I keep on running.
[00:01:34] Michael Chan: Nature's gym.
[00:01:36] Ryan Florence: That's my favorite workout 'cause you're out there in nature and uh but you still still get a a good workout. But yeah, I I find I am really unmotivated if I'm not working out.
[00:01:46] Michael Chan: How do you feel like the working out, keeping your body in shape, translates into your ability to work? How have you noticed that?
[00:01:54] Ryan Florence: I think it has a little bit to do with like burnout and just sort of like coding fatigue. Like, you know how sometimes your brain is just mush? I'm just staring at my editor doing nothing now. Or like, anytime I hit a problem, I go straight to Twitter instead of like sit here and think about the problem. Um, but when I'm working out, I feel like it like resets that or something. Like, you do a lot of mental activity and then if you go and you do some physical activity, it like Uh, for me anyway, it helps me be able to, you know, stay motivated, think think more clearly about my code and and send the emails that I need to send and sign the contracts that I need to sign and uh all that kind of stuff.
[00:02:32] Michael Chan: You have a little more resilience to the world.
[00:02:35] Ryan Florence: Yeah, I don't know, there's just sometimes you look at your to-do list and there's so many, um, some, you know, and I didn't have this when I wasn't self-employed, but um, when you're self-employed, there's like There's just so many different tasks uh in addition to the code. Um, you know, like just this morning I was um I was reading through a non-disclosure agreement and then another one I was reading through a contract and like it just sometimes gets exhausting doing stuff that doesn't feel productive but is. And uh so when I work out, it kind of resets my ability to do the less exciting things. And then with the code, it helps me. More clearly about it.
[00:03:12] Michael Chan: That's funny because you see that a lot, this idea that engineers need to have this perfect kind of dust-free isolation chamber in order to do their best work. And how the most effective people that I know are people who are able to kind of assign a value to something, do it, and then be able to quickly shift over into another task.
[00:03:35] Ryan Florence: Yeah, and I find when I hit that spot where I'm having a hard time going to another task, it's like, okay, just go do a workout. And then I can come back and then I'm I'm ready to go again. Uh but no, my my days are best when I wake up early, spend some time just kind of uh thinking in the morning, reading, um do a workout, and then uh make a list of what I'm gonna accomplish that day, and then just go for it. And those days usually turn out really well.
[00:04:01] Michael Chan: Nice, nice. So this is your first time on the show. Um, I wanted to hear a little bit about how you got into programming, um, and I guess after that, how you came to React and what your experience was and why you've been such a fan of React since then.
[00:04:17] Ryan Florence: So I guess it really started when my dad invested in an ISP when I was a teenager. Uh, he gave some guy some money and the guy started an ISP and then uh, I got, you got your own little homepage back then, like It was fia.net and then /tilde/KCF. My dad's name's Casey, last name Florence, so our username was KCF. And so I could FTP stuff onto a home page right there.
[00:04:45] Michael Chan: Dang.
[00:04:45] Ryan Florence: And uh so I made a site called the Lurpy Llama where I I I posted the political musings of a 14, 15-year-old uh
[00:05:03] Michael Chan: What kind of political thoughts did you have at the time as a 14-year-old?
[00:05:08] Ryan Florence: You know, I don't really know. Or at least I don't want to say.
[00:05:13] Michael Chan: Well, you know, you had a great name though.
[00:05:15] Ryan Florence: Yeah, yeah. So I actually ended up with this Java applet thing on the left side that like when you hovered over the topics, It would like invert the colors from like this purple to yellow. It was it was pretty awesome. And uh for some reason, someone at Microsoft uh found my homepage and gave me an award.
[00:05:37] Michael Chan: An award? Like a plaque?
[00:05:40] Ryan Florence: Yeah, there were 10 there were 10 best homepages on some sort of thing. So I get this email from Microsoft that's like, hey, you just won the one of the spots in the 10 best homepages. And they gave me a $1,000 shopping spree at the new Microsoft Store online.
[00:05:56] Michael Chan: Holy cow.
[00:05:57] Ryan Florence: Yeah.
[00:05:58] Michael Chan: Dude, as a 14-year-old, that must have felt like a million bucks.
[00:06:01] Ryan Florence: Yeah, I think I was 15, but yeah, yeah, it was uh it was awesome. But it was on the Microsoft Store, so I could only buy stuff from the store.
[00:06:08] Michael Chan: Sure.
[00:06:09] Ryan Florence: Um, so I wanted to learn how to program, so I got got a Teach Yourself C++ in 21 Days book. bought a Visual Basic book, and then uh that was about $100 for those 2 books. And then I spent the other $900 on uh the Microsoft keyboard that was like bubbly, actually. Yeah, now the Microsoft Sculpt, but the first ones were really bubbly.
[00:06:32] Michael Chan: Yeah, I had one of those. I loved that thing.
[00:06:35] Ryan Florence: Yeah, that thing was awesome. And uh I bought 8 of those or 9 of those, kept one, and then uh sold a couple to some friends and then took a whole bunch of them back to uh some electronics store. I I wouldn't take them back, but like, you know, being a teenager, I didn't realize that I was stealing their profits by returning a product I didn't buy from them. And so then I ended up with like $900 or $800 in my pocket uh from the thing. So I converted the shopping spree into actual cash.
[00:07:04] Michael Chan: That's amazing.
[00:07:07] Ryan Florence: Um,
[00:07:07] Michael Chan: so even then you had a little bit of a kind of entrepreneurial prowess, like, I'm gonna turn this to cash as fast as possible.
[00:07:14] Ryan Florence: Yeah, always. Uh, in middle school, uh, right when I got to middle school, we had vending machines now, which was like mind-blowing coming from elementary school. And the, uh, the soda machine was- I can't remember the exact prices, but I remember that pizza and a cinnamon roll was $1.25. And so all these kids at no What was it? It was $1.55. That's right, it was $1.55. So all these kids were running around with 45 cents in their pocket, but you couldn't buy a soda for 45 cents. It was 50 cents. And uh I remember walking around with 45 cents in my pocket, like really mad that I couldn't buy a soda. And then like it hit me, like, oh man, I can just bring a bunch of soda to school and sell them for 45 cents. And so I brought this little cooler, put it in my locker, and I had like 2 six-packs. I had like 12, um, uh, sodas.
[00:08:12] Michael Chan: Oh my god.
[00:08:13] Ryan Florence: Sold them all the first day. And so then the next time I filled as many up as I could and then uh went to my English teacher and I was like, hey, can I bring in a big cooler? And she's like, uh, sure. Had like no clue what I was doing. And uh, so yeah, I ended up, I ended up making like $500 or something in a couple of weeks.
[00:08:31] Michael Chan: No way.
[00:08:32] Ryan Florence: Uh, or maybe a month or two. I can't remember the timeframe. And then, uh, and then the principal found out what was going on and shut me down.
[00:08:39] Michael Chan: You were undercutting her market.
[00:08:43] Ryan Florence: Yeah. Yeah. So yeah, I've always, I've always, my, my dad, my dad was, uh, he ran a company and so I've always just kind of imagined my career that way. So.
[00:08:54] Michael Chan: Yeah. If that was a movie, I feel like you would have been able to convince the principal that you really needed to sell them for 45 cents.
[00:09:02] Ryan Florence: Well, it ended up- there was like this funny line. I'd go grab my cooler and then I'd be sitting there at the end of the lunch table and there'd be all these kids like waiting in line to buy a soda from me. And then I'd come home and I'd go to the grocery store and like pick out some new ones. I'm like, oh man, Coke is selling like crazy. I'm gonna buy some extra Coke this time. Nobody's buying Sprite. Uh, so anyway, I tried the C++ book and on day 2 there was a calculator I was supposed to build and it didn't work. I kept getting this error. Double-checked my code over and over and over. And uh I realize now that the book had an error. Right? But as a kid, like, you think you just did something wrong.
[00:09:44] Michael Chan: Yeah.
[00:09:45] Ryan Florence: And uh and I gave up. I was like, ah, programming's not for me. Um.
[00:09:49] Michael Chan: All because of a bad editor.
[00:09:51] Ryan Florence: Yeah, I think so.
[00:09:53] Michael Chan: Yeah. Oh gosh.
[00:09:54] Ryan Florence: Um. So anyway, uh. I actually ended up getting a job at that internet service provider building websites for people. Um, but back then there was no CSS, there was no JavaScript, there was none of that stuff. And um, so you couldn't, you didn't need to know how to program to build a website. So I did that for a year as a kid. And then um, after college, so that was probably like 4 years after high school, 5 years. Um. didn't really touch programming or web development or anything, and then came back into it, um, because my wife needed a photography- for her degree for photography, she needed a portfolio, and it could either be online or printed. And we were super poor, and it was gonna be like $200, and we didn't have- like, we were barely affording toilet paper. She's like, well, don't you know how to make websites? I was like, uh, maybe. So I got back into it and uh started messing around with uh MooTools and uh just absolutely had a blast with that. Um and then uh Christoph, the Christoph who makes who develops Jest at Facebook, uh he was really involved with MooTools. And so anyway, he sent me this message and he was like, because I was publishing my MooTools uh plugins onto GitHub, and he's like, your code is so clean, we want to invite you into the MooTools uh dev channel in IRC. I was like, okay. And uh that's the last time anyone told me my code was clean. Um uh so anyway, got involved with MooTools and uh just really liked really liked the open source community. Those those developers in MooTools really taught me how to program. And yeah, I still kind of feel like I'm oriented uh in my development uh by what they what they taught me. And then from there? Got some jobs, worked at an agency, worked at a company called Instructure, kept being involved with open source stuff, did some, moved from MooTools to jQuery and then Backbone and then uh got really involved in Ember. Yes, then uh you asked what, how'd I get into React? Um, I was asked to speak at JSConf. I was there. 2014, you were, yeah, that's right.
[00:12:05] Michael Chan: That's right. The guy that kept
[00:12:07] Ryan Florence: drawing amazing
[00:12:10] Michael Chan: I feel like that was about the point where our uh our lives started to intersect. I'm totally shy by nature, so in order to have people come to me, I started drawing these drawings and posting them on Twitter with the with the hashtag. And yours your talk was one of those at um what JSConf, right?
[00:12:28] Ryan Florence: Yeah, and you uh I spoke at EmberConf like 2 months earlier.
[00:12:31] Michael Chan: Yep, yep.
[00:12:32] Ryan Florence: And you were at that one too, and they were just they were so cool. And what I was most impressed with was that like You actually got in your drawings like exactly what I was trying to say in my talks. Like you pulled out the points that I was like the most excited about and I was like, I like this guy. And then you were wearing yellow shoes.
[00:12:50] Michael Chan: My conference shoes. The drawing that I did from your talk at EmberConf is still my favorite one because you you had such a cool talk at EmberConf where you had the X-wing and you flew it out over the audience with a web controller. It was amazing.
[00:13:04] Ryan Florence: Yeah, it was uh it was an Ember component that controlled a drone and the component's name was X-Wing. Uh that ended up being how I interviewed people.
[00:13:14] Michael Chan: Really?
[00:13:15] Ryan Florence: For positions, yeah, uh 'cause I hate whiteboard stuff. Um and so we just go into a big conference room and then I drop the drone down and hand them a laptop or they could use their laptop and I'd say, "Build a remote control for this thing, here's the API." And uh it was it was cool. Yeah. Um there's a bunch of state that you got to manage and make API calls to the thing. And it was like, but it was super fun too. So you didn't feel like you were in an interview. Like people were intrinsically motivated to make this thing fly around.
[00:13:47] Michael Chan: Yeah.
[00:13:48] Ryan Florence: Rather than like try to impress me. And I was very clear, I'm like, I'm not really gonna judge the way this code looks or anything. Like we're just trying to make this thing work. And then we're gonna use the code to talk about like what you do and you don't like about it and uh how you might change it or whatever. But like this code is not what you're being judged on. We're just trying to make it fly and have some fun.
[00:14:08] Michael Chan: Man, what a great way to interview people.
[00:14:10] Ryan Florence: It was it was a lot of fun. I think I think interviewing people is what I miss most about uh being self-employed now. Um those those were fun. I really liked uh I really liked those. So anyway, at JSConf, uh they asked me to talk about all the front-end frameworks. So I gave a talk called Embularactomer Bone, and that was the first time I ever really tried React. I ignored it for the first year. Um, it's the first time I really tried it, and uh, it just it just clicked. I just loved it. It it it ticked a whole bunch of my boxes of things that I was getting frustrated with in front-end development. Um, I could just use plain old objects. I got to control when the page updated. Um, it uh, I got to just use JavaScript to express my UI. The first time I mapped over an array and returned a bunch of list items, I just like- little tears coming down my eye.
[00:15:00] Michael Chan: It's shocking, right? You're like, why has everyone been hiding JavaScript from me all this time?
[00:15:06] Ryan Florence: Yeah, I actually like this. Um, but there was no router. And I'd been using Ember. And Ember's router was really good.
[00:15:14] Michael Chan: Really good.
[00:15:16] Ryan Florence: So. I made one and showed it to some friends and then uh that's where Michael Jackson and I, where our relationship kind of started. We knew each other before, but um we started building React Router together, ended up building a company together, uh React Training. We did that together for 3 and a half years. Um Michael's still doing that and uh I've now broken off and I'm doing uh Reach.tech. So still doing workshops and online stuff. And open source, um, yeah, doing it under the new Reach.tech banner.
[00:15:50] Michael Chan: Reach.tech. So tell me a little bit about how that's different, what you're doing with uh Reach.tech.
[00:15:55] Ryan Florence: Um, so I've wanted to build uh a bunch of accessible components ever since I started doing React. And uh I've I just never made it a priority. So I would have done it if I kept my job at Instructure, but I left and started React Training. And I thought it was gonna happen there, uh but you just get so busy with all the things for running a business.
[00:16:23] Michael Chan: Yep.
[00:16:24] Ryan Florence: Um, and uh it just it just never happened. In fact, you can look at my my open source and it just kind of like trails off. You can like see when uh we started React Training, open source really slows down like crazy. Um, you know, 'cause I was uh making invoices, trying to get people to pay me, flying around the country, trying to get some marketing emails out, trying to sell tickets. Well,
[00:16:48] Michael Chan: you had a flagship product at that point, the you know React Router, which was kind of in symbiosis with the business.
[00:16:55] Ryan Florence: Yeah.
[00:16:56] Michael Chan: So it's kind of hard to just say like, hey, we're gonna take time from this and the business and make this new thing that may or may not work out for us.
[00:17:04] Ryan Florence: Yeah, exactly. And, um, and, uh, so yeah, so with, uh, Reach, um, you know, I'm probably, I'm probably gonna make less money than I was making before, um, but it's, it's just something I- you know, when you talk to artists, or when- not when, like, we've ever talked to, like, famous artists- when, when you listen to artists get interviewed, um, sometimes they talk about, like, I just had this image in my head and I had to paint it, I had to get it out.
[00:17:32] Michael Chan: Yep.
[00:17:32] Ryan Florence: Um, a lot of that is what's going on for me with this. Uh, and so I want to build uh this component library that's low level enough that design systems can build on top of it, uh but high level enough that you can pull it off the shelf and just use it as well. Um, and the accessibility is the first the first concern. Um, it's gotta be accessible. Because React is generally not very accessible. Not because of React. But because it's so easy, um, we don't look for third-party solutions for stuff. Uh, like like a dropdown menu is super easy to build just by yourself. You know, just with click handlers, click a button, set some state. If the dropdown's open- Something shows up. Yeah. Show a little a little div that's got some items in it, put some click handlers on those, and you're done.
[00:18:24] Michael Chan: Yeah.
[00:18:25] Ryan Florence: But back in the jQuery days, that was hard. And so we'd go and grab jQuery UI. We didn't know that jQuery UI was accessible. Uh, we just grabbed it because the job was hard.
[00:18:39] Michael Chan: Yeah.
[00:18:40] Ryan Florence: So I think I think we kind of have this thing going on in in React where React apps are less accessible than the apps that they replaced. Um, not because React is inaccessible, but because developers are like so productive with it, but they don't know about uh the accessibility requirements of a lot of these little components. So I want to I want to build a library that people can grab and uh it's just gonna have accessibility baked in. And so the the hardest the hardest job of this is going to be marketing and getting people to actually use it um instead of just rolling their own. Yeah. But if we can all all focus on one set of components, we can make we can give React like this incredible accessible base. Um, and I think it'll be I think it'll be good.
[00:19:22] Michael Chan: Yeah, so we've talked about this project a little bit, and it it sounds like you're providing a very high-level API for people who just want to basically have a dropdown component that they throw in there. But then you're also providing very low-level APIs so that it can be— um, so that all the library is doing is thinking about accessibility And you can control styling, uh kind of animations, and different types of interactions all app side. Is that right?
[00:19:51] Ryan Florence: Uh yeah. And there there's not a whole lot of really low-level API. Like for the most part, um for the most part, the API that you would use off the shelf or that you would build on top of uh is going to be the same. Uh but there are some weird cases where you'll need to drop down a little bit lower. Like if you want to animate a dropdown menu opening and closing, uh you you'll need to drop down a lower level. But um you still got to keep keep things kind of high level. It's a it's a really tricky balance.
[00:20:21] Michael Chan: Yeah.
[00:20:22] Ryan Florence: Um because if you go too low level, then you can't actually handle the accessibility concerns automatically for people. You know, they're gonna have to place the right attributes. They're gonna have to place the handlers. Or they might miss a role on an element. If I don't actually render an element, they might use an anchor instead of a button. And not add all of the things that you need for that. So-
[00:20:47] Michael Chan: So, then you could be in a place where you're using this thing and thinking that you're getting accessibility and kind of shooting yourself in the foot.
[00:20:54] Ryan Florence: Yeah. And so, so, I'm I'm avoiding that flexible of an API. Um, because I I don't I don't want any foot guns, as we call them. Um, yeah, low enough that you can do all the animation you need to do. You know, like Material UI is a really uh really rich uh UI paradigm. What do you call it? I don't know.
[00:21:17] Michael Chan: They got a lot going on.
[00:21:19] Ryan Florence: Lots of animations. Yeah. Lots of effects. And uh I I need an API low enough level to allow something like that to be built on top.
[00:21:29] Michael Chan: I see.
[00:21:30] Ryan Florence: But in in general, in general, it just means you pull in a component, throw a class name on it, and you can style it. Or pull in a component, use emotion, and wrap it uh in uh in the style template tags. Um it it should feel like um styling any other element in in the on the web.
[00:21:50] Michael Chan: Yeah. Now, I know that there's kind of two competing ideas in this space. Um I know that React Native for web is kind of targeting multiple devices, so the web and native, and in a lot of ways going away from the natural accessibility grain of web UI elements. And obviously that's a different problem, but this is focusing- or Reach UI is focusing exclusively on the web right now.
[00:22:19] Ryan Florence: Yeah, it's just just web. Uh, you go and- I mean, React Native is awesome, Uh, it's a lot of fun to work with and it's it's changed a lot of organizations for the better. Um, but if you go look at the npm download stats, it's just it's not even, it's like a little blip compared to React DOM.
[00:22:40] Michael Chan: Interesting.
[00:22:41] Ryan Florence: Um, and so uh while while I think that's I think those are really cool projects and and really neat uh uh I guess architecture goals. Um, I just I just want to focus on the web because there are just so many people out there who are not trying to use the same code on native and web. And you know, to me, that's like a- for me personally, that I think that's cool just for just as like an engineering achievement, right?
[00:23:11] Michael Chan: Yeah. Yes.
[00:23:12] Ryan Florence: Um, I don't think that generally. I think for organizations, it's not just like you're just doing this because you're an engineer and want to do it. I think it solves real problems for them. But for me personally, my only interest in that is it just seems like a really cool thing to do. Mm-hmm. But uh pragmatically, there are just so many React apps on the web that are inaccessible that uh that's that's what I'm trying to trying to uh handle. And I mean, probably not React Native Web, but uh other design systems that target both platforms, they could still build their web versions of these components on top of Reach UI.
[00:23:52] Michael Chan: Oh, interesting.
[00:23:53] Ryan Florence: Right? Because because what you want is like a a a tabs component that you can use in both places.
[00:24:00] Michael Chan: Mm-hmm.
[00:24:01] Ryan Florence: But they're not gonna be implemented the same.
[00:24:03] Michael Chan: Sure.
[00:24:04] Ryan Florence: You know, because the accessibility concerns on native are are totally different than on the web. So so you're going to the code is going to branch. It's just that top level that uh looks the same. So you could still you could still build one of those kinds of design systems on top of Reach UI, I think.
[00:24:19] Michael Chan: It'd be interesting to explore.
[00:24:21] Ryan Florence: It'd be really cool too if you had a whole sketch library and you're rendering them into there. And
[00:24:29] Michael Chan: yeah, there's so many there's so many targets right now. It feels almost intractable to to do something that targets all of them.
[00:24:36] Ryan Florence: And that's the thing is I'm I'm just looking at the web like, hey, we've got a problem here. Every- almost every design system that I get linked to. So so I tweet a lot about Reach UI lately, and every time I tweet about it, I get replies. They're like, oh, have you looked at this library? Have you looked at that one? Have you looked at this one? And uh every time it only takes me like 5 seconds to go and break the thing with a keyboard, just just by trying to navigate with my keyboard and open the dropdown and move through the items. It'll be broken or it'll work. But I go and I look at the ARIA attributes and they just aren't even there. Yeah. And uh and so, yeah, we've we've got a we've got this thing where everyone is building all of these components, but um we don't have an accessible base to build them on. Man, wouldn't it be cool if React just came with those things? You know, that's kind of what I'm after. Is like this should feel like it just comes from React. All of these components that exist on the web but don't exist in HTML. Now they're gonna exist in React and you can build on top.
[00:25:40] Michael Chan: That'd be really cool. So how are you writing this? How are you testing? How what does your development cycle look like when you're trying to make sure that it doesn't work on a screen?
[00:25:50] Ryan Florence: So a lot of people probably disagree with me on this, but I write tests really late in the game. So there aren't really any tests yet, like real tests. And so right now, just just building the thing, making sure I get the API the way I want it before my tests like overcommit me to an API. Um, and then uh to test that they work, um I actually, at a previous job, I would spend 15 to 30 minutes every morning uh with my screen completely dimmed And I would use a screen reader to check my email, browse Twitter.
[00:26:28] Michael Chan: That's crazy.
[00:26:29] Ryan Florence: You know, you know, the morning thing that you kind of do as a programmer, I'm gonna check Hacker News or whatever. I don't check that, that place tells me that I'm an idiot. But um, I would do that for, you know, 15 minutes or a half hour every morning just to learn how to use a screen reader. Um, and so as I build these components, um, I uh I develop them in Chrome with Storybook, which is really cool. And then um when I think I've got it uh pretty well uh done, uh then I'll pop it open in Safari and use VoiceOver and uh navigate with the keyboard and listen to the screen reader. And then uh pop open my Microsoft Surface Book and uh open up Firefox and NVDA. Okay. It's a V as in like at the end of the alphabet, not a B. So NVDA uh is a screen reader for Windows that usually people pair up with Firefox. And so I'll pop that open and use it in there. And that's- oh man, trying to get it to work in both VoiceOver and NVDA. Uh well, and then and then there's JAWS too, which is probably one of the most popular ones, J-A-W-S. And usually pair that up with Internet Explorer or Edge, um and then test it in there.
[00:27:44] Michael Chan: So there's a pretty big disparity between those 2 or 3 screen readers then?
[00:27:48] Ryan Florence: Uh, yeah. I mean, not not big, but big enough. Like on the web, it's already so crazy with the CSS quirks and uh all that kind of stuff. So it's just more of that. Um, like uh for example, I just built uh these alert components. You know, people, like something happens, you send an email in Gmail and a little thing pops up that's like uh message sent down at the bottom.
[00:28:14] Michael Chan: Undo for 30 seconds.
[00:28:16] Ryan Florence: Yeah. Or like Twitter when you like decide not to post the tweet and then it just drops down like— uh I don't know. There's always this drop down in Twitter that covers up the text box and I'm like waiting for an hour to- anyway. So those little alerts, um they show up on the page and other places where a screen reader user is not looking with their virtual cursor. And so they don't know that anything even happened.
[00:28:44] Michael Chan: Interesting.
[00:28:45] Ryan Florence: Um, and so uh what you need to do is uh let the screen reader know, hey, something happened, and then either interrupt uh what the user is doing and tell them about it, or wait until the user's idle and then tell them about it. So this alert component, you can render an alert just like you normally do visually. But uh it will automatically announce to the screen reader that something happened. And uh with the discrepancies between screen readers, uh it's working great in Safari and VoiceOver, and it announces the thing uh correctly. But over in NVDA, even though I have all the right attributes that I'm supposed to have on it, it reads um it reads the thing twice.
[00:29:32] Michael Chan: Oh.
[00:29:33] Ryan Florence: So so sometimes it'll be like, oh, if you put role alert and then aria-live assertive, um then in NVDA it reads it twice. But if you remove the aria-live assertive, which is the default, but if you remove that thing, then it only reads it once. But over in Safari, um if you don't have it on there- anyway, it's I can't remember all the details of this bug, but Um, yeah, just funny things like that where like different combinations of attributes will cause the screen reader to do slightly different things. And uh it it can it's just more more of uh what makes the web unique.
[00:30:10] Michael Chan: Oh, absolutely. Absolutely.
[00:30:13] Ryan Florence: It's why we love it.
[00:30:14] Michael Chan: Well, there's that interesting tension too between having a library that makes things so easy for so easy for us to put things on the screen, but then also that responsibility that we gain now of really having me think about accessibility because it is important. You know, a friend of mine kind of put it this way. He went to a national park, and it's one of the the first national parks to be fully accessible, and he was realizing that isn't just a promise for other people, but that's a promise to him in the future that, hey, you will always be able to come back to this park, you know, when your legs don't work, when your eyes don't work. Like, this park is always accessible to you. And so often we forget that it's not just for somebody else, it's for us.
[00:30:57] Ryan Florence: Yeah, I'm trying to pull up a tweet here. Yeah, here it is. Uh, this guy, @ZachRIP_ on Twitter, tweeted at me uh yesterday. Yeah, just yesterday. As someone who recently learned they're going blind, thank you. I never realized quite how important this work is until now, and I regret not putting more effort into it in previous projects. Yeah, that's uh that's really insightful of you that it's it's not just like- it's a promise to me in the future. I like that. Yeah, it's uh the other thing that I think about is— um so I used to work with um a blind uh front-end developer named Aaron Cannon. Amazing developer. I loved working with him. And uh it blew me away just how inaccessible so many of like internal company things are. You bring in Slack. at first was like really terrible at accessibility. I haven't looked at it lately. I know that they've worked really hard at it, so it's probably pretty good now. Um, but he couldn't use it. Um, our HR software, um, where we had to go and- I can't remember, it did all these like rewards and stuff. Anyway, it was this thing that he just couldn't be a part of because it was inaccessible. And so if you wanted to use it, it was like, hey Ryan, do you want to go and click on these things for me? Um, like we we had that's right, we had to fill out our goals, like these quarterly goals or something.
[00:32:19] Michael Chan: Yeah.
[00:32:19] Ryan Florence: And he he couldn't do it. So like, because the website just would not work uh for him.
[00:32:26] Michael Chan: And so he's and he's really good.
[00:32:27] Ryan Florence: He's a developer who can go and like fix things in the console and the dev tools to make them work.
[00:32:33] Michael Chan: Uh-huh.
[00:32:34] Ryan Florence: Uh but but this one just wouldn't work. And so um uh it was like, all right, just just don't even do that. So so for a lot of people, it's not just like "Oh, well, what percent of our users use a screen reader? Oh, it's only 1%? Well, it doesn't matter, we're not gonna worry about that." What's awful about that is the person who uses the screen reader, that is 99% of websites. So to us, it's this very small thing, like, "Oh, it's just 1% of users, it's not gonna affect us." But for these people, they're affected almost all the time by that decision.
[00:33:05] Michael Chan: Well, and it's also a false metric because people can't use the website. That 1% is trying really friggin' hard to make it work.
[00:33:14] Ryan Florence: Yeah. Yeah. So with uh with Reach UI, I just I just want to make as much automatic as possible. Because there's a lot that we can do in a component uh where developers don't have to know- we shouldn't all have to be deep accessibility experts. There are so many things to know. You know, we we think of ourselves as full-stack developers. We're not. We've got- like, there's a thing we know better than other things. Um, and and there's stuff that people don't know anything about. How many full-stack developers out there know the difference between um uh aria-hidden and role presentation? Um, but they're gonna call themselves a full-stack developer.
[00:33:55] Michael Chan: Right.
[00:33:56] Ryan Florence: Or who can write a linear gradient from scratch?
[00:33:59] Michael Chan: Once upon a time. Once upon a time.
[00:34:01] Ryan Florence: Yeah. Somebody can. It's not me. Um, so I'm not a full stack developer. There there's things that I know across the stack, but um, we all have our specialties and I don't think that everyone needs to be a deep accessibility expert, especially because it's it's like I've got 2 computers, 3 browsers, and 3 screen readers. One of them cost me $1,200. Um, and the uh the screen reader cost as much as the computer. Mm-hmm. And we don't all we don't all need to do that. Um, I think we can have some components that uh just work out of the box. And uh and then you need to know a little bit. You need to know how to manage focus when you know you go from one component to another. Um, but uh but other than that, there isn't a whole lot that you need to need to know if the if a component is handling it for you.
[00:34:53] Michael Chan: Well, that's one thing I'm I am particularly excited about ReachUI because I, as you described, I'm not a full-stack developer. And while I can make things work and I can make my managers happy and get things out the door and um all of that, style it nice, animate it, whatever, I don't have the foggiest idea of how to get accessibility right for all of those screen readers. And the fact that you're doing that work and I could just kind of sit on top of that and we kind of insert that underneath the work that I'm doing is amazing. And that's a huge value. That's gonna be huge value to me and to my company and other companies, obviously.
[00:35:33] Ryan Florence: Yeah, and I'm and I'm hoping to be able to figure out how to provide hints when I've gone as far as I can with the component and now it's your job to do something. Uh, for example, like If a modal closes, um, I move the focus back to the button that opened it. Uh, but if I can't find that button, maybe because when the modal closes it was a form and you've changed screens, uh, and just the document body gets focused, maybe that's an opportunity for me to warn you and be like, hey, I I tried to manage focus for you, but the thing isn't there anymore. So you should probably you need to manage the focus here and like put a link down in the console of like, you know, here's here's a resource on learning how to do that. So I'm I'm hoping uh to find those kinds of opportunities too, to let people know when uh I've gone as far as I can and now here's the little bit of accessibility knowledge that you need.
[00:36:27] Michael Chan: Now I know that there's a lot of things in the works coming up that kind of help with that focus management, uh whether it be— I know you're working on a new router, Reach Router. Which kind of plays a lot on what Suspense is doing. How do those kind of change the game in terms of focus management?
[00:36:45] Ryan Florence: Yeah, so uh and you can think about scroll management as well. Um so Reach Router is it's it's a lot like React Router version 3 and version 4, like my favorite parts of those two versions, um in a much smaller package. It's about 4 kilobytes. And uh it it also is focused on accessibility. So When you've got some nested routes and you change routes, it's gonna go and focus uh the new the new the part of the page that changed. Uh because you have nested routes, the router knows which part of the app changed, so it can it can do that for you automatically. Um so in the case of like uh that modal that I was just talking about, when you close the modal, if that causes you to change routes, maybe because you submitted a form, um you don't have to manage the excess the focus yourself because the router is gonna go and move focus to the new part of the page.
[00:37:37] Michael Chan: Interesting.
[00:37:38] Ryan Florence: And so that's that's why um that's one of the reasons that I started building it. Um the main reason I built it was I just wanted to play with React Suspense. And uh React Router was using lifecycle hooks that um uh you can't use with Suspense. Um and rather than try to figure out how to get that to work, I was like, this'll be quicker just to build a quick little router.
[00:37:59] Michael Chan: Start over.
[00:38:00] Ryan Florence: Yeah, and and at first it was you know it was very, very small. And then uh and then I added a couple things here and there, and then I was like, wait, I actually really like this. And uh and I actually want to use it, which means I need to put it on npm because I want to use it in my projects now. Uh and so I I fleshed it all out and um and released it. Uh but it's got a focus on accessibility as well. Um so the way that it— uh you asked about how it ties in with Suspense. Um if you think about uh restoring scroll or changing focus. Um, or even document titles, all those things depend on async data. So if you click the back button and you're uh downloading some data for the page, um, you need to wait for that data to load before you change the document title. Or before you restore the scroll position down the page. And um, or before you go and focus, because you need those elements on the page before you can focus them. So to do that stuff um with a router before Suspense, you've gotta know about the data and the async stuff.
[00:39:11] Michael Chan: Yeah.
[00:39:11] Ryan Florence: Which usually meant like Redux or something or or just some global kind of thing because React didn't have any async ideas built into it. Um and so now your components aren't going to mount, like your new route components, they aren't going to mount until that data loads, which means a router can just be like, okay, when when this thing mounts, let's restore the scroll position. When this thing mounts, let's go and focus that element. And like you just don't even have to think about it.
[00:39:43] Michael Chan: Yeah, yeah.
[00:39:45] Ryan Florence: Yeah, it's really cool. So most of the time, you just you just quit worrying about it. And that that's why Suspense is so cool. It's it's uh it's taken this really hard problem in React transitioning from one component to another, not not an animated transition, just like screen A to screen B, um and and data being involved with that. Um it's taking that problem off of our plate where most of us used to look to a router to handle that kind of stuff for us. Now it's just built straight into React, uh which is really nice.
[00:40:15] Michael Chan: Yeah, I'm really excited about that because as a designer, as someone who's working on that thing that's close to the user, thinking about interactions, having this is going to be incredible because I can't even imagine the amount of code that you'd have to write to get these interactions and how difficult it would be to abstract in a meaningful way that you could reuse it across your app.
[00:40:38] Ryan Florence: Yeah, like uh you just consider, you click a link, you want to load data before you go to the next page, but if your API is really, really slow You don't want to sit there and wait forever. You want to throw a spinner up. And if it's super slow, you want to actually go to that page and then put spinners up in- like maybe you've got some of the data, you've got 3 endpoints that you hit, and you've got, you've got 2 of them but not the third, and maybe the third takes 8 or 10 seconds and it's not very important. You don't want to sit there and wait on the old page. And then wait those 10 seconds and then move over. You want to say, you know what, I got my first 2 bits of data in like 2 seconds. I'm still waiting on this 3rd one. Uh let's just go ahead and transition over. Yeah. Or, you know what, that API wasn't slow this time. They all came back within 1 second. Let's transition over. Um all all that stuff, I've never even tried it because I know it would just be too hard. I've thought about it, but I never tried it.
[00:41:43] Michael Chan: You kind of just go the easy way out where you're like, I will throw a spinner up until the data comes back.
[00:41:47] Ryan Florence: Yeah, or we'll just go to the next page and throw spinners up immediately.
[00:41:51] Michael Chan: Right.
[00:41:51] Ryan Florence: Right. My component mounts, let's go fetch and not even not even try to pause the old screen. Um now now you can make all of those tradeoffs with all the same pretty simple code. Um you're able to just put these little placeholders around components that have async data. And um if it's taking a long time, you can go to a placeholder. Uh, and you can tell it how long you're willing to wait for the thing, um, and then it will automatically decide, like, depending on how many milliseconds you're you're willing to wait on each piece of data. Like, we got those 3 pieces of data. Maybe the first 2 were uh not willing to wait very long, and then the last one we're willing to wait a really long time. React will just handle all that for you. You just get to declare things.
[00:42:33] Michael Chan: So it sounds like there's a lot of things kind of coming up in the future. With via Reach UI, via React itself, kind of getting Suspense, that are going to fundamentally change the way that we build UIs and how accessible they can be to the masses. I know that one of the other pillars of your company, Reach Tech, is to be teaching. Um, so how can people learn more about all the things that are coming down the pipe?
[00:42:59] Ryan Florence: Yes, I've actually got a um a workshop tour coming up. That starts October 1st and ends a little bit before Thanksgiving, where I'm hitting pretty much 2 cities every single week. Uh, so I'm gonna be pretty busy. So I think it's-
[00:43:14] Michael Chan: Crazy.
[00:43:14] Ryan Florence: 13 or 12 cities in 6 weeks. Um, so I'll likely be uh close to you if you're in the United States, um, where I will be covering um all of the- so I've had this advanced React workshop for the last 3 years. Um, I've updated it to where now we hit all the patterns really quickly in the first day. And um, and then we talk about the new, uh, like the new lifecycle hooks like getDriveStateFromProps and getSnapshotBeforeUpdate. Um, and the deprecated ones like componentWillMount. All those things, um, we talk about why uh we need to move off of them and then also how to move off of them. And uh if you can do that, then you'll get your app ready for all the rest of what's coming down uh from React uh with uh um with Suspense and time slicing and uh and then there's other stuff too. And so uh we'll hit all the patterns, um we'll hit all the new stuff, and um and then you'll you'll be you'll be ready to go and get your apps ready for the next chapter of React and uh and and learn all the patterns. Maybe you're familiar with them, high-order components, render props, uh but we'll we'll be able to discuss why you'd use one over the other and all that kind of stuff too. So yeah, uh you can just go to reach.tech/workshops and uh see all the cities that I'm gonna be hitting. Another reason why I'm cramming it all together is because I'm trying to live my life in modes. So I'm gonna be in workshop mode, put some money in the bank so that then in uh the beginning of the year in 2019, I can just hit Reach UI hard. Yeah. You know, and and get that whole— that thing— I mean, it'll never be complete, but like get it filled out and uh and and really usable. Um, and so trying to trying to make enough money in uh in those 6 weeks to be able to spend several months uh just heads down on Reach UI.
[00:45:10] Michael Chan: Nice. And so the way that people can fund the development of Reach UI and Reach Router is to attend these conferences and do your online work.
[00:45:22] Ryan Florence: Yes, I've got uh some online courses too. Uh you can find those on reach.tech. Uh that's a subscription. So it's $15 a month. Um and that's actually super helpful uh if you subscribe to those because that gives me a a stream of income. It's not just like Patreon where you're just paying me to build Reach UI. You're actually getting uh what I think are some good uh good online courses on React. And I've got a a development log. Uh, that actually this week I'm gonna be publishing the first videos where I talk about how to build- we will be building, um, in the course, the Reach UI components. So after I get one done-
[00:45:58] Michael Chan: Awesome.
[00:45:59] Ryan Florence: —gonna make a little course, a little video about like, okay, build this with me, here are the trade-offs we made, here are the decisions that were made, here's why it works this way. So you'll you'll learn a lot about accessibility and and React uh with that course. So that that helps helps fund the development too. Um, and uh should should be good stuff.
[00:46:17] Michael Chan: Awesome, awesome. We always like to end the show on uh you telling us about some projects or people that you think are doing really awesome work that should be getting more attention.
[00:46:29] Ryan Florence: Uh I think the first one would be uh React Spring. So I've always been looking for animation libraries in React. Uh React Motion, first one that blew my mind with uh render props. I remember when I first saw that, I thought it wasn't even valid syntax. I had no idea what was happening.
[00:46:47] Michael Chan: It did look- it was startling the first time you saw it.
[00:46:50] Ryan Florence: So strange looking. Um, and then, um, yeah, so React Spring, and then there's the Animated library from React Native. There was a there was an effort to bring the Animated library to the DOM. And uh React Spring is kind of like- well, actually, they their tagline is, "Helping React Motion and Animated to become best friends." And I've been using this for my animations uh with ReachUI because I got to make sure that you can animate them if people want to. And I just love React Spring. Uh the transition component is just perfect. Uh so check that out. Uh Dr. C M D A, D R C M D A, I don't even know. It's uh it's an unpronounceable username. Um slash react-spring on GitHub. Awesome project. And then uh another one, uh man, I'm always excited about Gatsby. Um Gatsby 2.0 is shaping up to be pretty good. Um they actually just moved over to uh Reach Router um for the smaller bundle size and the the focus management and stuff.
[00:47:56] Michael Chan: Awesome. That's gonna feel good.
[00:47:58] Ryan Florence: Helped them out a little bit. Yeah, yeah, uh boosted the npm download stats, that's for sure. Looks like people actually use it now. And then uh MDX. I don't know if you've seen MDX yet.
[00:48:11] Michael Chan: Oh, yeah, I love it.
[00:48:13] Ryan Florence: So many of us have been trying to like smash together React and Markdown. Um, I I built this weird little thing a while ago where you it would look at your fenced code blocks and render them. And uh anyway, it used all global UMD builds of things. It was, it was terrible, but it got the job done. But this is, this is what I was- this is what I was dreaming of. In fact, I wasn't even capable of dreaming of this. They, they built something that is awesome. So anyway, MDX, you get to- you can import JavaScript into your Markdown file. You can render React components in there. Um, it's really cool.
[00:48:59] Michael Chan: It's insane. It is. If you dreamt up all of the things that you could want, all of the perfect APIs, pulled in all of the times that you had wanted components in Markdown, like you wouldn't have been able to construct this thing. It's so good. And it has that feeling of being like a platform in itself. Um, because there's like mdx-deck, mdx-doc, and all of them are really valuable in applying this tool to a task, which is amazing.
[00:49:28] Ryan Florence: Yeah, MDX. Uh, Next.js, uh, Gatsby MDX. Um, so any any time you got a website that has a lot of Markdown, uh, you should probably just use MDX instead. Um, well, I guess in addition to, because it's still Markdown.
[00:49:45] Michael Chan: Yeah, so so you're using it to construct the docs for ReachUI, is that right?
[00:49:51] Ryan Florence: Mm-hmm. Yeah, uh, the ReachUI docs are Gatsby version 2 with uh Gatsby plugin MDX. Or maybe it's just gatsby-mdx.
[00:49:58] Michael Chan: And how did that change your workflow?
[00:50:01] Ryan Florence: Uh, I can just write Markdown and then if I wanna like bring in React Helmet to like change the doc title or the meta tags, I just render a React Helmet. If I wanna render a demo, I can just bring in the demo of the component and render it right there in my Markdown. Um, my links, um, they don't have to be uh anchor tags, they can actually be reach router links, um right there in the middle of the markdown as well. Um yeah, it's just— I I don't know. It's— I I didn't I didn't know that this is what I wanted when I built content-heavy websites. But it's amazing. So uh Brent Brent Jackson, right? He's uh he's the right kind of—
[00:50:46] Michael Chan: Brent Jackson, yeah.
[00:50:46] Ryan Florence: Yeah. Smart smart dude. Yep, so those are my three: React Spring, Gatsby, and uh MDX.
[00:50:54] Michael Chan: Awesome. Well, thank you, Ryan. I really appreciate your time. Uh, it was really fun to hear about what you're doing to help save us all from the the jaws of accessibility. So I'm really excited to see see what you come up with, to continue watching the project, and uh I think I think a lot of us are.
[00:51:11] Ryan Florence: Thanks for having me.
[00:51:15] Promo: This is the end of React Podcast, episode 22. For links to the people and projects mentioned in this show, visit reactpodcast.com/22. And to ensure the continued weekly production of this show, please go to reactpodcast.com/partner and help support the show. Join us next week for our episode with Sunil Pai, talking Facebook, Oculus, React, and CSS in JS.
[00:51:44] Michael Chan: Thanks for listening.
chantastic.fm