Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Advanced TypeScript Programming Projects
Advanced TypeScript Programming Projects

Advanced TypeScript Programming Projects: Build 9 different apps with TypeScript 3 and JavaScript frameworks such as Angular, React, and Vue

eBook
$20.98 $29.99
Paperback
$43.99
Subscription
Free Trial
Renews at $19.99p/m

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
Product feature icon AI Assistant (beta) to help accelerate your learning
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Table of content icon View table of contents Preview book icon Preview Book

Advanced TypeScript Programming Projects

Creating a Markdown Editor with TypeScript

It is hard to deal with content on the internet without encountering markdown. Markdown is a simplified way to create content using plain text that is easily converted into simple HTML. In this chapter, we are going to investigate what it takes to create a parser that will convert a subset of the markup format into HTML content. We will automatically convert relevant tags into the first three header levels, the horizontal rule, and paragraphs.

By the end of this chapter, we will have covered how to create a simple Bootstrap web page and reference the JavaScript generated from our TypeScript, as well as hooking up to a simple event handler. We will also cover how to create classes using simple design patterns and how to design classes with single responsibilities, which are techniques that serve us well as professional developers.

The...

Technical requirements

Understanding the project overview

Now that we have a grasp of some of the concepts that we are going to cover throughout the rest of this book, we are going to start putting them into practice by creating a project that parses a very simple markdown format while the user types into a text area and displays the resulting web page alongside it. Unlike full markdown parsers, we are going to concentrate on formatting the first three header types, the horizontal rule, and paragraphs. The markup is restricted to breaking lines down by newline characters and looking at the start of a line. It then determines whether or not a particular tag is present and, if not, it assumes the current line is a paragraph. The reason we have chosen this implementation is because it is a simple task to pick up immediately. While it is simple, it offers sufficient depth to show that we are going to tackle...

Getting started with a simple HTML project

This project is a simple HTML and TypeScript file combination. Create a directory to hold the HTML and TypeScript files. Our JavaScript will reside in a script folder under this directory. The following tsconfig.json file is used:

{
"compilerOptions": {
"target": "ES2015",
"module": "commonjs",
"sourceMap": true,
"outDir": "./script",
"strict": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"noImplicitThis": true,
"alwaysStrict": true,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true,
"esModuleInterop": true,
"experimentalDecorators": true,
}
}

Writing a simple markdown parser

When I was thinking about the project that we are going to tackle in this chapter, I had a clear objective in mind. While we are writing this code, we are going to try out things such as patterns and good object-oriented (OO) practices, such as classes having a single responsibility. If we can apply these techniques right from the start, we will soon get into the habit of using them and this will translate into useful development skills.

As professional developers, before we write any code, we should gather the requirements that we are going to use and ensure that we are making no assumptions about what our application will do. We may think that we know what we want our application to do, but if we make a list of our requirements, we'll make sure that we understand everything that we are meant to deliver and we'll come up with a handy...

Summary

In this chapter, we have built an application that responded to what the user was typing into a text area, and updated a label with converted text. The conversion of this text was handled by classes, each of which had a single responsibility. The reason we concentrated on producing classes that only did one thing was to learn, right from the start, how to use industry best practices to make our code cleaner and less prone to errors, since a well-designed class that only does one thing is less likely to have problems than classes that do lots of different things.

We introduced the visitor and chain-of-responsibility patterns in order to see how we could separate the text processing into deciding whether a line contained markdown and adding the appropriate HTML-encoded text. We started introducing patterns because patterns occur in so many different software development...

Questions

  1. The application currently only reacts to the user changing the content using the keyboard. It is possible that the user could use the context menu to paste the text in. Enhance the HtmlHandler method to cope with the user pasting text in.
  2. We added H1 to H3 support. HTML also supports H4, H5, and H6. Add support for these tags.
  3. In the CanHandle code, we are calling the Visitable code. Change the base Handler class so that it calls the Accept method.

Further reading

Left arrow icon Right arrow icon
Download code icon Download Code

Key benefits

  • Apply the cutting-edge features of TypeScript 3.0 to build high-performance, maintainable applications
  • Learn through practical examples of using TypeScript with popular frameworks, such as Angular and React
  • Focus on building high-quality applications that are modular, scalable and adaptable

Description

With the demand for ever more complex websites, the need to write robust, standard-compliant JavaScript has never been greater. TypeScript is modern JavaScript with the support of a first-class type system, which makes it simpler to write complex web systems. With this book, you’ll explore core concepts and learn by building a series of websites and TypeScript apps. You’ll start with an introduction to TypeScript features that are often overlooked in other books, before moving on to creating a simple markdown parser. You’ll then explore React and get up to speed with creating a client-side contacts manager. Next, the book will help you discover the Angular framework and use the MEAN stack to create a photo gallery. Later sections will assist you in creating a GraphQL Angular Todo app and then writing a Socket.IO chatroom. The book will also lead you through developing your final Angular project which is a mapping app. As you progress, you’ll gain insights into React with Docker and microservices. You’ll even focus on how to build an image classification program with machine learning using TensorFlow. Finally, you’ll learn to combine TypeScript and C# to create an ASP.NET Core-based music library app. By the end of this book, you’ll be able to confidently use TypeScript 3.0 and different JavaScript frameworks to build high-quality apps.

Who is this book for?

This book is for programmers and web developers who are familiar with TypeScript and want to put their knowledge to work by building real-world complex applications. Prior experience with any other web framework is not required.

What you will learn

  • Discover how to use TypeScript to write code using common patterns
  • Get to grips with using popular frameworks and libraries with TypeScript
  • Leverage the power of both server and client using TypeScript
  • Learn how to apply exciting new paradigms such as GraphQL and TensorFlow
  • Use popular cloud-based authenticated services
  • Combine TypeScript with C# to create ASP.NET Core applications

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Jul 26, 2019
Length: 416 pages
Edition : 1st
Language : English
ISBN-13 : 9781788991018
Languages :

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
Product feature icon AI Assistant (beta) to help accelerate your learning
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Product Details

Publication date : Jul 26, 2019
Length: 416 pages
Edition : 1st
Language : English
ISBN-13 : 9781788991018
Languages :

Packt Subscriptions

See our plans and pricing
Modal Close icon
$19.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
$199.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just $5 each
Feature tick icon Exclusive print discounts
$279.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just $5 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total $ 146.97
Mastering TypeScript 3
$54.99
Learn TypeScript 3 by Building Web Applications
$47.99
Advanced TypeScript Programming Projects
$43.99
Total $ 146.97 Stars icon
Banner background image

Table of Contents

12 Chapters
Advanced TypeScript Features Chevron down icon Chevron up icon
Creating a Markdown Editor with TypeScript Chevron down icon Chevron up icon
A React Bootstrap Personal Contacts Manager Chevron down icon Chevron up icon
The MEAN Stack - Building a Photo Gallery Chevron down icon Chevron up icon
Angular ToDo App with GraphQL and Apollo Chevron down icon Chevron up icon
Building a Chat Room Application Using Socket.IO Chevron down icon Chevron up icon
Angular Cloud-Based Mapping with Firebase Chevron down icon Chevron up icon
Building a CRM Using React and Microservices Chevron down icon Chevron up icon
Image Recognition with Vue.js and TensorFlow.js Chevron down icon Chevron up icon
Building an ASP.NET Core Music Library Chevron down icon Chevron up icon
Assessments Chevron down icon Chevron up icon
Other Books You May Enjoy Chevron down icon Chevron up icon

Customer reviews

Rating distribution
Full star icon Full star icon Full star icon Full star icon Full star icon 5
(2 Ratings)
5 star 100%
4 star 0%
3 star 0%
2 star 0%
1 star 0%
NNNVVV Dec 13, 2019
Full star icon Full star icon Full star icon Full star icon Full star icon 5
I've been developing software for over 20 years using a mixture of languages and technologies and recently have started to migrate more into the web development sphere away from mainly desktop/server.Having a solid background in software engineering and modern programming languages it was great to find a book targeted at my level. Anyone who has written C++, C#, (other OO languages) will find Typescript pretty straightforward but it's great to get a more in-depth look at what is supported.Whilst beginners would learn some valuable lessons from this book it's aimed at more experienced developers. I found the detailed process of developing each project from first principles refreshing and a good reminder that for successful outcomes you need solid requirements.Where some recent books I've read around the subject seem to focus on cramming as many features and buzzwords into as little space as possible, this book picks the tools you'll need to develop a whole range of applications and provides in-depth working examples of how to use them.Typescript will continue to evolve and push into new arenas of development and with this book I hope I'll have the solid foundations to keep up to date.
Amazon Verified review Amazon
Christian Graus Nov 23, 2019
Full star icon Full star icon Full star icon Full star icon Full star icon 5
The author clearly knows his stuff, the materials are set out logically and in a way that builds knowledge over time. The practical examples in a number of popular frameworks mean there's real world examples, no matter what you use, and I definitely walked away knowing a lot more about Typescript than I did at the start, despite being a professional developer who uses Typescript every day
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

How do I buy and download an eBook? Chevron down icon Chevron up icon

Where there is an eBook version of a title available, you can buy it from the book details for that title. Add either the standalone eBook or the eBook and print book bundle to your shopping cart. Your eBook will show in your cart as a product on its own. After completing checkout and payment in the normal way, you will receive your receipt on the screen containing a link to a personalised PDF download file. This link will remain active for 30 days. You can download backup copies of the file by logging in to your account at any time.

If you already have Adobe reader installed, then clicking on the link will download and open the PDF file directly. If you don't, then save the PDF file on your machine and download the Reader to view it.

Please Note: Packt eBooks are non-returnable and non-refundable.

Packt eBook and Licensing When you buy an eBook from Packt Publishing, completing your purchase means you accept the terms of our licence agreement. Please read the full text of the agreement. In it we have tried to balance the need for the ebook to be usable for you the reader with our needs to protect the rights of us as Publishers and of our authors. In summary, the agreement says:

  • You may make copies of your eBook for your own use onto any machine
  • You may not pass copies of the eBook on to anyone else
How can I make a purchase on your website? Chevron down icon Chevron up icon

If you want to purchase a video course, eBook or Bundle (Print+eBook) please follow below steps:

  1. Register on our website using your email address and the password.
  2. Search for the title by name or ISBN using the search option.
  3. Select the title you want to purchase.
  4. Choose the format you wish to purchase the title in; if you order the Print Book, you get a free eBook copy of the same title. 
  5. Proceed with the checkout process (payment to be made using Credit Card, Debit Cart, or PayPal)
Where can I access support around an eBook? Chevron down icon Chevron up icon
  • If you experience a problem with using or installing Adobe Reader, the contact Adobe directly.
  • To view the errata for the book, see www.packtpub.com/support and view the pages for the title you have.
  • To view your account details or to download a new copy of the book go to www.packtpub.com/account
  • To contact us directly if a problem is not resolved, use www.packtpub.com/contact-us
What eBook formats do Packt support? Chevron down icon Chevron up icon

Our eBooks are currently available in a variety of formats such as PDF and ePubs. In the future, this may well change with trends and development in technology, but please note that our PDFs are not Adobe eBook Reader format, which has greater restrictions on security.

You will need to use Adobe Reader v9 or later in order to read Packt's PDF eBooks.

What are the benefits of eBooks? Chevron down icon Chevron up icon
  • You can get the information you need immediately
  • You can easily take them with you on a laptop
  • You can download them an unlimited number of times
  • You can print them out
  • They are copy-paste enabled
  • They are searchable
  • There is no password protection
  • They are lower price than print
  • They save resources and space
What is an eBook? Chevron down icon Chevron up icon

Packt eBooks are a complete electronic version of the print edition, available in PDF and ePub formats. Every piece of content down to the page numbering is the same. Because we save the costs of printing and shipping the book to you, we are able to offer eBooks at a lower cost than print editions.

When you have purchased an eBook, simply login to your account and click on the link in Your Download Area. We recommend you saving the file to your hard drive before opening it.

For optimal viewing of our eBooks, we recommend you download and install the free Adobe Reader version 9.