Skip to Main Content
Modern Front-End Development for Rails, 2nd Edition
book

Modern Front-End Development for Rails, 2nd Edition

by Noel Rappin
September 2022
Intermediate to advanced content levelIntermediate to advanced
410 pages
10h 7m
English
Pragmatic Bookshelf
Content preview from Modern Front-End Development for Rails, 2nd Edition

Adding TypeScript

At this point, we have a fully functional Rails 7 setup to start writing front-end code. We could stop here. However, instead, we’re going to add TypeScript to our mix.

There’s good news and bad news regarding using TypeScript with esbuild.

The good news is that esbuild will convert .ts files from TypeScript to JavaScript without any configuration changes on our part. The bad news is that all esbuild does is remove TypeScript type annotations and whatever other TypeScript-only stuff might exist in the file. Specifically, esbuild does not run the TypeScript compiler to determine if the code is type-safe. Because we want to use TypeScript specifically to determine if our code is type-safe, this seems less than ideal.

What we ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Modern Front-End Development for Rails

Modern Front-End Development for Rails

Noel Rappin

Publisher Resources

ISBN: 9781680509977Errata Page