Recently, I joined an event on Drupal in Hungary — the Drupalaton. It is one of the most exciting yearly Drupal events in Europe, organized by the local community. It gathers hundreds of contributors who collaborate on Drupal issues, share knowledge and have fun together :)
I really enjoyed this year’s event since it covered a lot of my favorite topics. (discussed shortly after) Good sessions, pleasant talks with the community, and also — a lot of new things to learn. The event took place at the shore of the biggest warm-water lake in Europe, at Lake Balaton.
Sure enough, sessions were covering important Drupal 8 features. There were several tracks, as well as sprints, where participants were able to collaborate.
I visited mainly the workshops related to the API-first initiative. This is a futuristic initiative, involving many JavaScript tools and modern concepts and practices for building service-oriented apps, not only websites.
It’s a vital initiative for Drupal as a platform for the future. Presently, Drupal is one of the best systems for content modelling, querying, and building websites in general. This means that normal people can make websites with complex information structures with very little or no programming.
The API-first initiative could potentially take Drupal into a place where the content modelling and querying becomes data modelling and querying, enabling non-developers to build complex APIs for the next generation apps.
Apart from these, there were also sessions about Drupal-specific modules being upgraded between Drupal 7 and 8. In overall, I think we’ll see more “good stuff” of Symfony, PHP OOP, design patterns, etc topics during next Drupal events.
This is my humble list of highlighted sessions I focused on.
REST APIs by Pieter Frenssen (pfrenssen)
Well-formed, step-by-step guide, covering all important concepts of having Drupal as both server and/or a client in REST API architectures. If you want to skip the details in this section, check Drupal REST API docs which covers great amount of information around the topic.
The beginning was a general information about what REST actually is. This included status codes, methods, design patterns, etc.
After presenting the basics, the next step was to use Drupal as a client, fetching data from drupal.org REST API and displaying it in a block.
Creating a block with Drupal Console was super-easy. That was a really neat way to demonstrate injecting the http_client service via the cli from the container.
There was also a demo of using the core REST API module, which transforms Drupal into an API server. REST UI module was demonstrated as a site builders’ tool to manage the configurations which are otherwise managed through .yml files. Here, it’s important to note, that the endpoints of the REST API are controllers. Developers have the freedom to choose which format of data to return and via which components. For example, one can use the Symfony’s HttpFoundation and its JsonResponse instance.
In short, there was a lot of good advice, both about REST APIs in general, and Drupal-specific implementations, in combination with third-party tools and components.
Headless Drupal by Ruben Teijeiro (rteijeiro)
Even though I did not attend the workshop, it was still part of the Drupal API-first series of topics. Code of the session.
Progressive web apps by Théodore Biadala (nod_)
That was an intermediate-level session. Promises were in the core of all code snippets and demonstrations. Highlight APIs: Fetch API, Cache, Service Workers, and Web APIs in general. The main idea was to demonstrate how modern web APIs can be used to build web apps, having functionalities very similar to native apps.
The repository of the workshop is public, so go and check it for further details in case you’re interested into the interface implementations.
It’s interesting to note the example of promise-based behaviors system. A modernized implementation of classic concept on managing JavaScript.
GraphQL by Sebastian Siemssen (fubhy)
The #GraphQL workshop w/ @thefubhy at #Drupalaton pic.twitter.com/AgfQGzCq81
— Kalin Chernev (@kalinchernev) August 12, 2016
Needless to say, that was the “cherry” session. It was about the Facebook’s GraphQL, which developers were ready to understand, after touching upon REST APIs, JavaScript Frameworks, knowing what is a server and a client in general in the previous sessions.
I personally enjoyed the workshop. In fact, I was even able follow along with the live coding on the main screen. It was also nice that it made a clear association between specification and language implementation. This means that same concepts of data architecture were demonstrated and practices with JavaScript and PHP.
In the first part, the Star Wars API was used with the GraphiQL — a hands-on tutorial to understand the basic concepts like queries, fragments, variables, sub selections, etc.
Second was the usage of node.js app with express, express-graphql, graphiql, graphql and other popular modules to transpile ES6 code. In this playground, the building part started. Various types were used: GraphQLSchema, GraphQLObjectType, GraphQLString, GraphQLInt, GraphQLNonNull, GraphQLList, etc. That was my first time to actually write something working out of the learngraphql.com online tutorials.
There was a demo of Relay in-between, as a bonus, to grab a general understanding of the additional features provided on top of the fundamental specification.
After the GraphQL implementation in JavaScript was getting convenient, then we continued using the same concepts, but to build a server in PHP and the Drupal GraphQL module. Sure enough, the approach was similar, but this time extending SchemaProviderBase and implementing framework-specific EntityTypeManager (Interface) to manage Content Entity items.
The event was awesome, the people were great, and the sessions were truly useful. I feel somehow privileged with the opportunity to attend such a good series of sessions related to API-s in the Drupal community!
There are a lot of new technologies and tools to learn and play with. I hope the summary above is a good starter for anyone enthusiastic about the future of the tools mentioned.
End of the first day at @drupalaton we have a great dinner. pic.twitter.com/CN795wXixz
— 5NET Interactive (@5NEThu) August 11, 2016
Many thanks to the local Drupal community in Hungary! :)