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.
#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.
Exploring TypeScript: Benefits for Large-Scale JavaScript ProjectsJavaScript 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...
Benjamin Ruschin
The HTML Elements That You’re Probably Over-EngineeringAs 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...
Daniel Cranney
Dev Digest 202: The Vibe Coding Trap, Hacking Discord and How Browsers WorkInside last week’s Dev Digest 202 .
🗣️ A look behind the scenes how we organise the WeAreDevelopers World Congress
🙅 Vibe coding is a trap
🟪 How to hack discord
⚔️ Building defensive AI agents
📘 The consise TypeScript book
😄 Web development is fun a...
Christina Schaireiter
Security Basics for Vibe CodersVibe 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...
From learning to earning
Jobs that call for the skills explored in this talk.