From July 2 to 6, the 2018 Drupal Dev Days took place in Lisbon, where 404 participants gathered for keynotes, sessions, BOFs, and sprints.
Here is a summary of the sessions I attended and the topics I sprinted on.
Sprints
Entity share
I was able to dedicate time to moving Entity share forward:
- testing reported bugs
- merging patches
- answering questions
I did not release a new version, as after switching to the 2.x branch of JSON API (the version that will be integrated into Drupal core), Entity share no longer works when timestamp or date fields are involved. Additionally, the latest development version of JSON API Extras had also stopped working.
In order to fix Entity share and avoid it breaking again with future JSON API changes, a solution proposed by Wim Leers will need to be explored. However, this involves rethinking the internal workings of Entity share and I don't yet know when I'll have time to tackle that.
Drupal Composer: drupal-l10n
By chance, on the first day I was seated near Webflo, administrator of the drupal-composer group on GitHub. I was therefore able to meet him and follow up on merge requests for the drupal-composer tools.
- Being able to differentiate files based on the development environment: updated against the latest commits.
- Tests for unreported errors when using the hirak/prestissimo extension: marked as priority, so the previous point would not be addressed until this one is resolved.
- drupal-l10n integrated into the drupal-composer group:
- copy of the Git repository,
- rework of the plugin architecture based on the latest changes in drupal-scaffold,
- setting up Travis CI,
- connection to Packagist.org,
- creating a tag,
- writing an update note.
I'm quite pleased that this Drupal Composer work was able to move forward. The merge requests had been open for just over a year and I had to keep updating them regularly. Only https://github.com/drupal-composer/drupal-scaffold/pull/58 remains to be merged.
Local Community Distribution
There was already an initiative to create a distribution for the various Drupal communities before these Drupal Dev Days. It was able to progress during the event.
I presented to the people involved the Drupalcampfr base and the Drupal 8 version of the Drupalfr website currently under development, and offered to stay in touch to answer their questions.
On the theming side, they will likely adopt the Drupalfr theme, which appealed to them visually. To be confirmed, as the drupal.nl theme had already been proposed.
Drupalfr
We published a banner on the Drupalfr site to promote Drupal Europe.
Mainly alongside Floris Moriceau, we made progress, on theming on his side, and on features (job offer workflow, image styles, default content, etc.) on my side.
Day 1
Day dedicated to sprints.
Day 2
Keynote: Friction
A look back at Drupal's development cycle with Drupal 7 and the feature freeze / UI freeze system, which meant Drupal 7 barely evolved since its release.
As a result, missing parts of the Entity API had to be filled in by the contributed Entity API module.
Drupal 8, with its new development cycle releasing a new minor version every 6 months and its experimental module system, allows for evolution.
Experimental modules are now only added to core once they reach beta stability, to avoid problems like those with Content Moderation which had to change its structure without a data migration path because it was in alpha, causing issues for users who had ignored the warnings about it being experimental.
Over the past year, 70K more Drupal 8 sites and 105K fewer Drupal 7 sites were registered in Drupal.org's usage statistics.
There's no need to panic about these figures relative to articles claiming Drupal is losing steam, the total number of sites is lower, but the context has changed.
The user base has evolved:
- some never used Drupal 7 and are therefore new users coming in via Drupal 8,
- others are realizing through experience that Drupal may not be the best fit for their needs,
- in the Drupal Commerce space, people are turning to Drupal 8 specifically for Commerce,
- the CMS is increasingly being chosen by marketing departments rather than IT departments within organizations.
The goal is to remove friction from the discovery and adoption of Drupal, and to simplify the discovery process.
The page for trying Drupal essentially says "try Drupal, set up an environment in 20 minutes", but people who want to try Drupal don't have 20 minutes.
Positive points / progress:
- the Umami demo profile
Negative points:
- a ready-to-use online version is missing
- the use of Composer
Points to explore:
- The "experienceReports" concept from the Go language, which allows quickly and simply collecting impressions and issues encountered during the Drupal testing process.
- Voting on issues to prioritize them.
- Telemetry initiative: to collect data such as PHP versions in use, enabling better-informed decisions about prioritizing contributor work, given that contributors' time is not unlimited.
Overview of GDPR modules for Drupal
Presentation of GDPR modules, starting from the points that need to be implemented on a site. For each point, the relevant modules are listed along with their functional coverage percentage, implementation difficulty, and latest version stability.
There are currently too many modules addressing GDPR points, leading to duplicated effort and making it harder to find the right modules.
A few modules I had not come across in my own research on the topic:
- GDPR Tag manager,
- Blizz vanisher,
- CookieBot,
- Cryptolog,
- IP anonymize.
Twig and twig.js: A magical tale about 2 families, and about art, magic, heroes and villains
Twig JS allows managing HTML via Twig while enabling JavaScript to easily replace parts of HTML without needing to know the HTML structure.
For example, a Twig template is passed to a JavaScript file via Drupal settings. JavaScript can then use that variable to regenerate HTML with the Twig variables and replace existing HTML by simply selecting a parent element.
It looks promising, but there are the following issues:
- translations: the Twig "trans" tag does not exist in Twig JS,
- when in Drupal you render an object such as {{ content }}, Drupal knows how to render it, Twig JS does not,
- Twig JS weighs 83 KB.
Testing the use of Underscore JS, lighter than Twig JS and included in core, to create a "twiglight" equivalent.
Symfony Framework style API building in Drupal
Presented by someone from the Symfony world who does little or no Drupal.
In the context of a Drupal site serving as a backend for web services, how to use certain Symfony components within Drupal:
- Autowiring to declare controllers as services and no longer needing to use the "create" method for dependency injection.
- Declaring controllers with annotations and thus managing their routes in the annotation as well: a module exists for this.
- Declaring cache metadata via annotations.
- How to disable the cache even at the routing system and service container level.
To be seen what will be usable outside an experimental context.
Building a citizen portal for 100+ services using a microservices architecture
Providing a generic web services system with automatic front-end form generation.
Creating a content entity type with bundles. Each bundle represents a service, allowing each service to have its own fields.
JSON schema is used to generate front-end forms based on the bundle structure.
Field ordering and multi-step forms are managed via form modes.
For the first version of the project, and because it is complicated (if not impossible) with modules like Conditional Fields to apply conditions on a field at step N based on the value of a field at step N – X, the multi-step behavior is actually handled via JavaScript. The full form is present on the page, but only the current step is displayed to the user, so Conditional Fields and the Form API's State API can work normally.
How to delight content editors with UX when building Drupal 8 websites
A few modules and themes to improve the back office:
- Adminimal admin theme,
- Adminimal admin toolbar,
- Material admin,
- Admin toolbar,
- Autocomplete deluxe,
- And making more use of the core Shortcuts module.
Example of the "mass.gov" site's administration theme, where significant work was done on the node/add page for selecting the content type to create, with a preview image, a precise description of which content type to use in which case, and search filters to narrow down the list of content types.
Tour module: it is possible to add a "?tour" parameter to the URL to trigger Tour. Handy if the user does not have access to the Tour button in the administration toolbar.
More generally, when gathering requirements, don't hesitate to ask users what they call the fields in their line of work or how they would like to name them. Alternatively, observe how users work in their day-to-day activities.
Day 3
Today, my friends, we're going to Change the World...
Rachel Lawson during her keynote.
A quote: "You take risks, you get reward.": from Rachel Lawson's trip to Morocco, where a hotel with an unpromising exterior turned out to have a magnificent interior.
The story of the "War Child" website, rebuilt in Drupal, which doubled the conversion rate of visitors into donors.
With those additional resources, the NGO was able to reunite a child from Mosul captured by ISIS, later freed, and waiting in a refugee camp with his parents.
State of Layout Management in Drupal
Presentation of the various tools for managing layout in Drupal 8, with a focus on the Bricks module. The presenter was the module's maintainer.
There is no single strategy for managing content display, it needs to be assessed based on the project's requirements.
The presenter wanted to demonstrate the combined use of:
- block layout (core): for global site blocks such as header and footer.
- field layout (core, experimental): for managing regions within content entities.
- bricks: for managing regions, grid systems, and nesting at the field level.
I had tested the Bricks module about a month earlier and it does indeed look interesting, but:
- it remains a new entity type, admittedly the relationship between entities is serialized into the field and you don't need a reference field in a brick type to build a hierarchy,
- the module relies on ECK, creating a dependency on a module that is no longer necessary in Drupal 8 thanks to the new Entity API,
- you still need to create the various brick types, which amounts to creating paragraph types.
To truly move away from loading many paragraphs to handle grid systems or nesting (such as carousels), I think the module that will revolutionize how sites are structured is the Layout Builder module, currently experimental in Drupal 8.6.x. But we will likely need to wait one or two more minor releases for the module to stabilize and for issues like Search API integration (is it possible to index content from a block placed with Layout Builder?) and translation support to be resolved.
Progressive Web Apps for all Drupal sites
Presentation of the PWA concept and prerequisites.
The PWA module allows pre-caching visited URLs for offline use.
Service workers are removed when the module is uninstalled, preventing zombie service workers from lingering in browsers.
The following features are not provided out of the box, which makes sense, as it's difficult to make generic decisions about them:
- push notifications,
- background sync: showing the cached page first, then refreshing it,
- choosing a caching strategy.
There is a tool in Chrome DevTools to test whether a site works in PWA mode.
Currently the module displays an "You are offline" message on an unvisited page rather than a network error page.
Modern Javascript for Drupal Developers
A history of JavaScript ES versions, with a presentation of the new features each brings.
I don't do enough JavaScript to fully grasp the content and subtleties of this session.
The presenter, a core JavaScript maintainer, has an excellent level of expertise and genuine passion for the subject, but perhaps the format meant the information didn't land well:
- the new features were covered very quickly: perhaps there were too many to present,
- the examples given were not meaningful: constantly using "a = b", "c = 1" and similar constructs, whereas I think using more concrete examples, or even code directly from core, would have made much more sense.
On substance, I found some of the syntaxes presented as revolutionary to be harder to read and understand than the "older" equivalents.
Reusability is overrated, administrability overlooked. The unwritten laws for a successful frontend development.
A methodology for organizing front-end work to achieve a quality, maintainable, and evolvable result.
- The front-end developer should participate or participate more in reviewing designs in order to identify problems as early as possible.
- There are always questions to ask the designer.
- Verify that Drupal's markup will be compatible with the design, in order to either adapt the design or plan the development work accordingly.
On CSS structure:
- Any style change at the end of the project should be as easy to implement as at the beginning.
- The goal of code is not to be the most elegant, efficient, or well-factored, it is to be code that allows changes at any point in time.
- In the SASS (or other CSS preprocessor) file nesting order, which is close to the SMACSS methodology with a few differences, you find:
- utility: contains mixins, variables, and other tools,
- base: base styles (a, p, body, etc.), colors, grid system, typography,
- components: forms and other HTML components,
- layout: paragraphs, blocks, content types, etc.
- Setting up the theme (utility, base, components): requires a lot of coordination and consensus among themers.
- Styling layouts (layout): can be done in parallel, with one rule, never touch the contents of the utility, base, and components files; otherwise the team must re-coordinate on those points.
- Break down work by component, not by page.
- File structure: the SASS file name = the base selector of that file, with no other selectors inside. This means that just from the file name you know what it contains, and when a selector no longer exists because the view or content type it referenced was deleted, for example you can safely delete the SASS file.
- When using an external library that also provides styles, those styles should be opt-in rather than opt-out. With Drupal 8 and the libraries-overrides key in themes, it is easy to exclude CSS files from external libraries.
Day 4
An update on Drupal 8.6
"Embrace the chaos."
Taking the perspective of someone coming to contribute for the first time, a sprint room or the issue queues on Drupal.org are full of already-involved, busy people actively working on topics requiring varying degrees of concentration.
Where should I go to get started?
If you are on your own and start by picking a random issue, even one marked "novice", you risk getting stuck and losing motivation. It's better to seek out the leaders of initiatives or sprint topics, who will always have something to hand off to beginners, or the mentors who are there to guide new contributors and ease them gradually into the contribution process.
This was followed by an overview of the various initiatives.
https://www.drupal.org/about/strategic-initiatives: with the initiatives meeting schedule in the sidebar.
TDD - Test Driven Drupal
A presentation on how to write automated tests with Drupal 8. A recap of the different test types and their benefits.
One of the challenges when writing tests is knowing what to test. For example: should I test the HTML output of a block, or the renderable array that makes up its content?
At the end of the session, I was able to ask whether it was possible to use CMI and the exported configuration from a project to set up test prerequisites.
A few months earlier, on a project using CMI for configuration management, it had been cumbersome to have to export configuration into a test module in order to use it in tests, what about maintaining that configuration? But using the exported configuration directly wasn't possible, and scripting the setup of the content types, fields, etc. needed for the tests would have taken too long.
I was pleased when the presenter replied that he had also tried this approach for functional automated test prerequisites and unfortunately had run into the same problems. It is not currently possible.
Perhaps with the CMI 2.0 initiative and the ability, without a contributed module, to use an existing configuration to install a site, it will become possible at that point.
BOF GDPR
I attended the GDPR BOF. The session notes are available online. The key points from the discussion were:
- creating a demo to provide a concrete example of a GDPR-compliant site, showing which modules to use and how to use them,
- centralizing GDPR-related module functionality into a single module to reduce fragmented effort and make it easier to find a solution,
- highlighting the fact that the current GDPR module has nothing regarding minors,
- it is urgent to put the necessary APIs in place so that other contributed modules can hook into them.
After a quick consensus, discussions will continue on drupalchat.eu in the gdpr channel.
Day 5
My Drupal Mid-Life Crisis
A presentation by Robert Douglass on his journey trying to build a Drupal 8 site for fun after 7 years away from Drupal.
A very interesting presentation that somewhat echoes the Friction keynote, showing at each step the pleasant and unpleasant surprises experienced by someone who has worked extensively with Drupal and mentored many of today's key community figures.
A few examples:
- Why doesn't the Fivestar module work, and why are other rating modules unstable?
- How is it that the Rules module, in the top 30 most used modules with over 300,000 sites using it, having its own logo, having run a fundraiser to accelerate its Drupal 8 port, and being maintained by brilliant community members — is still not stable or even fully usable in Drupal 8?
Conclusion
A very good event that allowed progress on sprint topics and the chance to meet or reconnect with people from the French and international community.
Great community evenings for discussion and exchange.
I think I will attend fewer and fewer keynotes and sessions going forward. I follow Drupal news fairly closely, even if I occasionally miss something, through:
- the Drupal.org planet,
- the Drupal.fr planet,
- Twitter,
- Drupal.org newsletters,
- Dries's newsletter,
- watching session recordings from DrupalCons and other events.
As a result, I learn relatively little that is new at these events, and when something is new, like Twig JS, it is not always immediately usable.
There are other topics I haven't yet explored, such as headless, but before attending sessions on a subject it's better to have done some hands-on experimentation or research first.
I prefer to focus on sprints to make them more productive. It is difficult to sprint, stop to go to a session, come back and sprint again, stop again, and so on. And at some point, only practice leads to real progress by encountering real problems.
In any case, once you identify a session's presenter, it is always possible to approach them with a question outside the session. Sessions are also recorded and slides are published online.
Finally, thanks to the organizers, sponsors, participants, and to Smile for sending me there.