-
Notifications
You must be signed in to change notification settings - Fork 15
FAQ
If you're coming from AEM Boilerplate or Block Collection, you may notice some foundational differences with Author Kit. The following FAQ should hopefully answer the most common questions.
Boilerplate's section classes are created based on the blocks inside them. As such, a section could have hero-container, columns-container, or both: hero-container columns-container. Developers are then required to know up front all possible combinations when using these classes. This is also in addition to any styles that may be applied from section metadata. It's far too easy to run into scoping and specificity issues when working with classes setup this way.
Author Kit follows patterns that are more similar to common industry patterns like Bootstrap and Tailwind. You have a section, a container, and then default content or block content. Each continuous group of content (default or blocks) will be placed into a container that you can style.
We believe the best code is no code. We also believe code is more readable when you opt-in rather than opt-out. I would encourage you to look at the hero block of AEM Boilerplate. The very first property is max-width: unset. This is saying, "The very first thing I need you to is undo the styles being forced upon me."
We have found section-metadata to be a powerful pattern to control layouts surrounding blocks. It's also quite common to not need section-metadata when working with higher priority or LCP-bound blocks (hero, etc). As such, placing all section styles in styles.css and putting section logic in the critical path of LCP to be non-ideal. It's a core Edge Delivery principle: only load styles and logic when you need them.
The authoring ergonomics of calling a singleton something plural can fall down when you want to style an individual item. Example: "I want to style one card in my cards block, how do I do this?" Note: there is a tradeoff here. You will end up making more table-based blocks if you have many authored cards. If you prefer to have a "cards" block, you can always make one.
Keeping consistent pluralization patterns for authors helps with discoverability and reduces training. Which also goes hand in hand with keeping a leaner and more maintainable codebase. The way your organize a series of card blocks is the exact same way you handle a series of teaser(s), video(s), and more. Structurally, keeping these the same will require fewer mental hurdles when writing layout code section metadata.
It's not required, but it is recommended. For two reasons:
- It's quite common for authors to copy production URLs to paste into their documents. These are not converted to relative on aem.TLD URLs. When this happens, pre-production visitor journeys break and cause confusion and frustration. Author Kit will identify links using the hostname and make them relative and respect the visitor journey.
- Because production URLs can land as fully qualified / non-relative URLs, we would have no path to localize the URL if a locale-agnostic link has been used.
It's unfortunate these are now specified in multiple places: Config Bus, code, etc. but we feel this is creates the best experience for all personas: author, administrator, QA, and developer.
Given the purposefully flat structure of Edge Delivery documents, it's quite common to need "just one more" layer of nesting. This could be anything from placing a youtube video next to text inside some columns or placing columns inside a tab component. We've seen a lot of awkward implementations to work around the section > block relationship. Codifying section > block > link as a repeatable and useable pattern alleviates a lot of these poor implementations.
No. You can remove this.
First and foremost, there should be no material performance penatly having this as a separate file. This is purely a separation of concerns choice. The functions that decorate your site and the functions that fulfill your contractual obligations to Adobe should be treated separately.
A few reasons.
- Author Kit heavily leans into Edge Delivery best practices. It often subscribes to these principles more than Boilerplate. Here's an example: Adobe will often tell developers not to place any code in the critical path of LCP. If you look at
aem.js, you will find many functions not needed to get to LCP:createOptimizedPicture,buildBlock,decorateIcon,readBlockConfig, etc. Author Kit places these non-critical functions into separate files that can be used when needed. - As noted above,
ak.jsalso does not include RUM functions itself. - Author Kit simply works more efficiently having been created based on lessons learned from many real-world projects.
Both projects are incredibly fast, but there are some limited scenarios where Author Kit is faster. This has a lot to do with the micro optimizations sprinkled through out the codebase. A few examples:
- The overall codebase is smaller. Beyond what was mentioned above, there are fewer
eslint-disablestatements, smaller functions, less redundant functions, etc. Fewer bytes over the wire means faster responses. This is especially true when it comes to delivering the LCP element. - Icons are only loaded for the immediate section being loaded, not all icons for the entire page.
- There's less DOM manipulation happening during decoration. Fewer class names being added, fewer data attributes, fewer synthetic blocks, etc.
- Using
forinstead offorEachis shown to be more efficient (though only in extreme cases). - It is obsessively parallelized where possible. If an async function or module can be run or imported concurrently without any performance pentalty, Author Kit will do it.
Mostly the opposite. Author Kit prides itself on having more knobs and dials to help your project scale. We believe the features in Author Kit are a matter of when your project needs them, not a matter of if they will need them. The README of this codebase covers many of these features.
- There is no
lighthouse=oncheck - We believe you should be transparent about performance of a page. - There is no synthetic hero block built - This has proven to cause confusion with authors and developers alike.
- There is no
delayed.js- Only create this if you truly need it.
- Author Kit is a community project publicly maintained by Adobe employees. As of this writing, it is not an official boilerplate and thus, it is not officially supported beyond Discord and public GitHub issues.
- The notable differences above makes Author Kit a poor upgrade from a Boilerplate-based project. Much like comparing traditional AEM to Edge Delivery; there is no free lunch. New features and radical improvements come with breaking changes. We do not recommend trying to upgrade an existing Boilerplate-based project to Author Kit.
- While Author Kit is based on very mature and very large projects, it's relatively young itself. As such, Author Kit is going through fairly rapid improvements. Getting changes from upstream may feel laborious.
- Nearly all Adobe boilerplates are inspired by the original. As such, projects like Adobe Commerce, Universal Editor, AEM Forms, Dynamic Media, and more will be more work to port to Author Kit.
- Author Kit can often be a place for researching early-access ideas. As such, if we find a feature is not adopted by the overall community, we will remove it. Some currently live examples: Schedules (promotions), Quick Edit, and Focal Point.