Rob Richardson

Vuejs and TypeScript- Working Together like Peanut Butter and Jelly

Using a JavaScript library with no TypeScript support? Learn a prioritized hierarchy of techniques to safely integrate it into your Vue project.

Vuejs and TypeScript- Working Together like Peanut Butter and Jelly
#1about 3 minutes

Comparing Vue with other popular SPA frameworks

Vue.js is a SPA framework that prioritizes developer productivity and an easy learning curve compared to Angular and React.

#2about 1 minute

Creating a new Vue project with the Vue CLI

The Vue CLI provides an interactive prompt to scaffold a new project with features like TypeScript, Vue Router, and testing frameworks.

#3about 5 minutes

Understanding the value of TypeScript for code clarity

TypeScript helps answer "did I call it correctly?" by adding optional type hints that prevent common errors and clarify function signatures.

#4about 3 minutes

How to start using TypeScript in a project

Begin using TypeScript by renaming .js files to .ts and adding optional type annotations to functions and variables to express intent.

#5about 3 minutes

Setting up a Vue project with TypeScript enabled

A Vue CLI-generated project includes a tsconfig.json file, and TypeScript is enabled in components by adding lang="ts" to the script tag.

#6about 3 minutes

Integrating the Vuetify UI library with TypeScript

To use a JavaScript library like Vuetify in a TypeScript project, you may need to add its specific type definitions to the project configuration.

#7about 7 minutes

Using type casting for component references

When TypeScript doesn't recognize methods on a component reference, you can cast the reference to a specific type or custom interface for type safety.

#8about 4 minutes

Creating custom type declaration files for JavaScript libraries

For libraries without types, you can create a .d.ts file to manually declare the module and define the functions you use.

#9about 2 minutes

Using DefinitelyTyped for community type definitions

The DefinitelyTyped project provides thousands of community-maintained type declaration packages, installable via npm as @types/package-name.

#10about 5 minutes

Generating declaration files with the TypeScript compiler

The TypeScript compiler (tsc) can automatically generate a basic .d.ts declaration file from a JavaScript file to get you started.

#11about 3 minutes

A prioritized summary of techniques for using JS libraries

A hierarchy of strategies for integrating JavaScript libraries includes using built-in types, DefinitelyTyped, custom declarations, generation, and casting.

#12about 3 minutes

Deciding when to use or avoid TypeScript with Vue

TypeScript is ideal for long-lived projects but may be overkill for prototypes or projects heavily reliant on libraries without type definitions.

Related jobs
Jobs that call for the skills explored in this talk.

Angular Developer

Picnic Technologies B.V.
Amsterdam, Netherlands

Intermediate
Senior

Featured Partners

Related Articles

View all articles
DC
Daniel Cranney
Exploring TypeScript: Benefits for Large-Scale JavaScript Projects
JavaScript is the backbone of web development, powering everything from small websites to large-scale enterprise applications. However, as projects grow in complexity, maintaining JavaScript code can become increasingly difficult. This is where TypeS...
Exploring TypeScript: Benefits for Large-Scale JavaScript Projects
BR
Benjamin Ruschin
The HTML Elements That You’re Probably Over-Engineering
As frameworks have become more and more commonplace in the world of web development, so too has the over-engineering of features made possible by our humble old friend, HTML. The mental models that come with using state management in React, Vue and o...
The HTML Elements That You’re Probably Over-Engineering
DC
Daniel Cranney
Security Basics for Vibe Coders
Vibe coding has become a popular trend in the tech world. With so many tools now available for both developers and non-developers, it’s easier than ever to build projects using natural language, in some cases without touching a line of code along the...
Security Basics for Vibe Coders
CH
Chris Heilmann
Building a "shoutout" component in plain HTML/CSS/JavaScript
Every Wednesday we meet at noon to talk about a lot of tech news, tools and resources in something we call WeAreDevelopers Live . We go live on YouTube and afterwards we cut out short videos to post on social media. What we needed was an obvious “sho...
Building a "shoutout" component in plain HTML/CSS/JavaScript

From learning to earning

Jobs that call for the skills explored in this talk.