 PC042, intro, take one, marker. Hey there, Polycasters, Rob here. Welcome back to another segment of Ask Polymer, the show where you send in questions on the various social media networks out there, and I do my best to answer them. Okay, our first question comes from Danger Manly, who asks, for elements that contain Iron Ajax, how can we mock their behavior? So, interesting question there. Web Component Tester itself ships with a few clever tools that can perhaps help you out here. The first is a function called stubElement, and you can use that to actually replace an element that is like inside of other elements. So you could say stubElement, Iron Ajax, and then as the second argument, you could pass in like fake Iron Ajax, and you could actually create your own mock element that'll swap in right before it does the unit test. That is one approach. The other is to use something like Synons fake XHR server. So that also ships with Web Component Tester. The Synon command is there for you. So you can create a fake XHR server, actually have it send back fake responses, and that way you don't have to spin up a server yourself or anything to like feed your test data. You can just use this little mock server and feed data to Iron Ajax that way. So two options there. If you're curious, we actually have a video that maybe goes a little bit more into this. It's from a talk at Palmer Summit by one of our team members. So you can check that out over here. Our team member, Chris, who created the stubElement stuff, he actually gave a whole talk on this stuff. So go check that out if you're interested. Thank you, Danger, for that awesome question. Okay, our next question comes from Alan, who asks, if I'm using something like Iron List, I'm scrolling through thousands of items. How do I know, how do I detect when the user has scrolled to the bottom of the list? So that is a very good question. Today it's a little tricky to do that, but the team is building an element called Iron Scroll Threshold. So you can combine that with an Iron List and that way use a little data binding and it'll alert you when the user has hit the bottom of the list. That way, if you have a million items in your list, but you only wanna load the first hundred at a time, the user can scroll down to that first hundred, then you can get that binding event, you can then go lazy load another pack of hundred items and sort of keep going that way. You can build kind of a good infinite scrolling experience. So yeah, using Iron Scroll Threshold, I'll link it down in the show notes and you can combine that with your Iron List and hopefully get that kind of cool, smooth infinite list experience that you're after. All right, our next question comes from Cody, who asks, how do I load external JavaScript frameworks into my components? So this is sort of a tricky bit here. I think Cody was asking, how do I load like jQuery into my element so I can use it for selecting stuff inside of my component? In general, we recommend not trying to use things like jQuery inside of your element definitions. It creates two issues. One, it means that anybody using your component is gonna have to also depend on jQuery, but it also is tricky because jQuery right now doesn't really know how to work with Shadow DOM and so you could end up in weird situations where you're trying to select stuff and it's not quite working and it's not clear why. So in general, we recommend just sticking with vanilla JavaScript inside of your element for, you know, speccing out its definition. You can, however, depend on external libraries that do things like Moment.js is a good example, something that like converts timestamps for you, things that aren't interacting with the DOM necessarily. You can load those in using HTML imports. You can create an import for one of those libraries that just contains a script tag and pull it in that way. So that's totally acceptable, but frameworks that wanna manipulate the DOM probably wanna stay away from using those inside of your element definition. So thank you, Cody, for that question. Okay, our next question comes from Tom, who asks, what should I keep in mind when styling CSS for web components? So I think the main thing to keep in mind is you're working with Shadow DOM and if you're not familiar with it, it can be sort of tricky because it creates this sort of style bubble around your components. I think it's really useful to learn how to work with custom properties and how to work with CSS mixins. Both of those are features which Polymer uses pretty heavily to allow you to, you know, jump over shadow boundaries and style the internals of components without having to like violate encapsulation and know what's going on there internally directly. So if you're not familiar with those things that I just said, if that just sounded like a bunch of crazy words, you can go check out this guide over here that we've created on how you style the Shadow DOM, which we actually sometimes refer to as local DOM. So the guide is styling local DOM. You can go check that out. That'll explain custom properties, that'll explain CSS mixins and a lot of the things that you need to keep in mind when you're trying to style your first web components. So thank you, Tom, for that question. All right, the last question comes from Alos, who, he actually asked a lot of questions, but he asked, when are carbon elements coming and when will we get ES6 with Polymer? So carbon elements, we're still working on those. We don't have a definitive release date for that just yet, but we're hoping, you know, maybe in the next one or two quarters those should start to roll out. ES6 and Polymer, that's something that I think we really wanna work on this year. We wanna make sure that everyone can write their component definitions using all the latest and greatest ES6 syntax. So within the team, we are actually working on some tools which we're hoping to release, again, probably in the next couple of quarters to let people start to use ES6 with their component definitions. So I know it's sort of a bummer to say like, you know, it's coming, wait on it, but this is stuff that we are actively working on right now. We just finished a bunch of meetings talking about both of these topics. So look forward to more on both of those fronts in 2016. Okay, so thank you everybody who's sent in questions. Lots of really great things this week. If you out there, if you yourself you've got some questions for me, you can leave them down below in the comments or you can ping us on a social network of your choosing at hashtag Ask Polymer. As always, thank you so much for watching and I'll see you next time. A lot of good questions today. Thank you everyone who's sent in some stuff. What, why is everybody laughing? Take two. Thank you all who's sent in some stuff. God, it's all right. Take three. Special Agent Cody Weaver sounds like a cool detective name.