All right, thank you for that lovely introduction and stalling My name is Julian today, I was not planning on speaking I was hoping maybe just to organize this time, but we had a couple cancellations and I wanted to make sure we had some Gutenberg content So what I'm doing today is kind of walking us through a Short version of a workshop that I gave at WordCamp Europe. It was a three-hour-long workshop So just bear with me here because what I want to do is I'm gonna make sure we all have a chance to look at a lot of this code I'm gonna I'm gonna ask in a couple minutes, you know What kind of experience we have some of this might look a little crazy just depending on where you are I? Put the slides link in here, but to be honest After I thought about it for a second. We really don't need it because I'm gonna be Showing so much code off Which I will give you a link to the code at the end. So just a quick introduction. I'm Julian I'm the technical director at craft peak. We make websites for breweries My Twitter handle is right there. If you want to take a picture or tell me that I'm wrong I like dogs and motorcycling and I've been really into traveling over the last couple years Just came back from WordCamp Europe in Belgrade, Serbia, which is where I gave this workshop With Zach Gordon and he's a pretty popular educator in the WordPress space And he's doing a lot of JavaScript stuff and Gutenberg stuff So I will say I highly recommend Taking his course if you're interested in learning a bunch more I've helped him edit some of that and work on that content. I also play music and I really like cooking There's lots of other stuff. This is my dog Wilbur and you could see the mountains, but it's not gonna work on the screen That's my motorcycle, but that's kind of what the mountains look like on the way down to South Carolina from here Like I said most days I do websites for craft breweries We work exclusively in the brewery industry and have about 50 clients Kind of scattered across the East Coast and all the way to Colorado and then two in UK and we do the Econ we do e-commerce for them as well as websites and you know basic online marketing stuff I'm also a Member of the roots.io team so I work on a lot of the roots tools like sage the starter theme bedrock Don't do so much work on trellis, but I highly recommend checking that out. They're all free tools and Then for about three years, I've been very seriously doing JavaScript development I did react for I've probably been doing react for about two years I think the Gutenberg decision to go with react was Really great for me because it felt natural I know that it was kind of upsetting for some people But I think that we've ended up in a really good way and I think that I'll be able to show some of that off here today as well So really quick I just to get away from the code. How do we how do we feel about Gutenberg right now? Are we excited?  I'm very scared I'm confused I think that that's also valid to raise your hand and You know if you really have never heard of Gutenberg Unless you're my girlfriend sitting in the back because she's watching me You could go to John's talk because John's going to give a really good thing. I won't be mad if you get up and leave Are we getting ready for Gutenberg is if anybody currently trying to get ready like actively at their agency Okay, or or you know in their work cool so I think you know right now it's a little complicated because everything's in beta right now and Still I mean it's stable But it's you know it has you know all these installs and still two stars on on the repo and it's pretty scary But regardless it's happening so we have to get ready for it and as developers We have to know how we're going to move over all this custom functionality that we've had I know a lot of us I'm included a lot of us use advanced custom fields to keep track of metadata on pages and There's some really exciting things about Gutenberg when I was first getting into it I was very upset because I was like this is gonna take me a long time Now I feel like it's gonna be worth it and for us We're kind of a platform when Gutenberg launches and I have enough time to move all of our clients over I can very confidently say for us. It's gonna feel a lot like a 2.0 for a lot of our clients So I'm personally really excited. I'm also scared for the amount of work that I have to do So let's talk about Gutenberg blocks for a minute I'm hoping that we all have a little bit of experience, but this is you know You're gonna go add a block and you've got all these kind of I've got a bunch of example blocks right here from Zach Gordon's example block repo, which I will also link to in my slides It's a really good way to get into this block development and my block is a combination of all of the most complicated Possibly complicated parts of the WordPress Gutenberg API except for the sidebar API so I I'm not gonna ask all of you to have the prerequisite of even building a block today because I'm gonna explain some stuff But I will say at the workshop that I taught our prerequisite was that everybody had built a Gutenberg block because we had another workshop where people were building it Zach Gordon has an example block Repository on github is really great just to look through because there's some really simple examples to get you started So Gutenberg blocks are modular and usually independent and what I mean by that is that you can move them around and also they eat They each keep track of their own data They're gonna be registered in JavaScript There's some methods via PHP and there's going to be some more methods via PHP If you want my personal opinion don't really mess with that. It's not I don't think it's very useful Because you're gonna be building these things in JavaScript so to me it makes sense to register your blocks in JavaScript usually these blocks are built with react or You're gonna have to use a combination of react or whatever framework or whatever regular JavaScript. You want to use All of my examples today are going to be in ES 2017 DS6 whatever latest JavaScript you want to use Blocks have two different types. This is a super important distinction to make so I'm going to talk about it for a second when we get to Kind of a little bit more of the code example, but static block types Store their own data and what that means is that when you go in and you go to add a block into the back end And I'm gonna show you here in a minute, but when you go to add a block in the back end That data is saved to the post content. So it gets saved locally into the post, right? It's not global. It's not across Different areas of the site It's in the content the actual content of the post there's also block types called dynamic block tapes and To me dynamic block types are where we start getting into the advanced custom field world and where we start getting into this a Lot more options for where your data comes from and where your data is saved is really powerful But what I will say with dynamic block types Unless you program it to be this way you cannot have multiple And you're gonna see it here in a minute But let's just say you have your source of your data coming from a meta like meta attribute and then you put two Blocks on the same page that both get that same meta value That's gonna get kind of weird with the editing experience and when you hit save. So just be careful with dynamic blocks That said They can be used in so many different ways and when they're rendered on the page You can actually make it so that it's regenerated. So Again, I'm gonna say static blocks are saved into wp content, which means when you hit Update it gets saved into the post and then when your post is displayed it gets shown right that makes sense That doesn't that means if you have dynamic data You can't use a static block because it's just hard saved into the post You have to use a dynamic block a dynamic block can register, you know have new data And we're gonna see this here in just a second Blocks can come from a lot of different data sources like I mentioned Dynamic blocks is literally like writing little snippets of PHP of what you want the block to look like and we're gonna see that but Static blocks also have a lot of different data sources and types you can get data from you can like, you know have a text field or a number and Kind of change around all that those options are available in the API But I'm not gonna go over this Okay, so if you could raise your hand really quick and have we worked with react or a JSX? Okay, about half the room Have we made a WP API endpoint ever a custom WordPress API endpoint? Have you ever made a brick Gutenberg block? Okay Have you ever are you using Gutenberg in production? I don't even I actually not a lot of raise my hand Um, I am not although I will be adding it to my to my personal lips. Oh, actually, that's a lie I built a blog with Gutenberg. Um, it kind of works. So So I think you know at this point I will say I wanted to cover everything on this page and I Don't know I might just kind of not talk about the API endpoint But I'm what I'm gonna do is I'm gonna give everybody a link to the slides and you can see the code examples and I think a lot of things will click but Due to time you're gonna have to just trust me on a couple things So the block that we're gonna build today and that's basically already built I'm gonna show you the code that powers this block is a very Simple block and this block is made to Basically get some points across But it's insanely over engineered. So if you were ever going to do what I'm doing Yes, it is definitely the right way. It is like way too far the right way But it's a really good way to show some APIs some some really cool ways to build some functionality and this This block code that we have on github is is a really good Recipe for some pretty custom stuff that that you all might need to do if you're for example using advanced custom fields or something like that So we're gonna be using very simple JSX components and for those who don't know JSX is a templating language that is Built into react.  They do not do logic or anything. So we're not gonna be showing that we're gonna be doing that Where it belongs for react? We also have an API endpoint that we've built as part of this For basically a ticker and so what this block does is if you can imagine at the bottom of a page You might just want to have a little heart button like have we ever seen on medium? How there's like claps or whatever. This is a heart button and when you click it it Adds a like or a heart. It's a react. It's a reaction and that's it. That's all the block does King of over engineering we're gonna use Wp data, which is a new API in the back end of WordPress. Thanks to Gutenberg Gutenberg uses it internally Wp data is basically React reacts well, it's not really it doesn't even have to be react but redux. I don't know if we've ever heard of redux It's a state. It's an application state management Methodology, it's a tiny framework. It's 50 lines of code But it basically is just says very explicit things about what data is on the page right there And it helps us build Applications, I'll explain this a little bit, but also Gutenberg uses Wp8 Wp data constantly and it's actually really cool to see it watching you can do something called subscribe to data stores It's this is just for on the page you can do something called a subscribe and you can actually add that call in to subscribe and Watch it as it updates. So you can see all the updates that that Gutenberg makes. It's really cool The other thing I just want to say is you're gonna see me using the WCEU 2018 Gutenberg reacts it didn't make sense for me to change all the code over just for an example So that is also probably an over-engineered post meta key But nobody's ever gonna use that for their plug-in So that's where we're gonna store this counter and literally it's just a number and we're just gonna increment it So the process of building a block like this that has a lot of moving parts and Actually, let me just let me hold on. Let me just show you an example of this of this block really quick Local so you can see this site. I'm gonna go to the individual post Check it out Whoa Seriously, that's it. That's all it does If we look in the back end here My password is password If we look in the back end here There's our meta value So let's just say I wanted to then you obviously would not have this on the back end of your site But this is just so that we can see that we can update the meta value to By hit update Look how fast that is these are the cool parts about Gutenberg right like that was instant because there was an Ajax call It just happened there. Nothing had to hit save the page wasn't refreshed It's so awesome and if and if you haven't seen I mean, you know adding things. Why is it making me login again adding things? Here actually, you know what I just remembered I just remembered that I haven't turned on screen recording So just everybody hold that thought Sorry All right Save me That means that if I didn't record my screen because there's so much live code I wouldn't allow this on WPTV And I want to make sure this one gets recorded So if I want to add like a regular block and I don't even know if we've ever even seen this So I'm just gonna show you really quick like there's some really common blocks like I can put some text goes here And I can you know make this center aligned and I can move this block up and it's just such a quick reactive Amazing experience. I still think there are some holes and in this compared to what what, you know, we use but It's just so fast the way everything happens and and I think it's really exciting So again, I changed the meta value in the back end just so you could see there's somewhere in the database But I'm gonna click it again. This thing doesn't even check to see if you've already clicked it So you could go back and refresh the page a hundred times I would probably just use a cookie or something like that if I didn't need authentication, but anyways That's all this block does So what we're gonna do our process in building this block and what I want to walk you all through is Registering the block because you have to tell Gutenberg on that page when you low Gutenberg up You have to tell Gutenberg that a new custom block is available We're gonna go through the block attributes and metafields which in our case is just one metafield coming from the database We're gonna look at how the front end block Output happens which is again because we're using the dynamic block. We're getting PHP to render this block And I'll show you that we're gonna build some dumb components that get data from smart components or containers It sounds very fancy, but it's just a thing that provides a thing that has markup with some information So all it is we're gonna register a new WP data store and that store is Again a redux store. Does anybody have experience with redux here? Okay It's gonna be fine It's really cool So I'll cover it really quick, but basically We're gonna have we have to tell WordPress that there's a store that we're gonna save information to in our case It's again insanely simple because we're just making a number go up And in fact, we're not making a number go up in the back end or in the front end or or anything like that The the the the number goes up by an API request and that's server side Only doing the logic you're asking the server to make that happen So then we're gonna build this API endpoint Which I think I'm actually gonna skip over because that has nothing to do with Gutenberg, but I'm gonna explain how it works Then you have to build your smart components and those are the components that wrap your dumb components and provide them with data Smart components can also be used for actions. For example, there's a component around the heart that when I click it All it knows to do is to handle that click event, right? I've been clicked now. I'm gonna do something and after it does that thing it returns data back to the little Child component that in that has that data that it's reading. We're gonna see it in a second. I think it'll make more sense So now we're gonna do all live code because there's really no way to show this stuff off But this is how I feel and Sarah asked me today if I had finished my slides and this was me finishing my slides so Basically at this point, I feel a lot more comfortable just kind of explaining how this is all built and So I'm for sake of simplicity. I'm gonna be using Visual studio code which is a fantastic free editor It is actually from Microsoft So you would think that I wouldn't think it was great, but it's really fantastic and it's it's very fast I personally use PHP storm in my day-to-day usage, but that's because It's an IDE and it knows everything about my code This is really a great quick code editor and it is it's amazing that it's free. I would pay for this code editor Where do I want to start so I'm gonna Just say this is a plugin Okay, so we have a plugin file and the plugin file includes some PHP that we need You can see that it has a file that in that in queues JavaScript and CSS on the page, right? because we need JavaScript to make things happen because It's all JavaScript And you'll actually see in this in queue scripts file. We have a couple separate functions We basically this talk has homework, which means if you want to go home and peruse all the code You should do that. Can we all see this text or would we like to meet a bump it up a little bit? Okay bump it a little bit Okay, yeah those in the back Yeah, no worries. I 225 might be a little too big Is that good or do we want to go up a little more? Okay, I feel like it should be a little bigger Sorry, I'm it sounds like I'm listening to you, but I'm not All right, that's gonna be so good So if we look here, we actually in queue block editor assets Separately from the front end assets, right? You have your block assets and that includes registering the block and includes the logic when you actually have the block moving Then you're gonna go down here. You can see we've got some editor only styles to be honest There's not a lot in there We have Assets here that we're going to be including on the front end and this is the the kind of kicker right here. So The front end assets are in queue in this in queue front end assets and it's really just a javascript file I should say the build process that's powering this Compilation transpiling blah blah blah. It's a webpack file that comes from zack gordon's block example I wanted to keep it in line with his course and his stuff due to due to the workshop, but it's again. It's really great It works I would probably build my own For a library, but it's a very good simple webpack file So we all understand that what in queuing scripts means is that we're putting stuff on the page so that javascript knows to run, right? I hope So from there, I basically I can just show you The first step which is going to be registering a block This is again es6 es7 looking javascript. So I'm using constant and let instead of Var to define my variables Um, we can go into why I would do that later see me afterwards um It's really not it's really not that crazy If you look at this though, you will see that I need a couple things There's a couple things that need to be on the page and really what i'm doing is i'm requiring stuff from Wp's global javascript object, which we may have used in the past You know it has a bunch of backbone stuff. It has a bunch of media player stuff It has a lot of stuff I use wordpress apis as much as I can because it's there not because I love them It's because they're there and it means they're always going to be there. That's the crux of the wordpress decision, right? Am I going to use wordpress? Okay, I'm going to use these things forever so We have constant Being used to declare these things and I just want to say you do need some things these things depend on what kind of Gutenberg block you're building Because this Gutenberg block uses a text control For that meta value you saw that little meta value that we changed in the back end went from 18 to 20 That's a text control So I had to also require that this documentation is actually pretty good and the Gutenberg github repository So i'm not going to explain what all of those functions do So registering a block type is pretty simple The first thing that we need to do is we need to give it some kind of namespace or some kind of identifier This is actually what's written into the code and When I say written into the code it's what I mean is If I show you the back end of this post Here really quick going to go into the editor and If I edit it as html wait, hold on If I oh, that's what that would happen if I converted this back to a classic block, right? You would actually see this As the identifier for that block. I don't know if anybody's done that yet, but when you It actually like pulls those Things kind of together and this is another good example another good example King of examples And Oh, it's not going to show you If I if I if I went into the database the post of the database you would see something that looked like that It would be a comment And it would be like type Wp core And then it would say Text block or something like that. So Gutenberg is actually parsed This is when it gets to be a little absurd Gutenberg is actually parsed by html comments So these comments are These comments are what delineates what the block is and if you deactivate the plugin your content doesn't go away, right? That's the beauty of it At least with static blocks. It's because that content is still there. It's rendered into the it's rendered into the thing But we need some kind of identifier so the parser knows. Oh, this is the reacts block. I need to render this code Um Again the prerequisite for this is that we know it all of what i'm talking about. So sorry again for you know I would say go in explore with Gutenberg. You can see how that all works So i'm going to run through this really quick. We need to give it a title a description You can give it a category which kind of like Categorizes it inside the block adding interface An icon. I used a heart This can come from dashikons. So that's why the wordpress is dashikons has a heart So you can put in a dashikons value for that you can give it a background color if you want There's some keywords. This is if you were to put a Gutenberg plugin like on the repository They can scan this when you register your blocks um The tributes this is a very important Little bit of information, but it tells Gutenberg everything about where your data comes from but all we're gonna Give it right now is the amount of reacts. So attributes and then you give it the value And then you tell Gutenberg What kind of data that value is and that's right here. So if you follow me reacts is a Uh, I could have called it reactions right like reactions is a thing And that thing is an integer and the default is zero and the source is meta And the meta is this meta key. Does that make sense? We're telling the block the meta comes from this meta key Then you have two very important functions. We have an edit function and we have a save function The edit function, um, and this is fancy fad arrow shorthand for like, hey, we're going to pass all the properties we need from The data because Gutenberg automatically gives you data and we're going to pass it into this set of uh Things Man, I really wish that this code was easier to well it is easier for me to read but it's because I know how the Gutenberg container works Again, those Those simple examples and Zach Gordon's repo is really going to help kind of make this all hit home but if we look at the Uh, if we look at the way this works, this is basically an if statement to say that if the Block is selected, right if we've selected the block in the back end And edit is for the back end and and save is for the front end So save it what is what gets put in the front end and edit is what gets put in the back end If so, we need to render these things First thing is if it's selected we need to render an inspector controls box With a panel body and again, this is in the documentation to look how this is built But this is how you build your sidebar interface to edit information And then the text control has three things it has a label It has a value and those reacts again. This is this is looking familiar This is the reacts piece of data and then this is the value of our thing And then an on change handler and that on change handler just says when you change the text box Set attributes, which is a Gutenberg function Send the reacts to set attributes and then it'll set a reacts for you. So it's basically just basically saying When you change the value you're going to save it into the database and Gutenberg handles all of that for you So in the back end, you don't have to do anything you tell it what kind of data you have And it'll do it for you. You can also run a lot of custom functions if for example Gutenberg doesn't provide you with what you need This though Is a very important line and this is what actually renders that uh That the heart like the reacts and that wrapper component Is right here And it's extremely simple. This is what jsx looks like. Please don't be scared It's in it's in a different file because we're importing it in the other file, but it's it's just a div With a class name And then we also give it another component a heart and we give it also a count But do you see how we're passing reacts into this reacts right here? So we're we're this is a dumb component, right? This is a wrapper that That all it does is render some information and we give it that information via The fact that Gutenberg already handles all the data for you. It knows what the value of reacts is Believe it or not internally wp data is running to make all that work, but that's all Gutenberg stuff As in we don't mess with that that's all core Gutenberg that's doing that the save function is very important If you have a static block so for example If we have that text block if you look at like the text block in core the one that we just add paragraph text to the save function for that Runs wp auto p on it like the content function that it would normally run And it just saves that markup right into the Block and that's it and then it's done right We're actually saving nothing into the content because We're doing that on the php side So we're gonna see in a second Is anybody feeling comfortable following me because we have about I don't know 20 minutes and I've covered about an eighth of everything I need to cover It's gonna be fine So jfx might look very scary and confusing, but this is actually very clean and if you read it It's like you might not understand the syntax right now But you do kind of get that I have a heart on the page and a count on the page And you can see where those things come from When you see that at the top of the file it says that those are imported So right now I'm just going to show you these dumb components really quick because I just want you to see how they work The heart is very simple as well. It takes a class. Well, it takes a Argument basically props are basically like arguments like if you think of short codes kind of it takes an argument of active And then we use this class names library to add the class of active if active is true And that's it That's all it does it renders an icon and it has an active class or not Or it doesn't have an active class. Does that kind of make sense? That's when we click the heart It gives it the active class For the counter It's also a super dumb component If I go into my components here You can see that Happening right here, right? We're just we've got a count. We've got a wrap and then we just put the count on the page So there's nothing too crazy But we separate these things because we use them in multiple places You know, I'd be like no julien. We don't use them in multiple places But we do because the cool thing about this block is that the block actually renders data separately via react on the front end And on the back end but differently so the reason why we have dumb components Is so that we can share The same exact markup with the back end and the front end and we're going to see that in just a minute So yeah, because you notice that the heart was like it does something right on the front end But it also appears on the back end. So we don't have to write that markup twice We have a separate components library In our source file and like so our blocks are kind of right here and our components are here and those things are separate We just call them when we need them where we need them Um, so if you had five different ways to show this block off You should you could still show the block off and only write the markup one time Okay So that's kind of confusing, but We've registered the block Now when we save the block it knows what to do Gutenberg handles the saving of the data And it also knows that it's on that post So really quick. I just want to show you the front end data of The the front end php that gets rendered Okay, this is basically just saying like hey Oh, yeah, we have to tell Gutenberg that the the block exists With this register reacts block in the back end and it just says register block type Do you know that does that look familiar? That's our namespace from registering the block in javascript And then this is this is what you do for dynamic blocks. You just give it a render call back So it says, okay when i'm rendered When when the Gutenberg parser hits this block type Render run run this function and this function is really simple This function just spits out some basic php I used output buffering for a lot of stuff because I like the way that it looks but if you have The reacts here you can see We just grab post meta. This looks familiar, right? This is all php. So we're not super scared Get post meta. We're getting the idea. Well, yeah, look at that. There's our meta key And then we spit it out here Why do I even have this because javascript does anybody know it's because some people don't have javascript enabled And sometimes google doesn't have got javascript enabled. There's a lot of things that don't have javascript There's also accessibility things some screen readers can easily disable javascript So this is a backup and if you notice i've called this div the reacts block wrap temp counter And that's because all it all it says and you probably won't even be able to see it These reactors react to so dang fast, but if I view the post Really fast. Do you see that? You see that flash That flash of text is actually react Initiating grabbing the value and popping on the page. That's how fast it is. I mean, we are running in a local environment, but Look at that.  But anyways that other one right there is basically for non You know for for like an seo value or for Somebody who doesn't have javascript all right cool So you're gonna have to just trust me when I click this It goes to an api endpoint feel free to look at the api endpoint the end the api endpoint is so simple The api endpoint grabs the value from the database It pluses one to the value and then it returns the new value. Okay. That's all it does React then grabs that and pops it on the page when I click it Why do I do it server side because if you had 10,000 people clicking this at the same time the most Accurate count is from the server. It's never from the client right because the client would see 23 And it would hit a heart imagine being on a phone With a really bad internet connection in south africa and a hundred people just like the post But it takes you a minute to load that ajax call and come back It would be it would be 24 even if a hundred people have had it right So we asked the server to run that logic So you're just gonna have to trust me that there's an api endpoint When you click it it happens I'm going to show you that by showing you the front end javascript I really think this is all we need because I know we only have a little bit more time Looking at the front end javascript. You can see I have constant create element and render Okay, if you've done any react development, this looks ridiculously familiar. It's because it is Exactly a wrapper for react in that if you actually go to look in the source code for wp element create element Is reacts create element they do import create element create element equals create element That's it But it's a wrapper because if something changes down the road your code doesn't break when react updates their code Right beauty of backwards compatibility So we have a couple other components and this is where you're going to see our smart wrapper and our clicker And I'm going to go through these things in a minute, but Oh, yeah, this is our store registering All right, I'm not going to explain redux really quick. I'm going to explain that at the end if we have time but basically this is our Code and again king of over engineering, but I just want you to see this is how I would properly do it This isn't that crazy. We're getting an element by its id, right? So we're gonna it's like jQuery We're just we're we're getting an element, right? That element's called reacts block and if it helps I will show you the index Right right here this this id So we're grabbing that id Oh, yeah This is how I know the post id. Do you see You see that This is a dynamic block, right? So this dynamic block runs It pops this on the page Right here it grabs the id of the page and now I know the id of the page So I can ask the end point what the count is right? I can ask the end point how many it has Okay, if we have a post id which we should because it should have rendered one we're going to run an api request This is this should look pretty good if we do any javascript This api request also. Thank you very much wordpress Is from wp.api request you might not know that these things exist and you might be including a ton of javascript That you really don't need because wordpress already has an api request tool that is backwards compatible And works with other browsers Don't use fetch or axios or another library you all you have to use is this wp api request That's that's all you need and it's included in the global global wp object Some of this stuff is new so don't feel bad. You're like, oh, I haven't been using this for the last three years It wasn't there three years ago, but it's there now So we're this should look also familiar. We're grabbing posts from the api. We're asking it for the post id, right? Then we're getting the post back We're making sure the post has a meta object. This should look pretty familiar if you know what a response from the wp api looks like This is the meta value Ha ha ha this might look pretty good And then we're using this dispatch thing, which i'm going to explain in a minute, but it basically just says We got some data Now you know about it It's ridiculously explicit and that's why i'm saying this all looks really over engineered because normally with jquery I would just be like, okay, we have it now You know make the number 22 But i'm not because i'm crazy And then we're going to mount this component And I don't know if you're noticing here, but ha ha there's our post id. So we got our post id And we're we're popping it into this clicker So the reason why we have this Is because we want to make sure to tell the clicker the post id to update when it goes and does it So let's look at those components really quick And These are our smart components This is so complicated We have a clicker and we have a smart wrapper. I want to show you a smart wrapper first No, i'm going to explain never mind. I'm going to explain redux to you really quick Okay redux is really simple when I give Somebody a high five Imagine that there's a counter that has to be counting that right? So For example, greg over there. I'm going to call him out if I give greg a high five. There's a couple things that happen I might want to give greg more than one high fives and we might have somebody over here For example brent is counting the amount of high fives, right? So high five high five high five Obviously like all of you guys can tell that the high five happened and if you were paying attention You might be counting how many five five high fives happened, right? But if you weren't paying attention you might not know so you might think that there were two high fives And you might think that there were three high fives happening brent's the high five counter though So brent should know for sure, right? There's three. So the cool thing is redux is this over complicated crazy Like declaratory framework that basically says somebody needs to be keeping track of the high fives Somebody needs to know how to get the high fives back and you need to have a function to grab all of these things And you need to declare them explicitly so The reason why I explained it in that way of high fives is because if you look at me registering my Store Which is this redux register? You're actually going to see that I really don't have very many complicated things happening But we have to declare it. So there's three different things that happen. First of all, there's an action It's the giving of the high five For us, it's two we have two of them. We have activate And we have set reacts and set reacts is just basically like hey tell the component how many reacts we have right? Which we get from the api The reducer is what allows is What makes the change? To tell the store the state That a change has happened. I know that sounds really complicated, but again We have an action If the action type is set reacts We're going to set the reacts to action reacts. Don't worry about all this other stuff. This is es6 spread operator stuff Don't don't worry about it. Just you do need to know this stuff to be building these things with these tools But don't worry about it right now. Just look at the fact that i'm i'm putting an action if the action is set reacts Set the reacts. Okay action reacts get the action From get the reacts from the action Same thing with this activate, but instead of passing data here. We're just switching a bullying. So basically Somebody else keeping track of whether or not anybody has high-fived If I high-five greg we're going to run that Somebody high-fived. I know it sounds totally crazy, but your your application knows exactly where it is at any given time Has anybody high-fived anybody yet? Oh ask the store right The last part of redux is selectors and selectors grab data from this store and I know this sounds like really complicated, but the store literally looks like this Okay, does that make anybody feel a little better? We're basically saying like have we activated anything? No, not by default. Oh, sorry. Some of you might not be able to see this. I apologize Not by default, but haven't has anybody high-fived change it to true That's all the store is doing. Okay Selectors grab things from the store So get reacts is a function. It's called get reacts because what we're doing is getting the amount of reacts And all it does is grab the state reacts. Okay, so get reacts. How many reacts do we have Brent? How many reacts do you have? Well high-fives how many high-fives we have we have three. Okay three awesome amazing Sorry, that wasn't a very good Good job. Thank you for not returning false data.  So we also have an is activated and again, this is how I know if the heart's clickable or not, right? Has it been activated? No, nobody's clicked it. Nobody's clicked it click Activate that's been set. This has been changed now. It's true. Okay. Yeah, it's active So I know it sounds a little crazy, but in massive applications. I promise you I've built a redux application with over 400 keys and when you have access to the exact state of your data Not only do you know where everything is and how everything feels but if you've wired everything up correctly Your store your application never shows the wrong data It's not allowed to show the wrong data And the coolest thing is that if you start building applications with redux, you know Gutenberg's back button All they do is remove the last action They keep a log of the actions that happen and they just remove the last action and so The the application says oh the state changed right our our information changed And we no longer have an extra high five. It removes itself It removing itself triggers the ui to Basically triggers the ui to re-render and it re-renders with the exact data we had So you can actually go back in time and and see how people are using your data if you logged all this stuff It's it's really powerful and very exciting and now that I've explained it. I'm just gonna say All the clicker does It's really not that crazy When you click it on click right handle click First of all don't do anything we're not supposed to we're gonna see if this has been activated If it's been activated don't do anything right. It's our somebody's already clicked it. Don't do anything If not dispatch the activate Which is gonna make it active, right Run an api request This is our custom api We're hitting this increment at a custom api endpoint Right here with the post id. It's just literally grabbing the post meta adding a plus one to that meta returning that back Dispatch Set reacts which we're telling it. Okay. This is how many reacts we have It re-renders Does this kind of make sense what i'm doing here? Yes Awesome, so really that's all this thing does But you can see the magical part of this is that it gets the data via an api request It sets the data via an api request and it knows exactly where it is at any given moment so The crazy example Is not here, but you can see why with this as a foundation for building your advanced scutenberg blocks You have a load of tools available to you from wordpress. I'm I'm using one non-wordpress provided library and that's a very popular library called class names And that's literally a library that adds a class To a box All it does It's good to use because you know you might need to get crazy with it, but Seriously, all this stuff is provided to you from wordpress to build very reactive smart applications and Gutenberg can handle that they can handle those kind of dynamic blocks And you can handle the use case of google not being able to render the javascript So I think that hopefully touches on a lot of Points where you might be afraid of moving something over to a block But if it makes sense for it to go in a block like this might And you might have had to build some crazy custom thing for user interaction and all this stuff Just know if you can write the javascript, which you know might be the next step Which some of you need if you can write the javascript you can build really awesome stuff like this with wordpress provided things um That's all I have for the code So i'm happy to I know that we're kind of getting there. There's a repository link right here I'm just going to go to zack gordon's thing. These slides will be available. I'll tweet them out Um, this is the link that you want. It's pretty short. It's z gordon slash wceu 2018 That workshop is still being edited unfortunately. It is not on wordpress tv, but I spend instead of 10 minutes I got 45 minutes to talk about redux So the high five example is actually from that, but I got way more time So there's way more time. I explained everything in detail line by line. I actually live coded line by line all of these components that said go back you're good go back to that um Go back to that repo and make sure that you use the branch called completed because the master branch is actually what I use To start teaching people. It was blank because we all did it. We all wrote the code together So go to the completed branch Um, that's about it. But if we have some questions, I we have about three minutes Yeah To the next day automatically. So the question is is what would be the west best the west way What would be the best way to reset the high fives or the reacts or whatever back to zero automatically the next day? That's a great question. Um, I would use the infamous wp cron to go and find all the posts that have that Value and reset them all to zero Um, I don't know how you run your cron, but I have a cron job running my cron Which is really common. I think my cron job runs every 15 minutes You could have it run every minute or every three minutes or something like that That's probably how I would run that. Yeah, I use the wordpress things. Greg Yeah Yeah, so the question well the thing that he just said was is it correct that Basically, if my friend from South Africa with a really slow internet connection Hit the button and it said 20 but 100 people clicked it in time. Will they get the new value? Which is 121 right? There's plus the 100 plus the 20 Absolutely, and that's why we use the server to do it because the server is going to respond with a new value We're we're we're giving them that classic Activated like they feel like they hearted it, but the number didn't change If I were to do it the real way I would change the number in the back end for them And then overwrite the number once I got the new Once I got the new value, right?  No that api not not any special Not any special functionality other than like that api request, which actually isn't even part of Gutenberg It's used in different places in wordpress now Um externally doing other calling other apis. I would highly suggest Again king of over engineering Um, I would highly suggest building your own api point to go grab something from an external api process it in php And then ask javascript to take care of it.  Okay. I would say defer to php. Yes It's awesome. Yeah, I think I think that with redux would be a good example I kind of wanted to rip it out for this, but I think it's worth explaining Yeah Yeah, so the question is is can I do all of this stuff with dynamic blocks just with php? Yes, you can I've never done it So I can't tell you the exact ways but so many people asked for that that they were like, okay We need to have this possible It's actually Funny because if you do it the javascript way it runs the php way in the backland anyways Surprise surprise wordpress. I mean wordpress has to be aware But I will say one point on that It sucks because wordpress isn't aware of dynamic block values You can't go to the api and ask Wordpress what a block value is it doesn't know what blocks are on the page until it renders them So we haven't fixed that problem yet and just what I mean by that is there might be a point where you're like Oh, I want to get a data value from a block Store it and post meta if you want to get a data value from a block Because if not, you're going to be parsing the entire content of that page boo Anyways, okay, that's it. That's all I got. Thank you. Oh, yeah one


So finally the runner up game for the subsection, Bacchus and Minaga. Tigers will get on the board first. Maya Hanson gives it a ride to right. That would plate one. They have the early 2-0 lead. But Minaga answered later on. Lindsay Hendrickson base hit and RBI single scores one. They now trailed 2-1. But Pine River Bacchus had the bats going. Emma Mills back to the pitcher. We've got to throw to the plate. But runner gets under the tag. 8-3, Pine River Bacchus wins. They will advance to Brainerd on Tuesday. If you've enjoyed this segment of Lakeland News, please consider making a tax deductible contribution to Lakeland Public Television.


Hello and welcome to the Amherst Weekly Report from Amherst Media. I'm Claire Healy and you're watching the news from this past week in Amherst, Massachusetts. Some teachers and students in the Amherst Pellum Regional School District may be going back to in-person learning this spring. The Amherst School Committee and Amherst Pellum Regional School Committee are moving forward with a plan to allow educators to voluntarily return to school buildings for in-person instruction this February. The committees will allow as many students as possible to return to school within the guidelines of public health officials. In Tuesday's meeting, the committees voted in favor of the motion. Amherst Representative Carrie Spitzer and Pellum Representative Margaret Stanser were the only two who abstained. Superintendent Michael Morris will manage the return and work with the Amherst Pellum Education Association, School Committee, and student families to safely implement the plan. On Wednesday, President Donald Trump was impeached, becoming the first president to be impeached twice in U.S. history. He was impeached for, quote, incitement of insurrection, and 10 Republicans joined with their Democrat colleagues in the House in voting for the movement. Lawmakers voted 232 to 197 to approve the measure, while surrounded by military troops stationed in the Capitol Building to protect Congress and prepare for the inauguration of President-elect Joe Biden on January 20th. All Massachusetts representatives voted to approve the measure. After the violent siege at the U.S. Capitol, many local officials released statements regarding the event. Amherst Town Manager Paul Backelman and Superintendent of Amherst Regional Schools Michael Morris co-wrote a statement posted on Amherst.gov. In their statement, they assured the people of Amherst that they are, quote, being vigilant at the local level to make sure that no one here imitates the violence we saw in our Capitol. In an email sent to UMass Amherst students, Chancellor Subbaswamy described the siege as, quote, shocking and deeply disturbing. He urged the UMass community to come together and support one another, even if they do so virtually. The community safety working group will be holding a second public forum on Saturday, January 16th at 3 p.m. on Zoom, inviting residents to share statements of experiences with the Amherst police and other public safety services. Statements can be submitted anonymously by emailing staff liaison to the working group, Jennifer Moyston, or filling out their online questionnaire available on the town website. Ocean Vuong, an author who works as an assistant professor at UMass Amherst, gained national recognition and awards for his debut novel on Earth We're Briefly Gorgeous. And now we'll be taking yet another step in his impressive career. The book is going to be adapted to film by A24, the same entertainment company that produced Lady Bird, The Disaster Artist, Moonlight, and Vroom. The novel follows the life of a young Vietnamese-American man in Hartford, Connecticut, in the form of a letter from the narrator to his mother. Part poetry, part novel, but all fiction. The book is an intense coming-of-age story that brings you into the life of a young man grappling with family, love, loss, and trauma, and promises to be a gut-wrenchingly powerful film. The town of Amherst established new public newsstand signs in downtown Amherst. Amherst media correspondent Rebecca Duffy reporting. Thanks Claire. Amherst is decked out with new technology that no other town in western Massachusetts has. This is a Sufa sign. It's completely solar-powered and it provides information like the weather and COVID-19 updates. I spoke with Amherst communications manager Brianna Sunrid about why these signs are so important. The Sufa signs project is actually a little bit bigger than the signs. It's three digital displays signs using e-ink technology, as well as three solar-powered charging cores. But a little bit about the signs, the intention for them is to share information updates to the community or visitors or folks who do not have access to either a device or internet. So the signs themselves have an e-ink screen. They have different elements such as transit times, local business offerings, emergency updates, or COVID updates, and also links to our Twitter feed. We did install also three solar-powered charging cores. So any time somebody who needs to charge their device, as long as they have a USB cord, they can connect into these three solar chargers that are placed around downtown Amherst for 24-7 charging. Someone's waiting for a bus or somebody for whatever reason doesn't have another location to charge their device, especially with our public buildings closed. They'll have access to 24-7 charging capability in our downtown area. And this was a CARES Act-funded program because of the nature of the information that we're going to share to the community members or visitors, updated mask mandates and things of that nature. So we were excited to bring this additional tool into our communications. We hope that visitors and community, full-time community members alike will benefit from these signs. I mentioned earlier that the back of the signs has a custom design on it, and right now we've got important public health information and links and phone numbers and QR codes. So we find that if someone's passing through, they'll have quick access to that information to stay up to date. One component of the signs is that we've, working with SUFA, they are going to be trying to prioritize local businesses to share their information and their hours and their changes as part of the signs. So we see some benefits to the local business community, as well as just another touch point for information in our community to get out there above and beyond some of the other existing channels. And one element of the sign that I think has another audience, as well as those using public transit, we're going to try to connect up the PVTA real-time transit schedule so that when people are waiting for a bus at stops that are close to these signs, they'll be able to get up to the minute information. So we're the first community in Western Mass to bring this technology on board, and we've enjoyed working with SUFA, which is a female-owned company that sprung, excuse me, that sprung out of MIT. So we're joining ranks such as Boston and Maldon and much larger communities in the eastern part of the state bringing this technology to their city centers. So we're excited to see how it goes. This is only one of two SUFA signs in downtown Amherst, and a third is expected to be built within the next week. Reporting for Amherst Weekly Report, I'm Rebecca Duffy. Thank you for tuning into the Amherst Weekly Report from Amherst Media. I'm Claire Healy, and we'll see you at the same time next week.


Thank you very much, Dahi. Boris Y Elsin and John Major became quite close friends when John Major was Prime Minister, and on one occasion when Boris Y Elsin was visiting, John Major said to him, Boris, what are things like in Russia in a word? And Boris Y Elsin said, good. So John Major didn't feel he was getting very far and he said, well Boris, what are things like in Russia in two words? And Boris said, not good. And I think there was a large part of British Irish history when you needed two words to describe the relationship, but fortunately now the relations are simply good. This is a quotation. The relationship between our countries has never been stronger or more settled, as complex or as important as it is today. That opening line of the joint statement agreed by the Tysiwch and Prime Minister Cameron at their meeting in Downing Street on the 12th of March describes well, I think, the British Irish relationship today. Over many centuries until as recently as a few years ago, it would have been hard to imagine those four adjectives, apart perhaps from the word complex, being chosen to describe the British Irish relationship. That the Tysiwch and Prime Minister would describe the relationship as never stronger or more settled or as important illustrates how far we have come. At the outset, let me say that I have always been delighted over many years now to participate in and contribute to events at the Institute for International and European Affairs. There's a Rowan Atkinson sketch in which the character he is playing says, they call me one-eyed Jim because there's only one eye in Jim. I remember this institute when it was still the one-eyed IEA, before the word international was added to the word European. But in every sense, other than spelling, the IEA has never had any problem with its eyes or its vision. On the contrary, it has been consistently clear-sided and far-sided in its work and remains so today. I have been invited to speak to you about the British Irish relationship in a changing European Union. Although I'm very pleased to do so, I'm conscious that there are others here today, at least as qualified as me to speak on this theme. Especially your distinguished Director-General, Dahu Yokali, my predecessor but one at the Embassy in London. My Bulgarian colleague in London, in a recent speech referring to the good-neighbri relations between Britain and Bulgaria, pointed out that the warmth of those relations reflect a key element in good-neighbri relations, namely that Bulgaria and Britain are not neighbours. The modern relationship between Britain and Ireland comprehensively disproves that theory. My aim in these remarks will be threefold. First, to look at some of the elements which have contributed to the immense progress in British Irish relations in recent years. Second, to look at some of the key elements in the joint statement which I mentioned. And finally, to offer you some brief reflections on the future. As regards the elements which have contributed to the progress of recent years, I would identify six factors amongst many. First, Britain and Ireland's simultaneous accession to the European Union and our shared membership for nearly 40 years now has been important and positive, not just for our two countries individually, but for the relationship between us. Important politically, psychologically, economically and personally. Politically, our shared membership of the EU has quite literally brought our politicians together month after month over four decades. It has given us deep common interests like never before and a structured context for pursuing those interests, as well as for resolving differences when they arise. Psychologically, the EU has placed us on a more equal footing as nations than at any time in our history. Access for Ireland to significant influence in the world beyond our nearest neighbour has been good for our relationship with our nearest neighbour. That British ministers should attend EU meetings chaired by Irish Presidencies and vice versa has been a matter of everyday reality. The fact that we have coped with EU membership at least as well as Britain in terms of negotiating skills, alliance building and personal impact has also been important psychologically. Economically, the massively positive impact which EU membership has had on our economy has at the same time made us a more important negotiating and trading partner for Britain. The ready willingness of Britain to contribute to the EU IMF package for Ireland and the fact that this was readily supported without controversy across the British political spectrum was testament to the closeness of the economic and indeed political relationship. On a personal level, Irish and British negotiators have come to realise over the years that although, as with every Member State, we agree on some issues and disagree on others, we share fundamentally a way of approaching issues, a way of doing business and all things being equal have an understanding and sympathy for each other's positions. A second factor which contributed significantly to the development of British Irish relations in recent years has of course been the Northern Ireland peace process which, despite its imperfections, has won the deserved admiration of the world. At one level, the success of the peace process removed an irritant in the British Irish relationship, but at a deeper level it brought home to both governments their necessarily shared interest in peace and prosperity across these islands and that only the two governments working together as successive governments in Dublin and London have done could create the necessary context for peace in a divided society which differed essentially in its conflicting British or Irish identities and aspirations. Working together brought home to the two governments as well as to their publics how extraordinarily well in fact they could work together. A third factor which has contributed enormously to the warmth of the British Irish relationship today is the natural warmth between British and Irish people, a fact particularly evident to me as Ambassador in London, as no doubt it is evident to Ambassador Dominic Chilcott newly arrived here and Andrew Staunton, the Charger who's with us this morning. It's hard to imagine two countries which are closer culturally than Britain and Ireland. After I took up my posting in London three years ago I naturally had to undertake extensive language training but once I learned how to make a British understatement while at the same time keeping my tongue in my cheek and maintaining a stiff upper lip I've been able to converse reasonably comfortably with the local inhabitants. The fact is that we Irish and British speak the same language metaphorically as well as linguistically. We laugh at the same jokes and follow the same football teams. There is a buzz when we get together. We're similar enough to understand each other and different enough to make each other interesting. No country is closer to Britain culturally than Ireland and no embassy in London is more warmly embraced than the Irish Embassy. The natural state of relations between British Irish and Irish people is one of friendship and the only mode that that relationship knows today is one of friendship. For a very long time however for many history cast a small or larger shadow over personal relations even in recent decades notwithstanding our shared interest in defeating terrorism and in building peace in Northern Ireland. The change which has taken place in recent years can be illustrated by a simple story. A friend of mine in London told me not long after I arrived that his young daughter had been approached by a British classmate who had said to her, I wish I were Irish, it's cool to be Irish. To say the least that has not always been the case but it is the reality today. I was also struck by the warmth of Prince Charles comments about the Irish community in Britain when he came to the embassy some months before the Queen's visit. Whenever I have been with Irish people he said, I come away with my spirits lifted. The vast and diverse Irish community in Britain has played a major role in the development of British Irish relations. The part they played over decades in even quite literally building Britain is widely recognized and acknowledged including at the very highest levels in Britain. It used to be said in Britain that the Irish built the roads, nursed the sick and taught the children. Today one could with small exaggeration we permit ourselves say that the Irish in Britain designed the clothes, direct the plays, ride the winners, present the television programs and run the financial services industry. It's also appropriate to acknowledge two other things. First, as the Irish community in Britain often emphasizes to me the way in which they have been welcomed into British society by their British neighbours and friends. And second of course the contribution which an increasing number of British people are making to Irish society. It's significant for relations between our countries that Irish people are accepted in a unique way and without question into every part of British society including into its very bastions. I could give you many examples of Irish people including people of Irish descent who are prominent in every single walk of life in Britain from politics to business, from media to entertainment. But let me take just one example, sport. The English rugby team's new star and out half is Owen Farrow. The English cricket team's number five batsman is Owen Morgan. Their best football player is Wayne Rooney. The 2010 BBC sports personality of the year was AP McCoy and he was almost succeeded by Darren Clark. And of course they claim Rory McElroy as their best golfer. To cite another recent example among so many of how integrated the Irish are in Britain and there are examples like this every day. It wasn't even considered worth remarking that all four members of the Manchester University team which won university challenge this year had distinctively Irish names. That Irish people are more accepted as a matter of course in Britain than any other nationality both illustrates the positive attitude towards Ireland and further contributes to it. The fourth important factor I want to mention in the development of relations between our countries is the evolving business-trade relationship. A few simple figures will confirm the depth and breadth of that relationship. A billion euro of trade every week, more than a thousand flights a week and 45,000 Irish people on the boards of British companies more than double the number from any other country and 40% more than from all the BRIC countries combined. The depth of the British-Irish business and trade relationship would merit of course a separate presentation. However let me mention briefly two recent developments. One important development has been the clear recognition at the highest level in Britain that the importance of the British-Irish business relationship is mutual. Since our independence the British market has been and remains self-evidently crucial for Ireland by far our most important market for indigenous Irish exports for example and our largest tourism market. What is relatively recent however has been the high profile recognition in Britain that the Irish market is likewise crucial for Britain by far its largest export market for food for example as well as for fashion to cite some examples. It was David Cameron who first highlighted shortly after taking office what has now become the mantra but no less extraordinary or less true for that that Britain exports more to Ireland than it does to China, India, Russia and Brazil combined. When I took up my post at the embassy in London in 2009 some colleagues expressed concern to me that a side effect of the extraordinary progress in Northern Ireland might be that Ireland would slip down the British agenda that the British government might see increasingly little to talk to us about. The reverse has in fact been the case. The progress in Northern Ireland in relation to which the British and Irish governments of course still remain crucial partners has in fact enabled Britain and Ireland to move towards the close relationship which the logic of our geography and interests implies. This is manifested in the warmth of today's relationship including at the highest political level in the unprecedented frequency of ministerial visits in both directions and in the adoption of the recent joint statement. In the establishment last year of the first British Irish Chamber of Commerce of which I am pleased to be co-patron. When William Hague spoke at the launch of the chamber he joked with some pertinence that he had assumed when he received the invitation to the event that he was being invited to the 50th or 75th anniversary of the establishment of the chamber. The other aspect of the business relationship I want to touch on briefly is that increasingly it goes well beyond bilateral trade. It is increasingly about British and Irish companies working together to obtain business working together all around the world. I host many events at the embassy with Enterprise Ireland bringing together Irish and British companies in different sectors. The discussions between the individual companies are as often about winning contracts in Beijing as they are about exporting goods to Birmingham. The fifth aspect of the recent development in British Irish relations which I would mention is culture. The cultural influence in both directions is immense. In Ireland we watch British TV and increasingly read British newspapers. For better or worse, probably worse, British domestic news is consumed in Ireland as if it were real international news. On the other hand, in the weekly Time Out magazine in London there is scarcely a single page which does not advertise performances involving Irish writers, directors, musicians, actors or comedians. The Irish way of influencing the British media is not by exporting RTE but simply by Irish people taking over the British media. There is no British media outlet which does not employ Irish presenters, producers or journalists in key positions. I noted one very recent example, BAFTA, a very British organisation recently appointed Dara O'Brian as presenter of the annual BAFTA Awards to replace Graham Norton. They really should give the British a shot at it. The sixth and final factor in recent developments which I must mention briefly is the Queen's immensely successful visit to Ireland which had an immense impact in both countries. The visit also proved to the wider world that the two countries which perhaps more than any other two countries in history had been known for their rivalry have become the very closest of friends and that the closeness of our geography has at last become more important than the divisions of our history. In symbolic terms, the Irish flag and the union jack for the first time sit quite comfortably together comfortably together and of course the visit also created the context for last week's handshake. I would now like to turn to the Tisha and Prime Minister Cameron's joint statement at Dining Street on the 12th of March. The statement could be said to symbolise in a sense the fruit of the evolving relationship between Britain and Ireland which I described. Of course the relationship is about much more than such statements but the joint statement captures well I believe the state of the modern relationship as well as its potential for the future. Significantly the joint statement is the first such statement between the two governments which was not focused exclusively or even primarily on Northern Ireland. That in itself is both a noteworthy and welcome development. After some introductory paragraphs the first and longest section of the statement deals with business and trade relations and focuses on the scope for Britain and Ireland to work together to accelerate recovery, growth and job creation. It recognises the wide range of shared interests and opportunities and identifies area for further practical cooperation including research, energy, construction, agri food, professional and financial services and the creative sectors. Importantly the joint statement confirms agreement that a joint evaluation of the depth of economic relations between the UK and Ireland will be prepared. Those relations of course run much deeper than mere trade statistics and the proposed joint evaluation the first of its kind should provide an accurate up-to-date analysis of the complexity of the economic relationship and identify further opportunities for closer cooperation to our mutual benefit. The statement goes on to identify our shared membership of the European Union as an important dimension of the relationship and as well as particular EU issues including the internal market reducing the burden of regulation and financial services on which we have a significantly shared approach. Naturally the statement does not suggest that Ireland and Britain are permanent allies in the EU or members of a single camp. That would misrepresent both the different paths which Ireland and Britain have chosen to follow in Europe as well as the reality of EU negotiations in which alliances and disagreements fluctuate depending on the issue at hand. However Britain is as important an EU partner for us as any and working on that aspect of our relationship including through our respective embassies would be important for the future including for our presidency next year. Another section of the joint statement deals with addressing global challenges the extent to which Ireland and Britain today share an approach to international issues is striking. For much of the last century Britain and Ireland had significantly different perspectives on the world. The statement of the 12th of March emphasises our mutual commitment to effective multilateralism in the UN to tackling climate change and to our strong support for international aid as well as for reform of the international development system. On many such issues Ireland and Britain are increasing the allies and work closely and comfortably together. Of course the joint statement also covers the essential ongoing cooperation of the two governments in relation to Northern Ireland. As the statement puts it the two governments quote continue to work in the closest cooperation on Northern Ireland issues we reaffirm our support for the full implementation of the agreements and for the ongoing work and development of the devolved and other institutions. That continued cooperation between the two governments as co-guaranteurs of the peace process remains crucial and undiminished as the statement simply puts it that cooperation must and will continue. What has changed is that that cooperation as confirmed in the statement is now set as it should be in the context of the wider relationship. Another hallmark of the section of the statement dealing with Northern Ireland is that it looks beyond the achievements of the past, beyond even the aim of ensuring that society in Northern Ireland is never again blighted by violent conflict. Our aim that the Prime Minister say explicitly in the statement is more than that. It is a society and here I quote again that is not only peaceful but stable, prosperous and based on a genuinely shared future for all. In other words there is no question of resting on laurels, there is no suggestion of parking on laurels. The focus is very much on the two governments continuing to work together in support of the Northern Ireland Executive to build a better future. The statement appropriately refers to the decade of centenaries which has commenced this year and the potential of the commemorations to contribute to enhanced mutual respect and understanding. The Queen's visit to Ireland last year and the wreaths she laid with President McElize during her visit in honour both of those who died for Irish freedom and those who died in British uniform is evidence that the decade of centenaries can and will be used constructively. It demonstrated that we are capable on these islands if I may borrow from Wilford Owen of remembering respectfully together whatever mourns in man before whenever mourns in man when many leave these shores whatever shares the eternal reciprocity of tears. But as the statement goes on we also want to ensure that this is a decade not only of remembering but also of looking forward to a decade of renewed and strengthened cooperation between our two countries as the statement puts it. The statement includes several important practical elements designed to contribute to its stated aim of reinforcing the British Irish relationship over the next decade. It provides for regular meetings at permanent secretary, secretary general level more frequent exchanges and secondments of officials and annual summits at Tishock Prime Minister level which of course will not preclude more frequent meetings. It is perhaps worth noting finally the ease and enthusiasm with which the joint statement was negotiated the important symbolism of the fact that it was agreed by the first Tishock for many years to visit London during St Patrick's week and its acknowledgement of what it calls the uniquely close political relationship between Britain and Ireland. I mentioned at the outset that I would offer you in conclusion some brief reflections on the future of the British Irish relationship about which I am both excited and optimistic. I will offer you six thoughts on the future to balance the six elements looking back on the development of the relationship over recent years which I mentioned earlier. First I would suggest that it is essential not to take the relationship between Britain and Ireland however close it now is for granted. That is not to suggest for a moment that there is any risk of falling back into the tensions and recriminations of the past. Rather it is to point out that if we are to reap in Ireland as in Britain the full potential benefits of the relationship it is something we need to work at. We need to avoid any lazy assumption that we are such close neighbours that cooperation across the garden fence is inevitable. That we are such close friends that telepathy can replace conversation. Two-way business is on such a large scale our two cultures so intertwined our peoples are so integrated in each other societies our commitment to peace in northern Ireland so absolute our way of doing business so similar that we must avoid any risk of assuming an inevitability about the relationship and its different dimensions. We must put it another way avoid the myopia of closeness. The current research being undertaken by the IEA on Britain in Europe is a perfect example of not taking for granted the British Irish relationship and I commend you for your work in this area. The study of Irish history and culture in British universities including Professor Roy Foster's leadership at Oxford and the flagship institute for Irish studies at Liverpool University has been another important contributory factor to enhance the understanding between our two countries and indeed of our respective pasts. Such deeper understanding is the result of creativity and commitment and should not be assumed as a given. Minister Rabbit has made it clear that the recent decision of RTE to close its London office is a matter for RTE alone and I would have no further comment on the decision. However our understanding for each other as peoples and as countries is one of the many things we need to work at. Like the Minister I welcome the fact that RTE has made clear that alternative arrangements will be in place to ensure appropriate coverage of Britain. Of course a great deal of what happens in the British Irish relationship will happen anyway. It is not government dictate which makes the Dublin London airline route one of the busiest in Europe. It's not government policy which makes most top jockeys in Britain Irish or the British premiership the principal topic of conversation in Irish pubs. It is very conscious that it is neither desirable nor remotely possible to seek to channel the entire bilateral relationship through our respective embassies. That would be absurd. In most capitals in which Ireland has an embassy it will have some involvement in any local Irish cultural event or business relationship. The depth and the breadth of the relationship with Britain makes that impossible. A diplomat from a similar sized European country in London once explained to me that he has more than half a dozen staff dealing with cultural relations with a vastly deeper cultural relationship with Britain. We have half a member of staff dealing with culture. The essential difference of course is that the other country in question relies almost entirely on its embassy to stimulate cultural exchanges. But while it would be foolish to think that officialdom can define the British Irish relationship in its totality it would equally be folly for the two governments not to use their influence to help to nurture and shape the relationship. That is why for example the large number of ministerial visits between our countries is so much to be welcomed. That brings me to my second reflection on the future. What the two governments can and should continue to identify and bring to the relationship is added value. That's what we work hard at and that's what the joint statement is about. We should remember that a very small percentage increase in trade or tourism with Britain our most important market has a greater impact than a much larger increase in some of the more challenging new markets. That is why Britain is and will remain such a priority for the government and for our state agencies and of course for Irish business. The new British Irish Chamber which I mentioned is another practical example of bringing sensible added value to the business relationship. Similarly while much of the two way cultural exchange between Britain and Ireland will happen of its own accord a small amount of official support can have a significant and disproportionate impact on promoting Irish culture in Britain including this year in the context of the cultural Olympiad. My third reflection concerns the Irish community in Britain which continues to have an enormous positive impact on the British Irish relations as well as on Britain itself and is a vital resource for Ireland. The Irish community is vast and diverse to the extent that some would argue it may be more accurate to speak of Irish communities in the plural. With perhaps more than 6 million people in Britain claiming a degree of Irishness it can seem rare to meet anyone without some Irish family connection. Interestingly it was the Prime Minister Cameron personally who added a reference to family ties to the joint statement. The Irish government continues to attach great importance to the Irish in Britain as regards the more long standing Irish community in Britain the government maintains significant support through the immigrant support programme administered by the embassy for Irish centres and organisations which support the vulnerable and elderly Irish in the major cities. It also supports the Federation of Irish Societies the Irish cultural community and a thriving GAA. Similarly the embassy devotes particular priority to working with Irish business networks in Britain. Networks are the most effective way of accessing the goodwill and potential influence of the tens of thousands of Irish members of the business community. In addition to working with the British based members of the global Irish network the embassy has devoted significant efforts to encouraging the establishment and development of Irish business related networks of which there are now more than 20 in Britain many with more than a thousand members accountants, engineers, lawyers and social services and so on. Just on Thursday evening we did a reception for a relatively new organisation that's only existed for two years the London Irish business society which now has 2,500 members. We have also prioritised the networking of the networks as we call it introducing the networks to each other and encouraging mutual support and across virtualisation of ideas. The fourth thought I would like to offer about future British Irish relations concerns an issue of particular relevance for the EU, namely the European Union a subject which also would merit several seminars in its own right. There is ever more reason for Ireland now to work closely with the UK and Europe from our different perspectives. The genuine warmth of the wider political and economic relationship provides an ideal context for such cooperation moreover the increasing risk of a degree of British isolation in Europe following the European Council in December and in view of British public opinion makes it all the more important for Ireland to have a new involvement and for Britain to work to cement its relationship relations with a partner like Ireland which in several areas shares its interests and which as I said at the outset shares a way of doing business. As Euroscepticism seems to spread further in Britain the advocates for Europe appear less visible and audible perhaps Ireland as a well-regarded friend can in a small way contribute some degree of reassurance to Britain about EU membership. I would emphasise again the obvious point that Ireland and Britain do not constitute a camp of councils, Anglo-Saxon or otherwise. We disagree sometimes strongly on many specific policy issues such as agriculture for example. We tend indeed to have quite different attitudes to the very nature and direction of the European Union. But Ireland has for many years seen France and Germany principally through the prism of EU membership. Increasingly perhaps Britain and Ireland should see each other as partners in the European Union as much as partners in the peace process and partners for business. It would be remiss of me not to mention Scotland even if only briefly. My fifth and penultimate reflection would therefore be that if it takes two to tango our dancing partner across the Irish Sea is trying out some new moves. Britain is neither homogeneous nor monolithic. In looking at relations with Britain we naturally look first and foremost to the other sovereign government in London as well as to Northern Ireland. But we also look to our bilateral relations with Scotland and Wales and to our membership of the British Irish Council, the BIC which brings together twice a year Sometimes in the past the value of the BIC has been its quiet practical work behind closed doors. However at the press conference following the BIC meeting in Dublin earlier this year I was struck by the high press interest and attendance. There was obviously interest in what Alex Salmond would say about Scottish independence and in how Nick Clegg would respond. But the First Minister of Wales, Carwyn Jones also spoke interestingly about the possible implications of the Scottish referendum for Wales and indeed for governance in England and Wales. And Peter Robinson and Martin McGinnis highlighted the Northern Ireland dimension from their different perspectives. British Irish relations are increasingly part of a complex patchwork of relations across these islands. A member of the House of Lords once said during a speech, I don't mind people looking at their watches while I'm speaking but I do object strongly to people shaking their watches to make sure they're working. So before I see too many of you shaking your watches I want to come to my final point. The strength of the modern British Irish relationship is necessarily based on equality. Not equality in size but in sovereignty. Not equality in power but in dignity. The reality and recognition of that equality is reflected in our roles as co-guaranteurs of the peace process, in our shared membership of the European Union, in the mutual respect and perfect balance of the Queen's visit to Ireland and increasingly in the confident relationship between our peoples, it lies at the very heart of the modern British Irish relationship. Thank you.