Talking Drupal #377 - Drupal State

December 6, 2022

Today we are talking about the Drupal State module with Brian Perry.

Listen: 

00:00
 

Watch: 

Topics: 

  • NedCamp
  • Drupal State Module
  • Who is involved
  • Drupal State - a module without a release
  • NPM
  • Decoupled menus
  • What problem does this solve
  • How is this different from GraphQl
  • In production
  • Roadmap
  • Getting involved
  • Which front-end
  • Individual Drupal ecosystems like commerce
  • Evaluating JS Frameworks
  • Stability

Resources: 

Module of the Week: 

Christmas Snow

Adds a Javascript snow effect to your website.

Transcript: 

Nic L  
This is talking Drupal weekly chat about web design and development. With one thing in common. We love Drupal. This is episode 377. The Drupal State project. Welcome to tracking Drupal. Today we're talking about the Drupal state module, with Brian Perry. Brian is a staff engineer at Pantheon working on open source projects in support of pantheon. frontend sites product, and one of the foremost intento experts in the Drupal community. Brian was a former guest host on episode 282 through 285. Brian, welcome back to the show. And thank you for joining us.

Brian P  
Yeah, happy to be back. Very exciting and really glad that you took my Nintendo credits seriously in the interest.

John P  
Is that a newfound credit? Brian, I don't recall that in your previous previous appearances here on the show.

Brian P  
It's I think it's one of the new Acquia certifications, you can be certified as a Drupal Nintendo expert.

John P  
Off to look into that.

Nic L  
Well, I'm Nick Latham, founder and enlighteded development and today my co hosts are as usual John Picozzi Architect at EPAM.

John P  
Hello, everyone. If you're watching the video, I apologize. My video looks a little strange, as I'm squinting, had a mishap with a twig in the eye over the weekend. And it's, I'll be fine. I know. Thank you for your concern. But I just look I look a little funny right now.

Brian P  
Would you say John that you're no longer a fan of twig?

John P  
Well, I don't know. I think I'm probably okay. I have a newfound respect for it after it has named me.

The Internet the Internet jokes are going to be plentiful with this one I sense.

Nic L  
Also joining us less has been customer success manager at Redfin solutions. Welcome back.

Leslie G  
Great. Thanks for having me.

Nic L  
And now to talk about our Module of the week. Let's bring in Martin Anderson-Clutz a Senior Solutions Engineer at Acquia, and maintainer of a number of Drupal modules of his own, Martin, what do you have for this week?

Martin A  
Thanks, Nick. With the holidays fast approaching, I thought it'd be fun for us to talk about the Christmas Snow module, which adds a JavaScript snow effect to your website. It's actually originally created at the end of 2006 and was previously featured as module of the week back in episode number 78, which is almost exactly eight years ago, now has a new 2.0 version that was released earlier this year that supports Drupal eight, nine and 10. And has been, I would say sporadically updated over the years, but definitely encouraging to see that that recent release is currently in use by 84 websites and the maintainer is of the who created the most recent release is Rohit Rajput, apologies if I mispronounce your name, Rohit. He also maintains a jQuery fireworks module. So if you're looking to add some JavaScript pizzazz to your website, there's a couple of options for you. Now, the Christmas Snow module creates a snowfall effect using a JavaScript library. But it also has built into the UI, a variety of parameters you can use to sort of tweak the effect. So you can do things like set a maximum number of snowflakes that should be on the screen, of what the color and size of the snowflake should be. Should the flakes follow the mouse and sort of a few other options. But we will open up to the group has has anyone either use this module recently, or tried to do anything festive on a website they're working on?

Nic L  
I think I installed it when we first covered it eight years ago. I love these little utility fun modules. But I don't think I'd ever actually put it on a client site. Purposefully, although I'd love to find a excuse to get one of these on there. Like for real but No, I've never actually used it on a live site.

John P  
I feel like there's a whole subset here of like, holiday related modules that we could we could spin up right so we have fireworks for the Fourth of July and, and snow for our winter. Winter holidays, right? I don't know I feel like maybe like an Easter egg hunt for Easter, maybe like, you know, the Easter egg module, which that sounds a little ominous to me. Because while we all I'm sure Brian knows about Easter eggs, right, playing a lot of video games, plenty of those plenty of those around.

Brian P  
I was gonna say I'm an over user of the JavaScript confetti package, which is definitely in the same neighborhood. There should probably be

John P  
a dress version of that and There isn't like you have a birthday party. You hit it with some confetti. Wow. All right.

Martin A  
I was just going to quickly add that there is also a pirate module for a national Talk Like a Pirate Day. So no,

John P  
I have seen that one.

Leslie G  
Yeah, I have as well. Yeah.

John P  
Is is useful.

Martin A  
Yeah. Actually, there is one other snowfall effect module for Drupal. That's actually entirely CSS. So Oh, really? Actually options there for you.

Nic L  
What's that one off the check that one out? That's pretty cool.

Martin A  
I don't have it off the top of my head, but I can make sure it gets into the show notes.

John P  
Curie curious. Are there any Halloween related modules

Martin A  
out there? Great question.

John P  
I feel like that's, I feel like that's a bit missing. Vertical right there.

Martin A  
John, that's another module you can help us out

John P  
with, there you go. Or the pumpkin spice module. I feel like that should be like everything has a pumpkin spice version like pumpkin spice. Drupal is something we need to see how

Nic L  
does this pumpkin spice turn on only when Starbucks has pumpkin spice on the menu or something?

John P  
Like it's pretty much like, you know, it's pretty much like October through November sort of thing I guess.

Martin A  
Or maybe you could like geo locate the nearest place you can get something that's pumpkin space.

John P  
The possibilities are endless.

Brian P  
That'd be a problem for your job though. It would be geo locating so many Dunkin Donuts.

John P  
I have actually have a Starbucks right down the road. So I also have the Dunkin Donuts is closer, though I will say.

Nic L  
I mean, that's true in New England all the time. Well, thank you, Martin. Appreciate your you're bringing a little festive mood to Module week, this week. And we'll see you next week. Okay, moving on to our updates in news. We have a few things today try to get through these. So the first thing is a non Drupal thing. Dwarf Fortress, which is a game that I have been playing for many, many years, I think at first started in 2010 ish. Just had it released on Steam, so it's a little bit more accessible. If you like simulation games, it is the ultimate simulation, it kind of made the map of all those types of games. So check it out. It's a lot of fun. Little bit involved. It simulates the, it's the deepest simulation game. On the internet. I also want to give a shout out to one of our listeners. James Shields has made a Drupal Advent calendar. So I think we're in day six right now. He's going through his day talking about a different project. He's featured calendar views talking to itself. So check that out. It's in the talking to channel and the Drupal slack. It's been it's pretty well thought out. Well, nice little diversion. It's kind of like every day until Christmas is gonna mention a project. And just really briefly, since this is coming out next Monday, Drupal 10 is expected this week. So we're pretty excited. Looking forward to that. And if you guys are I've I've started looking at the upgrade status module for a couple of sites. See what kind of work I need to do to get them ready for Drupal? 10. Oh,

John P  
that's a good idea. Yeah, you just gave me a good idea. I'm gonna go do that on my personal website to see if I'm ready to upgrade to Drupal. 10.

Nic L  
Okay, so before we jump into a primary topic, Brian, we saw you a couple of weeks ago at ned camp for first back in person camp and a few years. It's nice to see you there. I'd love to hear your thoughts. Would you think Ned camp?

Brian P  
Yeah, it was it was great. It was definitely really great to be back in person. Since I'm from the area, it's always really wonderful to be back, quote, unquote, local. And there was a lot of content content that was squarely in my wheelhouse. This time around there was kind of like a an unofficial web components or component track on Saturday that was all in the same room throughout the day. So I just kind of kind of camped out and saw a bunch of bunch of great talks and gave one to I don't know if mine was great, but I gave one.

John P  
Clearly, you've been watching the show over the last couple of months. And you've just given Nic an end to talk about web components.

Leslie G  
That's funny reference. Redfin solutions, had a lunch last week a lunch and learn last week, and we were talking about ned camp last week. And the thing that came up with so many talks on web components and the interest in learning more about that. So you definitely piqued the interest of you know, a lot of the attendees of ned camp Brian, so thank you and everybody else who also gave talks in that area, in all talks in general. That's awesome.

John P  
All right. Let's jump into our primary topic. And Brian says something you you know a bunch about, so I'm looking forward to learning learning more throughout the show. Can you tell us and this is like kind of a broad topic right here? We'll get into more detail. But what is the Drupal state module?

Brian P  
Yeah, it's a general project on drupal.org. That is a node package that's published to NPM. And it's a simple data store to help you manage application state that source from Drupal JSON API endpoints. So it has a number of utilities that you can use to easily get things from JSON API. And then additionally, when like, for example, if you're getting all of your articles, it also caches that locally by default. So if you make a separate request, and you needed a specific article, it wouldn't have to go make a request out to JSON API, it would just get that from the local store. So you know, a lightweight package that makes it easier to kind of manage that data from JSON API.

Leslie G  
Who was involved in the Drupal state module besides yourself, Brian?

Brian P  
Yeah, me. Also, one of my co workers at pantheon. Coby cheer is one of the maintainers. And then actually, one of your co workers, Leslie J. Huskins, has recently come on as a maintainer, he, early on, was using it and had some suggestions and gave us some nice fixes and has really helped out with the project a lot. So we had him come on as a maintainer.

Leslie G  
Excellent. Thanks for doing that he had this, that'll be, I believe, his first module that he's helping to maintain. He's very excited about that. So thanks for encouraging him and helping them along.

Unknown Speaker  
Yep. Yeah, then we're also using this package in part of Pantheons, front end starter kits that we're offering in the pantheon dashboard. So there's also been, you know, a number of things that have come out of that as far as contributions and interesting applications of the package.

Nic L  
So can you tell us a little bit more about that? Because when I look at the page, there's no release? You know, there's a lot of information, there's actually more information than modules have on kind of the module page. What is it? I mean, talking Drupal has a pack has a project, quote, unquote, on that org, and that we use that really just to provide credit to guest guest hosts and hosts and other people that help her on the project. Is that kind of what this is on drupal.org? Or is it? Is it something else?

Unknown Speaker  
Yeah, that's a great question. And yeah, something that we should probably look at some more. But you know, the fact that doesn't have releases, but and this kind of goes back to some of the efforts around the decoupled menus initiative, which I think there was a previous episode of talking Drupal that I made, I believe I was on about that. But as an outshoot of the the decoupled menus initiative, one thing that came out of that is all of the projects on drupal.org, kind of had the assumption that they were PHP projects in some way. Yeah. So whether it's to support things in the kind of Drupal JavaScript ecosystem, or even things that are actually JavaScript packages used by Drupal core, there's the idea of this of a general project. So a project that doesn't necessarily have to be php. So this is a general project. And then you know, how it relates to Drupal and drupal.org vs NPM. The code is actually hosted on Drupal GitLab. So the source code is in you know, Drupal's projects instance, the issue queue is managed out of that general project as well, which allows us to credit people to make contributions under Drupal. But the the actual project itself is offered via NPM. Because it's a node package. It makes it a lot easier to distribute. We, you know, we want visibility on on NPM. So, yeah, that's why there is no release because it Yeah, we certainly could tag releases. But I think that actually might make things confusing if you had releases tagged on drupal.org versus NPM.

Nic L  
So, so we've hit our first rabbit hole. And I kind of thought we'd go down here. I have a couple of questions related to that, then. So have you been working with I know this is something that's been mentioned before, but have you been working with the Drupal association in the maintainers? Kind of to figure out how to maintain an NPM project in Drupal? Was this their recommendation or is this really kind of just ad hoc to try to get it? give visibility to drupal.org forward?

Brian P  
Yeah, so for for Drupal state itself. You know, it was an opportunity to try out that concept of a general project and understand how that would work within Google's project ecosystem. The the actual, like, creation of the general projects, was the team involved with a couple of menus a little bit before I got involved. But, you know, I think we're we are, we're still figuring out the right way that the that things related to Drupal can be distributed on NPM. And out of the couple of menus initiative, they're actually technically two packages that were developed. The main one being something called decoupled menus parser, which helps parse the output from the new menus endpoint that's going to be in 10. One. And that's something that we actually want to offer under the Drupal namespace on NPM. Currently, today, there's only two packages under the Drupal namespace on NPM. One is a replacement for jQuery once, and another isn't accessible autocomplete, they're both things used by core. So yeah, this particular question, you know, how can we take these two new packages? Offer them under the Drupal namespace? And that's what we're figuring out. So I've been working with a few of the JavaScript maintainers. And, you know, we got some CI in place. You know, they had some feedback on the actual code. And we're discussing things like, you know, what, what is the process if there is a release for this in the future? And things like that, but yeah, I think that some of the answers there are still being decided. But I think it's really important that we have more things under the Drupal namespace on NPM, because I think JavaScript developers look for it. So, you know, defining that process is important.

John P  
So I have a couple of questions, not to go further down a rabbit hole. But I just want to try to be a little bit clearer about Drupal state and like when you would would use this right. So obviously, it's being used if you're using JavaScript for your front end. So fair to say that you would only use it on a headless or decoupled solution.

Brian P  
So the you know, the package is a utility to get data from dribbles, JSON API endpoints. So any case where you're talking to JSON API, it could make sense. Typically, that's a couple of projects. But it's something that can run both on the server and the client side. So if there was some sort of situation where your Drupal site needed to talk to JSON API on the on the client side, you still could use this. It's definitely not, you know, something I consider to be the primary use case. But it's possible.

John P  
Got it. So So this essentially runs and we talked about how, you know, it comes from NPM. Right, and we're going to talk a little bit. I have a question about that specifically in a minute. But so it's basically living with your your JavaScript, your JavaScript application, if you will, right. Is that? Is that a fair way to put that?

Brian P  
Yeah, yeah, it is JavaScript, you certainly could import it as a node dependency and bundle it with your application. There's also been a lot of improvements in like JavaScript in general, that make it easier to import JavaScript modules. So you could also just import this from a CDN, rather than bundling this.

John P  
Got it? That makes that makes a ton of sense. So going to you know, this doesn't follow the normal Drupal module, kind of like output procedures, right? Which we're all pretty familiar with. It's kind of it's kind of new and Uncharted Techmo. I mean, I guess not Uncharted, but it's new territory for the Drupal, folks. Right. I'm wondering if you saw or had to do anything special to get this NPM package kind of builds and then to be able to be be able to release it on NPM? Or through NPM?

Brian P  
Yeah, for getting it built. I mean, the kind of underlying Bundler that that we're using is something called VT, which is a project that came out of view, but is definitely becoming more popular in the JavaScript ecosystem. So that handles all the bundling. And, you know, we've kind of follow their recommendations for general package Project Setup. As far as publishing under an NPM. It's relatively manual at this point. It's not handled by CI. There's a few like supporting scripts that we have For for something like the packages for the the decoupled menus initiative. That's something that you know, we do want to have that fully automated in in CI and you know, when there's a tagged release, automatically publishing to NPM. But that's where that kind of gets into how to navigate that, you know, because that obviously requires secrets and some additional permissions in GitLab. You know, so how do we coordinate that with the Drupal infrastructure team?

Nic L  
So yeah, because we have that right now for composer, right? When you create a tag release on a Drupal module, it's gonna release it on the Drupal Packagist. And push that out. So as the plan is part of this project, working that out, so you have the same so we can number one have kind of native node or JavaScript packages on drupal.org? And have that released? Like, are they planning to release like a drupal.npm.org? Or something? I assume that there's private NPM repositories, just like there's private packages? Is that what the community and the infrastructure team is working towards? Or are you really just like at the drawing board? So trying to figure out what what the plan is?

Brian P  
Yeah, I would say kind of at the drawing board. To be honest, I do think that those kind of automated tagged releases are important for things that are under the Drupal namespace. And then I think there's a lot of room for improvement for general JavaScript packages. Like there could be some sort of automated system that could automatically publish or automatically tag releases that show up on your drupal.org page, or, or maybe it actually just pulls off that from NPM, you know, to show what the tag releases are. I don't think we have a lot of the answers there. And the other thing that I would be hesitant to do is, you know, I don't want to necessarily build a Drupal specific JavaScript solution when maybe our, you know, JavaScript community is like, it's not a big deal to publish this package on NPM. So we actually want to validate that.

Leslie G  
All right, great. You mentioned that this is part this is an offshoot of the decoupled menu initiative. Does it also, you know, inter integrate with the web components? And if so, how does that? How does that work?

Brian P  
Yeah, this the, it's in kind of a pretty indirect way, an offshoot of the decoupled menus initiative. But So I mentioned that there was an episode on the decoupled menus initiative of talking Drupal, that I was I believed the guest host on. And that actually resulted in me following up with the folks that were on the show, Baddie and others, and Theodore and becoming more involved with the initiative. I eventually came on as an initiative coordinator, but out of the show, yeah, he was just like, you know, how can I help? How can I keep doing this, and I was interested in web components. So when we did a hackathon around Drupal con, we wanted to have people in the Drupal community create front end components that source data from this new menus endpoints. And I have worked with a few folks to create a menu web component. And that was kind of the first step into creating that generic Drupal Web Components project, which is a set of you know, Drupal friendly web components. And then when we created the initial menu component, it actually like, the component itself talks to Drupal, JSON API handles, managing all the data and everything. And as we looked at doing that with other components, we couldn't really take the same approach, we needed some sort of default, or shared way to talk the JSON API and share data across a variety of different components. And something like that didn't really exist at that time. So that is what led me to starting work on the Drupal state projects. So pretty. You could say it was all because of talking Drupal.

Nic L  
We will take credit for that. Absolutely. So so that makes me wonder, like is is the plan for Drupal state itself to become part of core at some point, or do you think it's going to just stay in contributing in JavaScript land as kind of like the glue to bind these pieces together?

Brian P  
Yeah, I as of right now, I think it would stay in contrib. But kind of getting into some of my dreams for 2023. And I think we are finally starting see a little community momentum here. As the couple of menus initiatives is finally wrapping up but there are now more clients in addition to Drupal state that do similar things. There were a few other projects around the time that the Triple C was created. The next for Drupal projects has since also made their own client available. You know, it depends on React and things like that. But there's now a lot of relatively mature mature projects that do the very similar things. So what I'm hoping can happen is that we come together and figure out what are the the, you know, features and utility is in common across all of these projects, and start to take those things and abstract them out into a project and a package that is somehow an official Drupal package.

Nic L  
So So can you give some specific examples of what problems to solve? Because it sounds like in general, you can just communicate with JSON API, right? And do some similar stuff. So what what piece, specifically does Drupal state do if I'm looking to build a front end? On top of Drupal?

Brian P  
Yeah, and yeah, there's, you know, there's, you could certainly roll your own for this. And there's a lot of a couple projects that do this. But, you know, even if you think about just getting, you know, think of the Maumee demo data, just getting all of your recipes from JSON API, you have to either know the menu endpoint or at the root of sorry, not the menu endpoint, the recipes endpoints. But at the root of JSON API essentially has an index of all of the different resources that you can access. So if you don't know that endpoint, you have to make a request to the root, figure out what the endpoint is, then use JavaScript fetch or you know, your preferred utility to talk to JSON API, get the response, maybe handle some lightweight error handling. And then, you know, make that data available to your application. So it's not the most complicated stuff in the world, but it's also not necessarily things that we need to do over and over. And then if you think beyond just that really simple use case, stuff like authentication, and, you know, actually saving some sort of cache of that response. So, you know, I already got all my recipes, and I want my recipe for, you know, putting, I already have that, how do I check to see that I already have that data in my application and return that instead? How do I invalidate that cache. And then, you know, also common modules within the Drupal ecosystem, we can support things like decoupled router, there are utilities for that. So one is, you know, this is just a utility, a client that has a nice developer experience that you can work with without having to lay that groundwork. But then also, within that we've taken care to export and make all of those underlying utilities available. So if somebody didn't want to use the entire Drupal state library, or you know, want to use a different solution for managing application state, they could use the individual pieces here to depend on rather than having to build them themselves.

Nic L  
Okay. And, and is it like provide speaking again, about the recipes, you said, you know, in the JSON API, if it goes that route? Does it just provide a new endpoint in Drupal state for getting entities or something? Or how is that abstracted? Or does it let you define, you know, nice, quote, unquote, pretty routes or something for that?

Brian P  
Yeah, so you know, at the risk of mouth programming here, like, how that works is, so you create an instance of the store, that's essentially an instance of Drupal state. And then there's a get object method, for example, that lets you get any object from JSON API. So you could say, Get object, node dash dash recipes. And what what Drupal state does behind the scenes as it goes, alright, I need no recipes, I'm going to check the index of JSON API. And it will also cache that locally so that that request only needs to be made once. And then it's going to say I see that the recipes, no recipes endpoint is this URL. I'm going to make a request to that URL, authenticate if I'm supposed to, I'm going to get all the results back, and then it will in that same data store. It will store you know, key data for all of the recipes as well. Got it.

John P  
So this might be a dumb, dumb question, and I apologize if it is. But in listening, especially in the example you just gave. I'm wondering how this is different from something like Graph QL. Right. So like, as I, as I understand it, in probably the most simplest terms, Graph QL, right, it gives you the ability to kind of like simplify your your API and make it more more accessible to folks. Right? It kind of sounds like that's what Drupal state is doing. For for Drupal, folks, right. And that that was very clear to me in the great example you just gave where I'm like, Okay, I've written this, quote, unquote, command, and now it's going to get recipes from from the database based on JSON endpoints.

Brian P  
Yeah, I think that's fair, it's, you know, it's certainly not on the scale of of Graph QL, and the, you know, amount of control and the shape of the query that you get from Graph QL. But, yeah, it really is trying to improve the developer experience talking to JSON API. And, you know, specifically from the perspective of people who might not be familiar with JSON API spec, or Drupal is implementation of it. So it also by default, the response that it gets back is deserialized, and flatten. So there's a lot less you have to do to dig into Drupal specifics or referenced entities or triples kind of attributes object. The data is primarily just more on the top level there.

John P  
Now, that's a that's an interesting point. So like, if I had, you know, going back to the recipe example, right? If I had like an ingredient entity reference, right, would Drupal state then pull the entity reference information as well. So like, Hey, give me a list of recipes. Okay, here's a list of recipes. And then here's the, you know, the sugar ingredient, and you know, its name and kind of the information that is associated with that node.

Brian P  
Yeah, there's a way to pass parameters. So any parameters that you can use with JSON API can be used. And we actually, the library uses another package that is also commonly used in the Drupal decoupled ecosystem, which is Drupal JSON API parameters, I believe. And that just provides an API interface to be able to create, you know, include parameters, sorting parameters, all the things that JSON API lets you do. So just make that a little bit easier. And talking about also Graph QL. And like, trying to make this stuff easier for developers, we have been working on this project, we were trying to find, you know, how far do we go and trying to make this easy and even like Graph QL? Like, we did have an experimental feature that we've since deprecated, but they're actually what is a package, an NPM package that allows you to write lightweight Graph QL queries against JSON API. And with that, we were able to do some things like automatically add, you know, the necessary include parameters and things like that. And it it was, it was nice, but I think there was just kind of a little too much magic. And it resulted in us having to kind of worry about two different career paths, which is why we deprecated it but

Nic L  
are you using this on any lab sites right now? Or is this kind of theory craft still?

Brian P  
Yep. It's definitely being used on on live sites. I think part of the reason that Jay at Redfin became more involved this is because I believe they're using it on at least one client project. It's part of the starter kits that Pantheon is offering in their dashboard for the front end sites product. So if you spin up next Jas starter kits, with Drupal, it uses this. So yeah, there's definitely production use out in the wild, you know, certainly more, more to come. And you know, more for this, this package to grow, but

Leslie G  
great. So, Brian, you've talked a real lot. There's a lot that you've you and the other maintainers have done on this. On this. Projects. There's a lot that you have talked about today, in terms of I'm overwhelmed with all the things you talked about. It could do and it might do. So what's on the roadmap for the immediate future for for the project?

Brian P  
Yeah, there's, there's some things that, you know, we've had issues for that we haven't been able to get to, you know, a common one is, right now, the utilities that we offer a read only, so being able to also have similar helpers for all of the other update, delete, you know, create operations that JSON API can do. There's some enhancements related to our locale handling that we'd like to do improvements to like our TypeScript types. But, you know, as I kind of alluded to before, the thing that I would really love to see, you know, those involved with this project and other similar projects to focus on in 2023? is trying to figure out what are all the common elements among these clients? And how can we, you know, essentially contribute that to Drupal in an official capacity. And I'd love a world where Yeah, Drupal state continues in contrib, but uses those utilities for things like, you know, fetching from JSON API and, you know, whatever we decide is like things that should be abstracted. And even if there was a situation where that that gains enough momentum that like, it makes more sense for us to have like an official Drupal JSON API client, I'd certainly be fine with that, too.

John P  
It's, it's interesting a couple a couple of times as you've been talking about this, and just as you were talking about the that that goal for 2023, or that wish for 2023, maybe, you know, it becomes clear to me that this is this is very much a utility or helper helper thing, right? And I'm wondering, like, is this something that could someday maybe not be in Drupal core, but maybe be included with something like Drush? Like, is that? Is that something that that could happen? Or is it just not possible because of kind of the makeup of Drush? And where Drush is typically used?

Brian P  
Yeah, I see this more as something that would be under the the at Drupal namespace on NPM, which I kind of and, you know, as we talked about, I think we're figuring out all the parameters around this, but like, I think of that as kind of like Drupal core for JavaScript at this point. As far as like, you know, things that are not actually shipped with Drupal, core, Drupal, you know, official Drupal, JavaScript projects and dependencies. And I also think that it's important that Drupal has more of a presence on NPM. Because right now, we only have two packages. I think the the more official Drupal utilities we offer, I think it'll be I think it's what JavaScript developers expect. But also, you know, hopefully makes it clear that we, you know, have a JavaScript ecosystem and are serious about this decoupled Drupal use case.

John P  
Yeah, interesting, because that's the other thing I'm hearing that, you know, you're saying that like, hey, this does not, you know, this isn't in Drupal core, right. It's its own module and whatnot, which which makes sense for the time being, but I, I also see it being something that could be very useful in Drupal core, or as you just said, in like a, you know, base, Drupal, JS framework of sorts, right? Kind of that like starting starting place for folks who are looking to build a jazz front end for their Drupal site.

Brian P  
Yep. Yeah. And something that I think Drees mentioned in the the Drupal con Europe, keynote this year was, you know, thinking past Drupal 10, and where we might be able to move forward and accelerate, like the idea of there being some sort of official, Drupal decoupled reference implementation. And, yes, something like this, I think, you know, ideally would serve that really nicely.

John P  
Interesting. So if somebody is listening and wants to get involved, because, you know, talking Drupal clearly makes makes these things happen as as you've highlighted, how would somebody together? Exactly, that's the that's the main goal. How would somebody get involved? Where Where should they start? Basically, if they want to be involved?

Brian P  
Yeah, there are a couple of different places. There's a couple of channels in Drupal slack, there actually is a Drupal state channel in Drupal slack. There also is the couple of menus initiative channel that I would expect to be winding down, but there still are ongoing discussions about kind of what's next out of that initiative. And that's where there's been some discussion about the the, like official Drupal utilities or official Drupal client has been going on. And then also the issue queue for the project on on drupal.org. So Drupal underscore states. You know, feel free to submit issues there and try it out.

Leslie G  
I have a question for you about the front end. So my understanding is that Redfin is using it on a production site that's using spelt. And that's how J got into, you know, looking into the Drupal state project and getting involved with it. So yes, we know it works with spelt. Does it works better for a specific front end react or view or something or is it agnostic in terms of the JavaScript framework used?

Brian P  
Yeah, it is intentionally agnostic. And that's definitely been my focus with a lot of the These projects use definitely a lot of momentum around react and a lot of great things in the React ecosystem. But I think it's important for Drupal and Drupal JavaScript ecosystem to be able to serve all of the different frameworks. So Drupal state is just vanilla JavaScript at the end of the day, so you can use it with React Svel View, whatever thing is cool in five years?

Nic L  
And six months, you mean? Yeah.

Brian P  
Actually, the new framework dropped just now.

Nic L  
So the other thing that I always think about with these types of kind of glue modules or glue utilities rather, is, you know, contrib and contribute ecosystems. For example, if I'm thinking specifically about commerce, right, the commerce system is really in depth really broad. Do you have to do something specific on the Drupal state end in order to integrate with that? Or is it kind of like as long as the module integrates with JSON API? Drupal state will work?

Brian P  
Yeah, it's basically, as long as it works in a traditional way with JSON API, Drupal, Drupal state will work. The one potential hiccup I've seen there is, it's easier for Drupal state to pick up on this stuff if it's part of that main route API index. And so some, some modules don't implement that. There is a module called JSON API hypermedia, I believe, which will register a JSON API endpoint under that route index. But basically, if your JSON API endpoint, even if it's a custom endpoint, is part of that index, it's it's off to the races. Oh, yeah, I can see, I can see a situation where we have like, you know, we could have additional helper utilities for, you know, specific use cases. But at the end of the day, yeah, generically, this is like, an easy way to talk to JSON API, whatever JSON API spits out.

Nic L  
Yeah. And I wonder if part of this project becomes like documentation, like, kind of, maybe a side initiative of it aside initiative of the side initiative, is documenting. Like, if you implement JSON API this way, it will work if you do it this way, like the common pitfall type thing, like don't do this, when you're doing it. Do this, and then we'll work with it automatically. Because I can see Yep, you know, if you make the integration as low effort for module developers, that just makes their stuff available for you, which makes it available for the couple of sites automatically. Yeah, that makes sense. It can be.

Brian P  
I was gonna say we do have docs for the project that are hosted on GitLab Pages. So there is some stuff like that up there. But yeah, definitely ways we could expand it.

John P  
So I have a little bit of a broader question about Jas frameworks. Lesley mentioned Smeltz. I personally am working on a project that's using React, I believe next. Web Components are mostly in react if I'm not speaking, they're

Nic L  
speaking their native. They're just native JavaScript web components. Oh, okay.

John P  
Yeah, they're not using a framework. So he's not using a framework. But if he did have to use a framework, Brian Perry, how would you evaluate a J. S framework? And, you know, what are some tips or tricks you can provide to our audience to help in their JavaScript framework evaluations?

Brian P  
Yeah, that is potentially a topic that could serve its own entire podcast. But yeah, some some things that come to mind. With a lot of the the newer frameworks, there's kind of an emerging focus on like, either hybrid, or kind of server first approaches to the JavaScript frameworks. So I think understanding your needs as far as what needs to be dynamic, what needs to be server rendered, or what can be cached and static, having a good understanding of that can help you evaluate the frameworks. So if it's something that could be a static deployment, there's one set of frameworks that you might want to look at. If you are on the complete other side where you need to serve a render everything. You know, there's another set of frameworks that would serve your needs there. Then looking at the ecosystem in general for a framework, and you know what other tools exist out there are their existing agreed upon solutions for the things I want to do. And there's the kind of Drupal sub aspect of that, like, are there things in the Drupal ecosystem that support that react and also next Js really does seem to be gaining large momentum and market share there. And there definitely is a lot in the the next Js Drupal ecosystem. There's the next Js for Drupal projects from chapter three, which is really successful and well maintained. And then also understanding that you know, the needs of your team or the skill set of your team. So you know, if you have a bunch of spelt developers, react probably isn't the right rate solution. So if there is an existing skill set there that can help with the decision. And then another thing, you know, this is probably colored a little bit by some of the work that I do at pantheon. But you are, do you have any specific hosting needs? Or if you're evaluating these frameworks, generally, are any of the features that they're talking about things that are specific to one certain hosting provider? For example, one example that comes to mind is, you know, some of the thing the features that Gatsby offers, are, you know, make some assumptions about Gatsby cloud. But there's certainly a lot of things that Gatsby offers. It's fully open source to.

John P  
Okay. One of the interesting things I think you Well, you said a lot of interesting things there. But I think one of the things that somebody may not necessarily think about when selecting a framework is the support within the Drupal community, obviously, the project I'm working on is actually using next Jas. So like there's pretty good support, actually excellent support for that. But like new JS framework, to be named later, right comes out, and there isn't a ton of Drupal support, like you may be kind of like forging your own path there, which, which is definitely, in my opinion, a big a big decision that you need to make.

Nic L  
Yep. So I've got one one final question before we close out the show. And we've kind of hinted at this throughout the show, but I forgot to make the question explicit. What kind of what's the kind of stability of the Drupal state project? Is it like fully stable? No major changes, just new features moving forward? Or is it still, you know, somewhat in flux here, still trying to work out some kinks and figured out exactly how best to serve the Drupal community? It sounds I mean, from what I understand sounds stable, but like, kind of like that confirmation?

Brian P  
Yeah, we do treat the project. We consider the project stable and follow semantic versioning. Okay, from that perspective, so we have had situations where we did consider it important to make a breaking change. But in that case, we communicate that and also have a major version release as a result of that.

Nic L  
Well, Brian, it's been great having you back on the show. Thank you for joining us.

Brian P  
Happy to be here. Yes, this this was fun.

John P  
Give questions or feedback. Reach out to talk in Drupal on Twitter with the handle @talkingDrupal or by email at show with show@talkingdrupal.com You can connect with our hosts and our listeners on Drupal slack in the talkingDrupal channel.

Nic L  
You can promote your Drupal community event on talking Drupal. Learn more about this at talkingdrupal.com/tdpromo.

John P  
get to talking dribble newsletter for show news, upcoming Drupal camps, local meetups and much more. Sign up for the newsletter at talking drupal.com/newsletter

Nic L  
And thank YOU patrons for supporting talking Drupal, your support is greatly appreciated. You can learn more about becoming a patron at talking to people.com and choose become a patron. So Brian, if our listeners want to get in touch with you had any questions or want to get involved in Drupal state would be the best way to do that.

Brian P  
Yeah, man, I'm on Twitter @bricomedy. Who knows what, what state Twitter will be in by the time this episode releases, but that's one place and Brian Perry on drupal.org. And among the various Drupal slacks as well.

Nic L  
And Leslie if our listeners want to get in touch with you. Sure. So

Leslie G  
I'm leslieg@drupal.org. And I'm also @ LeslieGlynn on Twitter.

Nic L  
And, John, how about you?

John P  
You can find me on all the major social networks and drupal.org @johnpicozzi and you can find out about epam@epa.com

Nic L  
and you can find me online @nicxvan

John P  
if you've enjoyed listening, we've enjoyed talking. Thanks, everyone.

Nic L  
See you guys next week.

Transcribed by https://otter.ai