Placeholder Image

字幕列表 影片播放

  • Hello.

  • Uh, when I started this.

  • Hi, everyone.

  • I'm so excited to be here.

  • I hope you like my talking is the last one.

  • Were everyone a living target?

  • But today I'm going to talk about the stencil, which is this open source project we have been working for the last few years.

  • I mean, you know, I have a compiler can help you build with applications.

  • And in general, most specific.

  • Gibbs decided systems.

  • So my name is Manu on a work has a civilian year at Ionic, which is the team that builds ironic framework and a stencil itself.

  • So we basically are a company, a towing company.

  • I want to be able to help Web developers build applications 100% based in technology.

  • So, uh, okay, So before gained into much detail, I want to start with the true history.

  • Is that 12 years ago, jealous creep was not what it is today.

  • It was a mess.

  • Different browsers have different behavior in from Explorer on escape on the strip itself.

  • Like the high level FBI's that today we consider basic.

  • So what's really hard to break?

  • Cos application on top of it?

  • Um then something happened, you could reappear, and he came to solve all the problems that JavaScript hat at that time.

  • It normally beekeeper between brochures and provide a higher set off a pea eye so that, actually, some of them are part off off the web today, like curry selector.

  • So, but the biggest innovation is that it allows JavaScript to grill.

  • What's the language on Hello to be used for more complex application that just like some simple form, elevation and, in fact, May company Bill Kartika.

  • Which one was one off the first descent systems?

  • Reckon drop tools for your components on it was basing equerry mobile.

  • So in order to instance, she ate and create these components.

  • You will have to use the imperative AP I off you query.

  • So we work.

  • But it wasn't great.

  • Some years later, angular years appear on the eco system was a little bit healthier.

  • So the problem is that JavaScript had angry.

  • Yes, had to solve was not the same ones.

  • It doesn't only provide a higher layoff.

  • Higher level AP eyes, by the way, are working.

  • We're organising set off good defaults.

  • What today we know has a framework so that helped you escape to grow even more on introduce the country of directives that that was my going to us.

  • And it was closer at our idea, off of components.

  • So we were so excited about it that we decided to put everything we got into into these new system because it's what's the biggest there forward on.

  • That's how I only want four.

  • Then read.

  • Yes, Dangler team announced, angular to Was was going to be faster is smaller mobile first, everything s so angry he has worked so great for us that we just decided to make the investment on.

  • That's how ironic to bionic three months more.

  • So even the name is the same.

  • It would require a completely effective on.

  • Think about that.

  • This is already the third time that we have to go the same components on today.

  • Well, they're consistent is completely different.

  • There are many fingers and alternatives on All of them are great.

  • It just depends on your own preferences.

  • You're keen, your team, your skills, your product or even what just issue for hiring a specific country.

  • So going back to our mission as a company that we want to help all the Web developers, not the ones used in ah, specific framework.

  • So we start thinking about how we could achieve that, how we could if we have to port these 100 components to every popular framework off today and maybe tomorrow.

  • And of course, the answer is not.

  • We know that we have to go through this reflector many, many times on.

  • We know that that's not going to happen.

  • It's so time consuming its We quickly realize this is not going to be the solution, So we have to think about something else.

  • Andi think like frameworks are great for building the final products.

  • Even if you say that reacts not a framework, it is.

  • They built a framework around it and that's not nothing.

  • It's inclusive.

  • Okay, create recap A.

  • Rather a way of organizing a way of testing a set off good defaults.

  • And that makes sense because at I lose you to focus into a building your product, you don't have to make this hundreds of mixture decisions every single time.

  • So So, yeah, I have remained with the wheel every time, so but at the same time, they are terrible for building reusable components on.

  • You might say that this is working for you today.

  • I mean, it did for us, but at some point you might want to use a different technology or your use cases change.

  • Or you just want to serve your components with more people on.

  • Not only people will use the same framework.

  • So the point off building reusable components is to last in time, right?

  • So it's pretty much like investment.

  • You make too low you to build faster in the future.

  • So it used to build them on double future proof.

  • Technology is the Web does the web.

  • That doesn't change.

  • So the solution off this problem, of course, is where components.

  • But again, this is very important component doesn't not not solve any other problem.

  • Yes, universal model of components on.

  • Even if you like it or not, you will work.

  • So I'm sorry for a record sometimes, but this is will work.

  • You can go around it.

  • So, um, but it said it doesn't handle anything else.

  • So you still I believe that frank words Pulis's forever.

  • They will not be replaced in the same way that angular and react and view does not replace the FBI's the Web MPs off today?

  • Yes, live together on off course.

  • We know in the past that so maybe eyes were baby that break.

  • They remove sometimes.

  • But there is something in common for AP eyes that have a full consensus across browsers is that they will be around forever.

  • So even if yeah, so think about the website you build 20 years ago.

  • You still works today because the way can break a thing we can break that they went can't.

  • So if you were aware component with it, it will still work in the future framework.

  • So around that idea, um, off we want We don't want to make a decision off the frame where you have to use because we don't know your product.

  • We just build the components.

  • So I ran that idea We create ironic to the lightest ionic gunning for is basing weapon points on this fourth re factor is very different because this time we them build on dub off the angry RGs directives or the angry components.

  • This time it's Bill on top off standard Web.

  • Yes, they're just web components that staying the female.

  • So, um, but when before doing that, we found that, as I said, like, we're components of very little label that says he doesn't solve any other thing.

  • So what happens when the Soviet Union has to deal with a, you know, with a low level?

  • Okay, well, they just scream.

  • The next eruption on that usually comes with a new problem and the safe off overhead.

  • But I'm not saying this upper four months of ahead.

  • It's a knowledge random locking You are not.

  • You are not longer building on top of this.

  • Fix it.

  • Well, maybe you're building on top of something else that can break on change, so we'll start thinking about what will be the sweet spot here.

  • What if destruction is a computer time, meaning that the reason of any specific framework in specific ranting So you see your component, but that doesn't come with a well defined phantom.

  • Instead, the compatible take Your components on generate the best possible sort code.

  • I mean, it will generate the best possible component.

  • This has worked for the gates like combined languages like C and rest.

  • They don't have to care when Interval is a new Cebu or they have to target that if different CPU architecture instead they just use a different compiler or they upgrade the existing one on that.

  • Exactly.

  • Re stencil.

  • It's It's a bill time disruption.

  • It's a compiler for the well.

  • Ah, as technology, the web will be this always moving target.

  • Sorry, The the weather will be the hardware this always moving target.

  • Understand?

  • Seal the compiler taking your components on using the newest Nu Nu s A P eyes without developing having to make any single change.

  • So the idea is that we are not only able to unit highly optimized components, we will see later, but a bullet making any kind of breaking change on this is really important for us.

  • It's the main use case because we are.

  • We have already go through all this reef actors on, um, our main use cases to build reusable components aside, implement design systems on being future proof.

  • So we have the same design.

  • They have compiler off stencil to restrict ourselves to a stander interfaces like glasses from properties.

  • It's female attributes and dom events were Don't try to half a stencil way of doing things.

  • Um so this way we can keep changing how the computer worse, the initiations.

  • We apply on using new new FBI's without recording developers to make any change.

  • So, for example, let's say that next year Kirm soups a new feature at this a built in beaver or some kindof template system.

  • This is going to be built into the grocer, and it's going to be much faster because, well, it's probably programming in c++ wherever these, um and you don't have to see any escape, right?

  • So in a stencil that could happen on, you'll now have to make any time.

  • Well, yes, third year component on change how that thing works.

  • So even there is not a specific render like even, you know, like we are using some specific rental render, we could change it.

  • So, um, in addition, we can support or brushes in the same the same idea.

  • Like they say, compiler can't different can generate different targets for different browser.

  • A C compiler can't different candidate goal for different architectures.

  • We can do the same for different browsers without developers having to think about it.

  • So, for example, the mall they're building most of your juicers actually using chrome Firefox.

  • So far your modern browsers will get the smallest bundle without any kind of Holyfield without using Mother Tapestry features like Native isn't a weight or, yes, models on old browsers.

  • Well, if you have to support them like inference, lawyer people get there a little bit bigger.

  • Yes, five bundles on this, an example off the same component it's I Am Button.

  • It's a beta mus, a button with material designed and now us styles.

  • The stencil the compiler generates after eight different Burstyn's.

  • But that doesn't mean that the that decline will have to download all these six files.

  • Its father is just going to download one of them so we can see that some files have the years five Perfect or yeah, so that means that it's yes, five old coat S C means that for browsing the Dustin's Reports album.

  • But in any case, this way we can cover the whole spectrum off browsers in the most efficient way on we can provide, and we can do it with the vests.

  • Developer spins the ones you're used to it because think about it.

  • We build a stencil for us and obviously we use framework before, So we wanted to be productive the same way.

  • We're not telling our engineers too bright, you know, like assembly, you know, like assembly for a weapon that will be their components.

  • But, um, have this this every select service workers in its imprint rendering fast incremental builds like a deep interrogation with the script and their types.

  • You know, doc, generation we take the static analysis of this component and we can even get out of the unit.

  • I've read me that.

  • You know, you just deployed your ducks in there, get up having to make any change, or we have radiation output where we can integrate with things like a storybook or your Houston Web generator.

  • So, for example, for the docks off Ionic, the website, we use the station target that puts all the information on even like the bombs We even part of the CSS on.

  • We extract the CSS valuables that you might Who's because this was a big deal for us on?

  • You know, we have peaceful day of testing.

  • We use puppeteer under the hood.

  • Everything this is already don't you don't have to implement.

  • These things are confused these things.

  • So we have built this in the sample.

  • Michael, eat brandy.

  • They fix some issue with that eye on I'm put on here is different.

  • We can review that previously, but the idea is that we can have their components and still have a framework level features.

  • Today I'm announcing a big milestone in development of development office Stancil Estancia one on human heavy wonder we're using, uh, we're not using numbers yet, like from 1.0, but because essential oneness is incremental, it's not the incremental release, its second solicitation consolidation off, baby since l was initially built to solve the problems at Sonic, but it and absorbing a lot more problems for a lot more people.

  • So during the Lexus months, we have been collecting all this week bad for 1000 of developers on Use me to consolidate this FBI.

  • That way, we're proud off.

  • In addition, we have a new, random new compiler.

  • So one of the most interesting things about the stencil is that when you instances about components, right, so you're not using it.

  • Most of them to treat a nap, right?

  • Ah, So how will you handle the least slowing?

  • Because most of the time it's about routing routing base laced loaded.

  • But here we can have that.

  • So instead, we took a different approach.

  • Is a component based laced loaning because we want to use a stencil to build its components, but they will be used in different places.

  • They will may be used in react.

  • We have a unique react, Yannick.

  • Angular.

  • They have different ways of lace.

  • And so in order to do that, essentially is able to perform this a static analysis off how the components depend on each other on a play the best of initiations on the rubber, something have to deal with it.

  • So, um, insensitive one.

  • We have a new album inspired much learning technique Warren beddings and I'm going to split because kind of weird.

  • But the thing is that our use case, all the components are entry points because we don't know how they are going to be used.

  • So, like traditional talking l Williams like, they want you singing *** or roll up people just to get a different bundle for the application for each component.

  • If you want to lace below them.

  • So if you have 20 different components at the same time, you will have to download Tony foreign friends.

  • So we come up with a new going to make this speech.

  • So, uh, in this image we have nine components on.

  • We use numbers to name them.

  • But you could imagine thing has paid logging Pesatori alarm button.

  • However so thanks.

  • The aesthetic analysis I said before, like, off her components depend on each other.

  • Like how the you're abusing the templates.

  • We can extract information off the dependencies within components, and that's what these lines represent.

  • All right, So the next step is to resolve the transitive dependencies.

  • So, for example, if we know that the component one depends on three on three depends on six.

  • That means that by the transitive property, that one also the bends on 60 damn it.

  • Okay, make sense, everyone.

  • Yes?

  • Okay.

  • Uh, so we keep way basically do the same with all the components.

  • Okay.

  • Um, so let's focus and then complaining.

  • Number nine a lot off arrows pointing to it.

  • That means that it has a lot of dependence, but some component, like five doesn't have any.

  • Okay, let's focus again.

  • The complaint number nine I said said each arrow re presents are dependent So in this case, we collect the dependence off nine.

  • So he died.

  • 3164 and chew right where these lines are coming from on.

  • We do the same with all of them.

  • Just it.

  • Yeah.

  • Yes.

  • Okay, So let's focus again in the complaint Number nine that were, for example.

  • So we have Let's get the dependencies.

  • So, uh, we go, we get over the older data, but we just have to encode it in different their structure.

  • So what if we could What if we could convert these dependencies if each component into a vector, just like Ward and Barrons do with words?

  • So we have So, for example, the component number.

  • Let's let's encode one.

  • This put a one when it's independent on the Sarah.

  • When is not so one?

  • It's a component is a weapon or not?

  • It is right.

  • Yeah, Get one, two, 34 years are well but five, but it's not.

  • We don't have any IRA pointing to six so well in cold with zero six it ISS on seven 89 is not okay.

  • Well, we do the same with all the components on we get an array off vectors So what?

  • We had transferred Island turned for our components Director.

  • According is, we could imagine their hands points in the space.

  • In here is a three D space.

  • But you could imagine than us, you know, with more dimensions the core ideas to group together the components that are close enough in this space.

  • But in order to know if they're close enough or not, we just have to calculate the distance on How do we calculated distance?

  • Well, he is my friend.

  • A terrorist philosopher mathematician.

  • The ancient Greek used to forming hands.

  • Really?

  • Smart guy came up with this famous algorithm that you probably remember from school that relates the Lexx off a triangle with her coffin was I have tried.

  • This is war a lot s so in this, it's example the hypothalamus.

  • Exactly a distance between the two blue circles.

  • Okay, well, I'm not here to scare you, promise, but in our case, believe it more complicated.

  • Well, there's more than two dimensions by the DEA.

  • The same.

  • Turns out we can use the generalization off the fifth, every inferior to solve this problem.

  • And that's exactly where Theis fucker, it's story s o.

  • We calculate the distance between, uh, all the points, even if there is 100 dimensions.

  • So going back here, we just bundle everything on this.

  • We have testes approaching both internal external APS, and we have found that it's much better than anything.

  • We have trained the price in big app units bundles better that if a developer will have to try to bundle this 100 components and most efficient way because mostly things that the conditions are changing.

  • So this time, in addition, you know, like now imagine that perfectly optimized bundles we can even generate hints so brochure can download parts all the assets that your application need.

  • Uh, yeah, the critical half.

  • So in this example, we have the model pre load for all the JavaScript because we use modules.

  • Nathalie.

  • So all the required political parties don't load like you're in parallel.

  • I will say eso nothing is out.

  • Faster run thing.

  • We have profile on re factory, Brendan to be much smaller and faster execution time.

  • So the new Ram time Ah boy's pattern like optimization killers and a sink away.

  • That basic schedule we use newer a p I like constructive with style seat.

  • We used native NCIC See modules.

  • A single weight eso In this bank charge, we have 800,000 I'm buttons components on you might look like it's a simple component, but that the hood has a lot of classes, a lot of nested component that will try to replicate them, actually sign and IOS science.

  • So in this a stress test, we actually having 200,000 notes.

  • Historically, it took six seconds to fooling you sliced up with stencil one.

  • It's three seconds, and it uses pretty much half the memory, which is, uh, so two times faster and full head Graham.

  • Uh, okay, let's continue.

  • Another advantage of fusion a compiler is that we are not longer limited by our by, you know, by three seeking to remove part of the code that are not required.

  • So instead we can combine all this made a data that we have with three seconds in order to heavy of commands components.

  • So ah, hello World app compiled with the stencil.

  • It's so small you can barely see it.

  • It's just 133 bites on compress.

  • Uh, well, why it's so is small because he doesn't have any.

  • I mean, it's a hello world, right?

  • It doesn't need any rent them.

  • So the compresses even a smaller.

  • But here the important idea is that while ah, hello, World example isn't really an artificial example, we're really proud about the power off a computer can do a plain heavy optimization tze and completely remove what it's not needed in specific round brushes if it's needed, some possible also include that.

  • So, um, this after initiations, cannot supply to bigger use cases like a complex application build with bionic or the like, almost like a stander to do NBC.

  • So in our case is just 2.4 kilobytes, Um, and to put a living, the work context well, the same application with different technology.

  • We feel really proud about what we have achieved on all of these without messing with your no models.

  • You probably have seen this image before.

  • I think the first thing we also see it, but you know it's a good example.

  • It's usually no more Ulises, heavier than a supermassive flat, for when you're installing, it may take a couple of minutes.

  • Okay, Eso this is but in general, it's a big problem today not only because there is a dependency help in every every project you don't know which called.

  • It's running.

  • Actually, there is unhealthy dependency in practice package package manager like I have nightmares with, like, mpm apocalypse or something like you can download any more anything.

  • So, yeah, there's many things moving on, like moving parts, and they were projects on developer Silver.

  • The find creative ways to get around and get some space in their computer.

  • So, um, so one of the the same principles have essential is to keep dependencies to the minimum, so it doesn't really make the its talons installing experience much faster.

  • But you're pro yet more future proof on stable.

  • It's not if it's not the first time, at least for us, that a dependency off that dependency change on finding a solution becomes a problem.

  • For example, I think for no tests, you update to note 12 and stop working.

  • So it's this kind of thing, like tons of dependencies.

  • So, for instance, if you open old modules, in essence you're started.

  • You'll only find two folders, stencil and type of script.

  • Here at the line.

  • We have the largest essential drawing Noel the coast one out a stencil is a tool you use to paint something, but it's not longer there.

  • You can use the same stencil many times, but this never part of the final product.

  • And that's why est en Ciel has the name it has.

  • It's like my max.

  • My CEO said it's like reading the stencil for components on.

  • We said that, um, when you build a component with a stencil when you be, like, important with other delivery lead element, react well, our view, your components, you are below two m p.

  • M.

  • Half a strong dependency in this in this framework and in this particular person off the framework.

  • But the components you generate with a stencil, they're not the stance of components.

  • They don't have a dependency, understands you, so yeah, so they don't even depend on it.

  • Now, if I have time, I really with Evelyn.

  • So I have a quick demo How you see this?

  • Uh, you see if I can I know, See very quickly.

  • I know.

  • Limit.

  • No, it's okay.

  • All right.

  • Okay.

  • So, um yeah.

  • So we have the terminal.

  • Well, yes, Ron MP, innit?

  • Stencil.

  • We run it we select.

  • We're going to create a simple act.

  • But most of the times this component a nap.

  • Uh, yes.

  • Come done.

  • Yes, it's already.

  • Don't load it.

  • You will have to is already unloaded.

  • The stuff that we've run in Pyongyang stole for you.

  • So when you select the start, there were.

  • So you start.

  • So while you was typing the name, we already start downloading everything.

  • So now we just go here.

  • MPM start.

  • I'm using it, actually.

  • So, uh so, for example, here we have a very simple application.

  • We Can we have this?

  • These features had talked before about a federal level features.

  • So if I open the coat on, I tried to make any change.

  • Even though these are components I can have, like holding were hold module replacement.

  • So, for example, here, I'm just going to make it just going to make the thing.

  • The button from profile page to hallow bait Safe.

  • Um, on.

  • You know, you may want to run the docks, will you?

  • Yes, we'll go here on the configuration and you will treat Naboo target like type docks and say we have doc station.

  • Read me.

  • So if you have that and you run the bill, it will generate us a really file in every in here in this folder.

  • In this following this folder with studying analysis off its components.

  • Let's say you want to prove renders debate.

  • Well, this is this is something that you will not specked with components.

  • Here, you will guess.

  • I'm going to see if I was running.

  • No, Stop here.

  • Stop it!

  • So it will say MP and ground build rear ender in this case, it will run out.

  • Probably will enable.

  • Yes, actually created.

  • Read me file on brain two pages.

  • Well, we have a profile page on that one on.

  • Yeah, I I think that's pretty much it.

  • Okay.

  • Uh, yeah.

  • So you I really encourage you to check it out just until yes dot com Noah just mpm any distance he'll give you a try?

  • Uh, yeah.

  • It's like magic s o.

  • Thank you.

Hello.

字幕與單字

單字即點即查 點擊單字可以查詢單字解釋

B1 中級

Stencil:一種構建時間的網絡方法,作者:Manu Martinez-Almeida | JSConf EU 2019。 (Stencil: a built-time approach to the web by Manu Martinez-Almeida | JSConf EU 2019)

  • 0 0
    林宜悉 發佈於 2021 年 01 月 14 日
影片單字