# Transcript: JS Fundamentals - Decorators (Syntax #653)

- Transcript page: https://syntax.fm/show/653/js-fundamentals-decorators/transcript
- Episode: https://syntax.fm/show/653/js-fundamentals-decorators
- Published: 2023-08-14
- Reuse: quote short excerpts, credit Syntax and link to the passage (https://syntax.fm/pages/terms-of-service#quoting-syntax)

> Scott and Wes discuss JavaScript decorators - what they are, how to use them, their current status, and potential future use cases.

[0:01](https://syntax.fm/show/653/js-fundamentals-decorators/transcript#t-1) **Announcer:** Monday. Mon Monday. Hey. Open wide dev fans. Get ready to stuff your face with JavaScript, CSS, node modules, barbecue tips, get workflow, breakdancing, soft skill, web development, the hastiest, the craziest, the tastiest TS web development treats coming in hot. Here is Wes, Barracuda,

[0:20](https://syntax.fm/show/653/js-fundamentals-decorators/transcript#t-20) **Wes Bos:** Boss, and Scott

[0:27](https://syntax.fm/show/653/js-fundamentals-decorators/transcript#t-27) **Scott Tolinski:** key. Welcome to Syntax.

[0:29](https://syntax.fm/show/653/js-fundamentals-decorators/transcript#t-29) **Scott Tolinski:** On this Monday, hasty treat, we're gonna be talking about decorators.

[0:32](https://syntax.fm/show/653/js-fundamentals-decorators/transcript#t-32) **Scott Tolinski:** We're gonna be diving into the current status of decorators in JavaScript.

## Overview of decorators in JavaScript (00:33)

[0:37](https://syntax.fm/show/653/js-fundamentals-decorators/transcript#t-37) **Scott Tolinski:** We're gonna be talking about what they are, how to use them, and maybe some of the finer points and maybe even future points of what decorators behold to us.

[0:52](https://syntax.fm/show/653/js-fundamentals-decorators/transcript#t-52) **Wes Bos:** Hey, everybody. Excited to talk about decorators finally. I feel like we've mentioned them on the show for years years years, and they are.

[1:00](https://syntax.fm/show/653/js-fundamentals-decorators/transcript#t-60) **Wes Bos:** Is it is it safe to say they are finally here? I mean, they're here ish.

[1:05](https://syntax.fm/show/653/js-fundamentals-decorators/transcript#t-65) **Scott Tolinski:** And and so the current status of decorators is they are currently in stage 3.

## Decorators currently at stage 3, implemented in Firefox but not yet Chromium/Safari (01:11)

[1:11](https://syntax.fm/show/653/js-fundamentals-decorators/transcript#t-71) **Scott Tolinski:** Firefox is implementing them as we speak. There is an open issue about it. But I believe Before they go to stage 4, they need to have 2 independent browsers implementing them. So, as far as I know, I haven't seen anything about Chromium or Safari implementing these. So we will see When decorators will arrive, but you can use decorators in many senses.

[1:38](https://syntax.fm/show/653/js-fundamentals-decorators/transcript#t-98) **Scott Tolinski:** Many times people are using different plug in systems whether it's Babel or whatever. And now the actual decorator spec will differ quite, well, maybe not quite a bit. It differs a bit from the one that's available in TypeScript or the one that's available in Babel or any of the means in which you tried to use decorators.

[1:58](https://syntax.fm/show/653/js-fundamentals-decorators/transcript#t-118) **Scott Tolinski:** But we're gonna be mostly talking about class decorators because that is what is coming to the browser in stage 3. Are are they different than

[2:07](https://syntax.fm/show/653/js-fundamentals-decorators/transcript#t-127) **Wes Bos:** The are the TypeScript versions different than the the spec ones? Because I know there was TypeScript decorators for a long time, and then TypeScript deprecated but kept it around.

[2:20](https://syntax.fm/show/653/js-fundamentals-decorators/transcript#t-140) **Wes Bos:** And then they've implemented the new decorators version. I I was under the impression that that was the Ecma Decorators, but is it different? Well, I have to double check. You know what? I I was reading through the,

## Difference between TypeScript decorators and spec decorators (02:21)

[2:33](https://syntax.fm/show/653/js-fundamentals-decorators/transcript#t-153) **Scott Tolinski:** through the proposal here. And there's a whole section about how does it differ from, babble decorators? How does it how is it differ from TypeScript creators. How does it and so they they address all of those.

[2:45](https://syntax.fm/show/653/js-fundamentals-decorators/transcript#t-165) **Scott Tolinski:** And how does it differ from TypeScript decorators? Could have been referring to the previous implementation of that. Although it doesn't necessarily explicitly say that. It just says how do these differ from the TypeScript version of Deckorators?

[2:59](https://syntax.fm/show/653/js-fundamentals-decorators/transcript#t-179) **Wes Bos:** So it's TypeScript 5 came out with the ECMA script decorators, which is the one we're talking about today. Okay. So never mind that a little bit weird because they, like, had their own version. Right. And then they scrapped it. A lot of the Versus code code base is built using it as well, which is Kind of tricky, but luckily, they have the new version, which which is funny that they, like, went all in on it because it's it's not done yet, right? Yeah. There's a possibility that it could change.

[3:29](https://syntax.fm/show/653/js-fundamentals-decorators/transcript#t-209) **Wes Bos:** Probably not, but it happened to them once before. So

## Potential for third version of decorators in the future (03:33)

[3:33](https://syntax.fm/show/653/js-fundamentals-decorators/transcript#t-213) **Scott Tolinski:** Are we gonna have a 3rd version? Yeah. I I have no idea. And it really seems like this is going to be it in terms of decorators, at least as they're added. Yeah. And You know what? It is really interesting. It's an interesting API. And I was under the false assumption that once Decorators were added. They were going to be added for everything, but it really seems like it's only classes for now With the potential for adding decorators to literally anything pretty much.

[4:05](https://syntax.fm/show/653/js-fundamentals-decorators/transcript#t-245) **Wes Bos:** Yeah. So there's a on the TC 39 decorator proposal, there's a link you have here to extensions, and they show everything as like a function decorator, a const decorator.

## Extensions to decorators beyond classes (04:06)

[4:19](https://syntax.fm/show/653/js-fundamentals-decorators/transcript#t-259) **Wes Bos:** So you could say let at deprecated x equals one. So you can mark variables as being deprecated. It's kinda cool. Mhmm. There's some interesting stuff that, you know, I think about, like, even in Svelte, You create like a writable,

[4:31](https://syntax.fm/show/653/js-fundamentals-decorators/transcript#t-271) **Scott Tolinski:** but maybe you could create a writable by using a decorator instead of importing writable. And then you're just, you know, at writable or something on a variable.

[4:42](https://syntax.fm/show/653/js-fundamentals-decorators/transcript#t-282) **Scott Tolinski:** And then you have access to initializing it, or stepping in the way of it kind of deal. I don't know. It's all an interesting world. Be their way, the classes based decorators are kind of a a largest API in general Because it turns out there's kind of a lot you can do with decorators.

## Decorators wrap/extend class functionality (05:01)

[5:01](https://syntax.fm/show/653/js-fundamentals-decorators/transcript#t-301) **Scott Tolinski:** And as a non object oriented, programmer I mean, you know, I I understand OOP, but I I don't I don't think I write object oriented code that much. It would it's been really fascinating for me to dive into some of this stuff in terms of, the use cases Get around, you know, getters and setters and Mhmm. Those types of things. So, decorators as simply put, It's a function that decorates your class or any of your properties in your classes And then potentially, like, we mentioned other things. And by decorating, it's adding additional functionality.

[5:35](https://syntax.fm/show/653/js-fundamentals-decorators/transcript#t-335) **Scott Tolinski:** It's wrapping it. It's Able to extend its functionality. It's able to initialize it with data or do things that are surrounding that data or surrounding that object.

## Decorators add functionality to classes/properties/methods (05:36)

## Examples of decorator use cases - logging, reactivity (05:48)

[5:48](https://syntax.fm/show/653/js-fundamentals-decorators/transcript#t-348) **Wes Bos:** Yeah. So you may have you probably have seen it in Angular has used it for a long time.

[5:55](https://syntax.fm/show/653/js-fundamentals-decorators/transcript#t-355) **Wes Bos:** Lit for web components has used that for a while. The way that it works is you put an at on top of the thing that you are decorating, and then you give it a name.

[6:05](https://syntax.fm/show/653/js-fundamentals-decorators/transcript#t-365) **Wes Bos:** And that is corresponding to a function that exists somewhere else in your code base, very similar to how, Like, tag template literals on strings.

## Decorators reference a function (06:15)

[6:15](https://syntax.fm/show/653/js-fundamentals-decorators/transcript#t-375) **Wes Bos:** You know how you can, like, tag a a back ticks? That's a function as well.

[6:20](https://syntax.fm/show/653/js-fundamentals-decorators/transcript#t-380) **Wes Bos:** So decorators in themselves are referencing a function somewhere else. So you can decorate an entire class.

[6:26](https://syntax.fm/show/653/js-fundamentals-decorators/transcript#t-386) **Wes Bos:** You can decorate individual methods.

## Can decorate class, methods, getters/setters (06:27)

[6:29](https://syntax.fm/show/653/js-fundamentals-decorators/transcript#t-389) **Wes Bos:** You can decorate the getter or the setter of a variable, as well as, just properties that are inside of that. So private, public, static,

[6:41](https://syntax.fm/show/653/js-fundamentals-decorators/transcript#t-401) **Scott Tolinski:** properties that are inside of your class. So it's kind of cool because you could decorate the whole thing or individual methods or properties that live inside of that class. Yeah. And and what are some potential use cases for for decorating something? Well, it kind of what it does is if you can imagine, it kind of sweeps functionality under the rug to hide it underneath essentially like a tech.

[7:00](https://syntax.fm/show/653/js-fundamentals-decorators/transcript#t-420) **Scott Tolinski:** So you could use, like a log decorator to log anytime a variable has changed inside of its getter and etcetera or any time it's being updated.

## Use cases - logging, initialization (07:01)

[7:13](https://syntax.fm/show/653/js-fundamentals-decorators/transcript#t-433) **Scott Tolinski:** You could log the initialization of a class, if the class is initialized.

[7:20](https://syntax.fm/show/653/js-fundamentals-decorators/transcript#t-440) **Wes Bos:** Yeah. The logging one is, at least right now, it seems to be one of the most handy ones to me because You can write a single log function and you just pop at log on top of any method that you want, and you're not explicitly going into the method and adding a bunch of console logs or debugger points or anything like that. You can simply just say, Yeah. Exactly. Yeah. Because it's sometimes like, oh, man. I gotta add all these console logs and make sure I remove them. And this is really nice where you could just tag something with at log, And then you can say your your log you could leave them in if you want, and your log function could say, if we are in development, then go ahead and and log out what you need.

## Other use cases - reactivity, event listeners (08:02)

[8:02](https://syntax.fm/show/653/js-fundamentals-decorators/transcript#t-482) **Wes Bos:** Another kind of cool use case is like event listeners or like reactive data.

[8:08](https://syntax.fm/show/653/js-fundamentals-decorators/transcript#t-488) **Wes Bos:** So If you are creating a component and you have some state or some properties on there, you can put reactive on top of it. This is what I think Angular does. I think it's, lit does this as well. Basically, if there's a a variable that you want to explicitly watch for it to change, tag it with at reactive, and the that function will then Watch that variable to change, and when it changes, it will do whatever you want. Likely update the part of the code base that contains that variable, but it could fire an event as well. You name it. Yeah. And in some of the interesting use cases that I've seen too are initializing like a web component.

## Initializing web components with decorators (08:54)

[8:54](https://syntax.fm/show/653/js-fundamentals-decorators/transcript#t-534) **Scott Tolinski:** You could, add a a, like, component name to a a decorator to then initialize it in the browser once this thing is being loaded.

[9:05](https://syntax.fm/show/653/js-fundamentals-decorators/transcript#t-545) **Wes Bos:** Yeah. If you have used, like, a higher order function before. Yeah. Higher order function. Perfect.

## Decorators similar to higher order functions (09:12)

[9:12](https://syntax.fm/show/653/js-fundamentals-decorators/transcript#t-552) **Wes Bos:** A function that takes a function as an argument.

[9:15](https://syntax.fm/show/653/js-fundamentals-decorators/transcript#t-555) **Wes Bos:** Generally what that's doing is it's taking in a function, it's Transforming it in some way. It's adding some data to the scope. It's doing whatever it needs to do and then At the end of the day, running it. Deckorators, at least to me, they seem kind of similar in that, okay, I have this method that save some data.

[9:35](https://syntax.fm/show/653/js-fundamentals-decorators/transcript#t-575) **Wes Bos:** If I want to be able to modify or check what variable is being accessed or another very common use case is validation. Like, if you want to somebody is setting their, let's say me and Scott had a game, and you're setting a score to x, y, and z. You that method could just set the score, And then all the validation inside of that, make sure it's a number, make sure it's allowed, make sure it's, only 1 more than the previous score. All of that sort of logic could live in a separate function. And it's kind of nice to be able to if you want to be able to separate the saving data from the actual validation, especially if you want to reuse that validation logic across multiple methods or multiple classes.

## Wish list: decorators for functions in React (10:23)

[10:23](https://syntax.fm/show/653/js-fundamentals-decorators/transcript#t-623) **Scott Tolinski:** Yeah. You know, this is in times like this, I I get sad that, you know, these aren't coming to functions right away because one of the times that I really like to use decorators, but I did. It was in a function context in React world as essentially a higher order function or higher order component, you know.

[10:41](https://syntax.fm/show/653/js-fundamentals-decorators/transcript#t-641) **Scott Tolinski:** I would just use a dirt decorator to load a script or to load some data or something to that degree.

[10:46](https://syntax.fm/show/653/js-fundamentals-decorators/transcript#t-646) **Scott Tolinski:** And I I found that experience to be really nice, but seeing as how, React components are now only functions pretty much that is not looking like something that we'll be able to do for a little while. So to define a decorator, you're essentially just writing a function. There's nothing special to this function beyond essentially the parameters that are are passed into the function. Right? But so it's a function.

[11:08](https://syntax.fm/show/653/js-fundamentals-decorators/transcript#t-668) **Scott Tolinski:** So when the code loads, the decorator expression is first evaluated, then the decorator function is called during the class definition.

## How decorators are evaluated and called (11:09)

[11:19](https://syntax.fm/show/653/js-fundamentals-decorators/transcript#t-679) **Scott Tolinski:** After all of the methods within the class have been evaluated, but before The constructor and the prototype are put together. K. This this this is like deep stuff for people who who care about this. But, basically, at that point, When they get called, when the the decorator gets called, which is now, it gets 2 parameters. 1 of which Is the value being decorated and the second is a context object containing a bunch of information about the thing being decorated.

## Parameters passed to decorator functions (11:51)

[11:51](https://syntax.fm/show/653/js-fundamentals-decorators/transcript#t-711) **Scott Tolinski:** So you get access to, like, what kind of a decorator it is, name access, whether or not it's private, whether or not it's static Mhmm. And an add initializer method that you can then, to add an initializer on this value.

## Applying decorators syntax (12:06)

[12:06](https://syntax.fm/show/653/js-fundamentals-decorators/transcript#t-726) **Scott Tolinski:** After that, the decorators are applied and

[12:08](https://syntax.fm/show/653/js-fundamentals-decorators/transcript#t-728) **Wes Bos:** it modifies the class. Yeah. So it's it's kind of interesting that it it, like, happens when you Like the code is evaluated. Scott said, like exactly when it happens, but it doesn't run when you like run a method. It runs when the code is is evaluated. And if you want to run custom functionality when the method is run, that's where you then return a function from the decorator. And that sort of just queues it up to say, all right, when somebody runs, let's say I have a class called game and there's a score method. So when somebody does run a score method, then go ahead and run this method, which I can in turn run the original code of the SCORE method, but I can sprinkle on a little bit of logging or any of the stuff we talked about earlier. So, again,

[12:56](https://syntax.fm/show/653/js-fundamentals-decorators/transcript#t-776) **Scott Tolinski:** Deckorators, they're written as just a straight up normal function again, given the parameters that we mentioned.

## Defining decorators as normal functions (13:02)

[13:02](https://syntax.fm/show/653/js-fundamentals-decorators/transcript#t-782) **Scott Tolinski:** But when you wanna use them, you just use them using the at sign like we said already with the decorator's name and you place this on top or sometimes next to to to the left of. I wanna say instead of next to. The left of the thing you're trying to decorate. So for instance, if you're decorating a class at decorator name and then immediately following that the class definition.

[13:24](https://syntax.fm/show/653/js-fundamentals-decorators/transcript#t-804) **Scott Tolinski:** But if you're doing it on a field inside of a class, you do add decorator name space Then the variable name and then its definition equals to number 1. Whatever.

## Syntax for decorating classes vs properties (13:25)

[13:35](https://syntax.fm/show/653/js-fundamentals-decorators/transcript#t-815) **Scott Tolinski:** So it's a little interesting. It seems like if it's On a, on a function or method, you're always defining it above it. But on an individual field, it's defined next to it. I wonder why that's different.

[13:48](https://syntax.fm/show/653/js-fundamentals-decorators/transcript#t-828) **Scott Tolinski:** Kinda feels like they should always be on top. Right? Is is that, like, a syntax thing, or is that just people like to format it that specifically that's that way? I've seen I've only seen it this way in the examples, so I would be inclined to say it's a syntax thing.

## Syntax likely required, not just convention (14:04)

[14:04](https://syntax.fm/show/653/js-fundamentals-decorators/transcript#t-844) **Wes Bos:** Yeah. I I think you're right as well. I've only ever seen it that way.

[14:08](https://syntax.fm/show/653/js-fundamentals-decorators/transcript#t-848) **Wes Bos:** I guess it makes sense because generally your, properties are are only a one liners. Right? You wanna you wanna set a piece of state on your class. And if you wanna tag that as reactive, just at reactive in front of it. Yeah. Have you seen this auto accessor stuff as well?

[14:25](https://syntax.fm/show/653/js-fundamentals-decorators/transcript#t-865) **Scott Tolinski:** No. What is that? Okay. So a part of this proposal is this auto accessor.

## Auto accessors syntactic sugar for private variables (14:31)

[14:31](https://syntax.fm/show/653/js-fundamentals-decorators/transcript#t-871) **Scott Tolinski:** And an auto accessor is a syntax a word the a keyword named accessor.

[14:38](https://syntax.fm/show/653/js-fundamentals-decorators/transcript#t-878) **Scott Tolinski:** So if you were to say I have a class.

[14:40](https://syntax.fm/show/653/js-fundamentals-decorators/transcript#t-880) **Scott Tolinski:** Yep. And inside of my class Is what should be a private property.

[14:46](https://syntax.fm/show/653/js-fundamentals-decorators/transcript#t-886) **Scott Tolinski:** What you do with this API is you write accessor, the name of the value, and then you assign it. And what what it is, it's a shorthand for first creating a private variable, also creating a get method, and creating a set method for. So this thing is syntactical sugar for creating a private variable with a getter and a setter. Now the reason this is relates 2 decorators is that if you decorate in an auto accessor, if you decorate an auto accessor, it gives you more things. Okay. What it does is it gives you the ability to return a custom, get a custom set and a custom init function All from within the decorator that you don't get unless it's an auto accessor.

## Benefits of auto accessors with decorators (15:34)

[15:34](https://syntax.fm/show/653/js-fundamentals-decorators/transcript#t-934) **Wes Bos:** Oh, I see.

[15:36](https://syntax.fm/show/653/js-fundamentals-decorators/transcript#t-936) **Wes Bos:** If you have a private property on a class. You put the little pound in front of it.

[15:42](https://syntax.fm/show/653/js-fundamentals-decorators/transcript#t-942) **Wes Bos:** And then if you want to be able to get and set those, you have to create your own getters and setter values and do all the logic inside of that. And often it's simply just returning the private value and setting the private value.

[15:57](https://syntax.fm/show/653/js-fundamentals-decorators/transcript#t-957) **Wes Bos:** So adding an accessor will

[15:59](https://syntax.fm/show/653/js-fundamentals-decorators/transcript#t-959) **Scott Tolinski:** do all 3 of those things for you in one go? It it does all 3 of those things for you in one go in addition to giving your decorator more functionality.

[16:09](https://syntax.fm/show/653/js-fundamentals-decorators/transcript#t-969) **Wes Bos:** Oh, okay.

## Example of auto accessor decorator (16:10)

[16:10](https://syntax.fm/show/653/js-fundamentals-decorators/transcript#t-970) **Scott Tolinski:** Oh, that's pretty cool. Yeah. It it is interesting. And it seems like An example that I've seen is specifically like a reactive variable where you do reactive accessor my value.

[16:24](https://syntax.fm/show/653/js-fundamentals-decorators/transcript#t-984) **Scott Tolinski:** And then that would create essentially a reactive private my value, and you get access to initializing it, getting in, setting it all within the decorator.

[16:34](https://syntax.fm/show/653/js-fundamentals-decorators/transcript#t-994) **Wes Bos:** And the the benefit of that is that, Like getting and setting the value to you, the user, is simply just saying my game dot score equals 6 Or console log my game dot score. Those are getters and setters. Right? And to you, you're just setting a property. Right? But what's actually happening under the hood is there's a get function is running and returning the private value, but there might be other things that are happening.

[17:03](https://syntax.fm/show/653/js-fundamentals-decorators/transcript#t-1023) **Wes Bos:** Updating it. You might be logging it. There's a lot that could really happen. And like I said, to you, the user, you're just accessing a value or you're just setting a value, but There could be a lot more logic under the hood that's going on, and this is just a bit of a shortcut to that. Yeah. Pretty neat stuff. Again,

## Benefits of getters/setters to end user (17:04)

[17:20](https://syntax.fm/show/653/js-fundamentals-decorators/transcript#t-1040) **Scott Tolinski:** As a primarily functional programmer, you know, it's not stuff that I feel like I hit all the time. But I do think Mhmm. That this is fascinating and something that, You know, makes me want to explore classes a little bit more given how powerful they can be. Yeah, absolutely. I think

[17:36](https://syntax.fm/show/653/js-fundamentals-decorators/transcript#t-1056) **Wes Bos:** maybe it's time we write a couple what, lit web component applications?

## Plan to explore classes more due to decorator power (17:37)

[17:41](https://syntax.fm/show/653/js-fundamentals-decorators/transcript#t-1061) **Scott Tolinski:** Maybe a full on Angular dev? Yeah, which one though? Angular or Angular JS? Which one?

[17:47](https://syntax.fm/show/653/js-fundamentals-decorators/transcript#t-1067) **Wes Bos:** Which one is the 1? In researching this episode, I Googled some like decorator for Angular.

[17:54](https://syntax.fm/show/653/js-fundamentals-decorators/transcript#t-1074) **Wes Bos:** Yeah. And

[17:55](https://syntax.fm/show/653/js-fundamentals-decorators/transcript#t-1075) **Scott Tolinski:** The old docs came up and it's just like, oh, like, is this still a thing where There are yes. It's still a thing and people correct you if you say the wrong one. So what are we supposed to say? Oh, let me tell you. Here's what we're supposed to say. Anytime I have to know the difference, I Google them both and compare them, And then I come up with the answer. That's what I do. If if I get an implant in my brain, at some point It's angular. Before I die, It's going to be just a function that returns the correct version of Angular based on what we're talking about.

[18:26](https://syntax.fm/show/653/js-fundamentals-decorators/transcript#t-1106) **Scott Tolinski:** I have no clue. That's like,

[18:28](https://syntax.fm/show/653/js-fundamentals-decorators/transcript#t-1108) **Wes Bos:** WordPress has a function. It's called it's capital P, dang it. So if you type WordPress incorrectly, like like without a capital p in it, it will AutoCorrect it to capital P. So it's a nice little function that fixes it. So AngularJS is the old one. It's been deprecated for almost 2 years now.

## AngularJS vs Angular version clarification (18:29)

[18:48](https://syntax.fm/show/653/js-fundamentals-decorators/transcript#t-1128) **Wes Bos:** Angular is the new one.

[18:52](https://syntax.fm/show/653/js-fundamentals-decorators/transcript#t-1132) **Wes Bos:** Not the new one, the one that's been around for forever. I'm just gonna say Angular JS folks,

[18:57](https://syntax.fm/show/653/js-fundamentals-decorators/transcript#t-1137) **Scott Tolinski:** just upgrade it and drop drop the JS. It's cleaner. That's that's what they it. No. I'm saying that the if you're still using the the old one, not not the Angular devs, not the people who work on Angular. I wonder how much Angular JS is still use. Let's find let's go to npm. Do people npm install AngularJS? I bet it's I bet it's astounding. I bet it is used By a 1000000000 people.

[19:20](https://syntax.fm/show/653/js-fundamentals-decorators/transcript#t-1160) **Wes Bos:** When I use Angular JS, I just put it use a script tag. Right? Like, I didn't npm install anything. Yeah. I definitely did that as well. Npm install Angular JS is some random package for Browserify.

[19:34](https://syntax.fm/show/653/js-fundamentals-decorators/transcript#t-1174) **Wes Bos:** Oh.

## npm installs for AngularJS vs Angular packages (19:35)

[19:35](https://syntax.fm/show/653/js-fundamentals-decorators/transcript#t-1175) **Wes Bos:** Oh, here we go.

[19:37](https://syntax.fm/show/653/js-fundamentals-decorators/transcript#t-1177) **Wes Bos:** Npm install Angular is the legacy Angular JS. Oh, no.

[19:45](https://syntax.fm/show/653/js-fundamentals-decorators/transcript#t-1185) **Wes Bos:** Bro.

[19:46](https://syntax.fm/show/653/js-fundamentals-decorators/transcript#t-1186) **Wes Bos:** So nvm installing Angular is Angular JS.

[19:51](https://syntax.fm/show/653/js-fundamentals-decorators/transcript#t-1191) **Wes Bos:** So if you want if you want Angular, The new version you have to at import. So there's 500,000 weekly downloads of Angular JS.

[20:06](https://syntax.fm/show/653/js-fundamentals-decorators/transcript#t-1206) **Wes Bos:** Let's see what

[20:09](https://syntax.fm/show/653/js-fundamentals-decorators/transcript#t-1209) **Scott Tolinski:** what the other one is. And three point 2,000,000 downloads of Angular Core.

## Many old AngularJS apps not using npm (20:14)

[20:14](https://syntax.fm/show/653/js-fundamentals-decorators/transcript#t-1214) **Wes Bos:** So it's and like and how much how many AngularJS apps are not using npm. I bet a lot because when I bet a lot. A lot of those apps were built, no we weren't using build systems. We're just Script tag, PHP, and, just like you were just writing Angular, like loops and stuff right in your HTML that was the whole

[20:36](https://syntax.fm/show/653/js-fundamentals-decorators/transcript#t-1236) **Scott Tolinski:** the benefit of it. Yeah. In fact, I have an Angular app That's online still. I just checked it. It's just loading it off of the script. So Is it Angular or Angular JS, Scott? It's it's it was it is Angular JS, but it's before there was a difference.

[20:54](https://syntax.fm/show/653/js-fundamentals-decorators/transcript#t-1254) **Scott Tolinski:** Oh, my God. I can tell you exactly what version it is.

[20:57](https://syntax.fm/show/653/js-fundamentals-decorators/transcript#t-1257) **Wes Bos:** It's version 1.2. It's a good one. That's a good one. When when did that come out? I could not tell you.

[21:02](https://syntax.fm/show/653/js-fundamentals-decorators/transcript#t-1262) **Scott Tolinski:** It does say it was using Angular route.

[21:05](https://syntax.fm/show/653/js-fundamentals-decorators/transcript#t-1265) **Scott Tolinski:** Oh, and yeah. The copyright is 2014,

[21:10](https://syntax.fm/show/653/js-fundamentals-decorators/transcript#t-1270) **Wes Bos:** so 1.2 came out 10 years ago. Wow. Yeah.

## AngularJS 1.2 released 10 years ago (21:15)

[21:15](https://syntax.fm/show/653/js-fundamentals-decorators/transcript#t-1275) **Wes Bos:** It feels like it was sooner ago. We should have somebody on to talk about

[21:19](https://syntax.fm/show/653/js-fundamentals-decorators/transcript#t-1279) **Scott Tolinski:** Angular. Yeah. Doesn't Sarah Drysner work on Angular now? I don't know. Maybe.

[21:24](https://syntax.fm/show/653/js-fundamentals-decorators/transcript#t-1284) **Wes Bos:** Every now and then we get people being like, I wish you would talk more about Angular. And same with Vue.

[21:30](https://syntax.fm/show/653/js-fundamentals-decorators/transcript#t-1290) **Wes Bos:** And we don't talk about them, not because we don't like them, because we don't use them. So maybe we'll have some folk on if you know somebody, the king of Angular tweet us because we're the queen of Angular. Oh, yeah. The queen of and literally anybody who is royalty in the Angular family.

[21:47](https://syntax.fm/show/653/js-fundamentals-decorators/transcript#t-1307) **Wes Bos:** Yes.

[21:49](https://syntax.fm/show/653/js-fundamentals-decorators/transcript#t-1309) **Wes Bos:** Alright. Anything else to add about decorators?

[21:52](https://syntax.fm/show/653/js-fundamentals-decorators/transcript#t-1312) **Scott Tolinski:** Oh, no. I don't. I don't have anything to add About decorators. But, you know, I think they're interesting. I'm glad to see that they're finally approaching, hopefully, a place where they're actually being added to the browser. Beautiful. Alright. Thanks, Larry, for tuning in. Catch you later.

[22:07](https://syntax.fm/show/653/js-fundamentals-decorators/transcript#t-1327) **Wes Bos:** Peace.

[22:10](https://syntax.fm/show/653/js-fundamentals-decorators/transcript#t-1330) **Scott Tolinski:** Head on over to syntax.fm for a full archive of all of our shows.

[22:15](https://syntax.fm/show/653/js-fundamentals-decorators/transcript#t-1335) **Scott Tolinski:** And don't forget to subscribe in your podcast player or drop a review if you like this show.
