craftcms / craftcms/docs

[Content]: Eager Loading should mention what field types and properties benefit/support it

Open
#516 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

📦 CMS
Dominant language
JavaScript
Stars
42
Forks
160
Avg merge
3h 9m
Merged PRs (30d)
4

Description

Product

Other/Multiple/Not Sure

Description

We aren't currently explicitly listing the fields and/or properties of elements that can be eager-loaded.

This may have to be "generic," but should still be front-and-center, i.e. "Only properties and custom fields that reference other elements can be eager-loaded."

Additionally, not all fields and/or related elements need to be eager-loaded. We can cover situations where you are apt to see performance improvements vs situations where you won't see any benefit.

This may include a mention of the eager-loading-in-place service method:

{% do craft.app.elements.eagerLoadElements(
  className(entry),
  [entry],
  [
     ...
  ]
) %}

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start from the existing eager-loading documentation; the issue does not name a file or page. Update the relevant content to explain which field types and properties support eager loading, when it improves performance, and whether to include the shown eagerLoadElements() example. Done means these limitations and use cases are clearly documented.

Written by the indexing model from the issue text.

Assessment

Domain
documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.