Skip to content

Conversation

@armine-fliplet
Copy link
Contributor

@armine-fliplet armine-fliplet commented Sep 9, 2025

Product areas affected

Fliplet CLI

What does this PR do?

Update Dynamic components documentation

JIRA ticket

ID-3773

Summary by CodeRabbit

  • Documentation
    • Added comprehensive public API guides for DynamicContainer, ListRepeater, and RecordContainer.
    • Expanded coverage includes retrieval workflows, instance capabilities, lifecycle behaviours, and event hooks.
    • Clarified data binding patterns and provided practical integration examples.
    • Documented loading states, update handling, pagination, and cleanup flows for repeaters and containers.
    • Improved consistency and discoverability across helper components to support faster implementation and troubleshooting.

@coderabbitai
Copy link

coderabbitai bot commented Sep 9, 2025

Walkthrough

Adds comprehensive public API documentation in docs/API/helpers/dynamic-components.md for DynamicContainer, ListRepeater, and RecordContainer, detailing retrieval methods, instance properties/methods, row-level APIs, hooks/events, and usage examples.

Changes

Cohort / File(s) Summary of changes
DynamicContainer APIs
docs/API/helpers/dynamic-components.md
Documents Fliplet.DynamicContainer.get(filter, options) and getAll(filter); defines Container instance properties (id, uuid, parent, dataSourceConnection) and container.connection() method.
ListRepeater APIs & Rows
docs/API/helpers/dynamic-components.md
Documents Fliplet.ListRepeater.get(filter, options) and getAll(filter); instance methods (loadData, loadMore, applyUpdates, hasPendingUpdates, destroy); row-level methods (update, destroy, render).
RecordContainer APIs
docs/API/helpers/dynamic-components.md
Documents Fliplet.RecordContainer.get(filter, options) and getAll(filter); instance properties (id, name, parent, entry, dataSourceId, isLoading, error) and methods (showLoading, hideLoading, hasPendingUpdates, applyUpdates, retrieveEntryData, render).
Hooks & Events
docs/API/helpers/dynamic-components.md
Adds hook/event docs: listRepeaterRowReady, listRepeaterRowUpdated, repeaterDataRetrieved, repeaterDataRetrieveError, recordContainerBeforeRetrieveData, recordContainerDataRetrieved, recordContainerDataRetrieveError.
Examples & Integration
docs/API/helpers/dynamic-components.md
Expands examples for data binding, retrieval, pagination, updates, and integration patterns for the three components.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant App
  participant Fliplet as Fliplet.DynamicContainer
  participant Container
  participant DS as Data Source

  App->>Fliplet: get(filter, options)
  Fliplet-->>App: Promise<Container>
  App->>Container: connection()
  alt cached connection
    Container-->>App: Promise<DS.Connection> (cached)
  else first call
    Container->>DS: establish connection
    DS-->>Container: DS.Connection
    Container-->>App: Promise<DS.Connection>
  end
Loading
sequenceDiagram
  autonumber
  participant App
  participant FLR as Fliplet.ListRepeater
  participant LR as ListRepeater
  participant Svc as Data Service

  App->>FLR: get(filter, options)
  FLR-->>App: Promise<ListRepeater>
  App->>LR: loadData()
  LR->>Svc: fetch page 1
  Svc-->>LR: data/page 1
  LR-->>App: Promise resolved
  App->>LR: loadMore()
  LR->>Svc: fetch page N+1
  Svc-->>LR: data/page N+1
  LR-->>App: Promise resolved
  note over LR: Emits events: repeaterDataRetrieved / repeaterDataRetrieveError<br/>Row events: listRepeaterRowReady / listRepeaterRowUpdated
  App->>LR: applyUpdates() / hasPendingUpdates() / destroy()
Loading
sequenceDiagram
  autonumber
  participant App
  participant FLRC as Fliplet.RecordContainer
  participant RC as RecordContainer
  participant Hook as Hooks
  participant Conn as DS.Connection
  participant DS as Data Source

  App->>FLRC: get(filter, options)
  FLRC-->>App: Promise<RecordContainer>
  App->>RC: showLoading()
  App->>RC: retrieveEntryData(connection, entryId?)
  RC->>Hook: recordContainerBeforeRetrieveData (modify query)
  RC->>DS: query via connection
  DS-->>RC: entry or error
  alt success
    RC->>Hook: recordContainerDataRetrieved
    RC->>App: hideLoading()
    App->>RC: render()
  else error
    RC->>Hook: recordContainerDataRetrieveError
    RC->>App: hideLoading()
  end
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested reviewers

  • ibroom
  • debankurghosh2061

Pre-merge checks (3 passed)

✅ Passed checks (3 passed)
Check name Status Explanation
Title Check ✅ Passed The title succinctly describes the main change in the pull request, which is updating the documentation for dynamic components. It is clear and specific, allowing a teammate to understand the purpose without extraneous detail. Therefore, it aligns with the principles for a good PR title.
Description Check ✅ Passed The description clearly states that the PR updates dynamic components documentation and references the affected product area and ticket, which directly matches the changeset. It provides relevant context without being off-topic.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.

Tip

👮 Agentic pre-merge checks are now available in preview!

Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.

  • Built-in checks – Quickly apply ready-made checks to enforce title conventions, require pull request descriptions that follow templates, validate linked issues for compliance, and more.
  • Custom agentic checks – Define your own rules using CodeRabbit’s advanced agentic capabilities to enforce organization-specific policies and workflows. For example, you can instruct CodeRabbit’s agent to verify that API documentation is updated whenever API schema files are modified in a PR. Note: Upto 5 custom checks are currently allowed during the preview period. Pricing for this feature will be announced in a few weeks.

Example:

reviews:
  pre_merge_checks:
    custom_checks:
      - name: "Undocumented Breaking Changes"
        mode: "warning"
        instructions: |
          Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).

Please share your feedback with us on this Discord post.

✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feature/ID-3773

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 10

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
docs/API/helpers/dynamic-components.md (1)

183-193: Fix invalid JavaScript syntax in example (ready() => { is not valid).

Change to an object method using a function expression. This currently won’t run if copied.

Apply:

-  render: {
-    ready() => {
+  render: {
+    ready: function () {
       // Get the connection object from the parent component
       this.parent.connection().then((connection) => {
         // Find all entries in the data source
-        return connection.findWithCursor(cursorData);
+        return connection.findWithCursor(cursorData);
       }).then((rows) => {
         // Set the data to the helper
         this.set('foo', rows);
       });
-    }
+    }
   }
📜 Review details

Configuration used: CodeRabbit UI

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between cd2225b and 40b7b62.

📒 Files selected for processing (1)
  • docs/API/helpers/dynamic-components.md (3 hunks)
🧰 Additional context used
🪛 markdownlint-cli2 (0.17.2)
docs/API/helpers/dynamic-components.md

24-24: Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)


27-27: Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


29-29: Unordered list indentation
Expected: 2; Actual: 0

(MD007, ul-indent)


30-30: Unordered list indentation
Expected: 4; Actual: 2

(MD007, ul-indent)


31-31: Unordered list indentation
Expected: 4; Actual: 2

(MD007, ul-indent)


33-33: Unordered list indentation
Expected: 2; Actual: 0

(MD007, ul-indent)


35-35: Unordered list indentation
Expected: 4; Actual: 2

(MD007, ul-indent)


37-37: Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


39-39: Unordered list indentation
Expected: 2; Actual: 0

(MD007, ul-indent)


41-41: Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


42-42: Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)


67-67: Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)


70-70: Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


72-72: Unordered list indentation
Expected: 2; Actual: 0

(MD007, ul-indent)


75-75: Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


77-77: Unordered list indentation
Expected: 2; Actual: 0

(MD007, ul-indent)


79-79: Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


80-80: Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)


98-98: Unordered list indentation
Expected: 2; Actual: 0

(MD007, ul-indent)


99-99: Unordered list indentation
Expected: 2; Actual: 0

(MD007, ul-indent)


100-100: Unordered list indentation
Expected: 2; Actual: 0

(MD007, ul-indent)


101-101: Unordered list indentation
Expected: 2; Actual: 0

(MD007, ul-indent)


102-102: Unordered list indentation
Expected: 2; Actual: 0

(MD007, ul-indent)


106-106: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


107-107: Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)


109-109: Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)


112-112: Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


113-113: Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)


126-126: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


127-127: Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)


139-139: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


140-140: Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)


152-152: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


153-153: Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)


161-161: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


162-162: Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)


233-233: Heading levels should only increment by one level at a time
Expected: h2; Actual: h3

(MD001, heading-increment)


239-239: Unordered list indentation
Expected: 2; Actual: 0

(MD007, ul-indent)


241-241: Unordered list indentation
Expected: 4; Actual: 2

(MD007, ul-indent)


242-242: Unordered list indentation
Expected: 4; Actual: 2

(MD007, ul-indent)


243-243: Unordered list indentation
Expected: 4; Actual: 2

(MD007, ul-indent)


245-245: Unordered list indentation
Expected: 2; Actual: 0

(MD007, ul-indent)


247-247: Unordered list indentation
Expected: 4; Actual: 2

(MD007, ul-indent)


249-249: Unordered list indentation
Expected: 2; Actual: 0

(MD007, ul-indent)


279-279: Unordered list indentation
Expected: 2; Actual: 0

(MD007, ul-indent)


281-281: Unordered list indentation
Expected: 4; Actual: 2

(MD007, ul-indent)


282-282: Unordered list indentation
Expected: 4; Actual: 2

(MD007, ul-indent)


283-283: Unordered list indentation
Expected: 4; Actual: 2

(MD007, ul-indent)


285-285: Unordered list indentation
Expected: 2; Actual: 0

(MD007, ul-indent)


288-288: Multiple headings with the same content

(MD024, no-duplicate-heading)


346-346: Unordered list indentation
Expected: 2; Actual: 0

(MD007, ul-indent)


371-371: Unordered list indentation
Expected: 2; Actual: 0

(MD007, ul-indent)


372-372: Unordered list indentation
Expected: 2; Actual: 0

(MD007, ul-indent)


373-373: Unordered list indentation
Expected: 2; Actual: 0

(MD007, ul-indent)


391-391: Unordered list indentation
Expected: 2; Actual: 0

(MD007, ul-indent)


392-392: Unordered list indentation
Expected: 2; Actual: 0

(MD007, ul-indent)


393-393: Unordered list indentation
Expected: 2; Actual: 0

(MD007, ul-indent)


394-394: Unordered list indentation
Expected: 2; Actual: 0

(MD007, ul-indent)


396-396: Multiple headings with the same content

(MD024, no-duplicate-heading)


404-404: Multiple consecutive blank lines
Expected: 1; Actual: 2

(MD012, no-multiple-blanks)


405-405: Multiple consecutive blank lines
Expected: 1; Actual: 3

(MD012, no-multiple-blanks)


406-406: Multiple consecutive blank lines
Expected: 1; Actual: 4

(MD012, no-multiple-blanks)


407-407: Multiple consecutive blank lines
Expected: 1; Actual: 5

(MD012, no-multiple-blanks)


408-408: Multiple consecutive blank lines
Expected: 1; Actual: 6

(MD012, no-multiple-blanks)


409-409: Multiple consecutive blank lines
Expected: 1; Actual: 7

(MD012, no-multiple-blanks)


436-436: Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)


439-439: Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


441-441: Unordered list indentation
Expected: 2; Actual: 0

(MD007, ul-indent)


442-442: Unordered list indentation
Expected: 4; Actual: 2

(MD007, ul-indent)


443-443: Unordered list indentation
Expected: 4; Actual: 2

(MD007, ul-indent)


445-445: Unordered list indentation
Expected: 2; Actual: 0

(MD007, ul-indent)


447-447: Unordered list indentation
Expected: 4; Actual: 2

(MD007, ul-indent)


449-449: Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


451-451: Unordered list indentation
Expected: 2; Actual: 0

(MD007, ul-indent)


453-453: Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


454-454: Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)


472-472: Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)


475-475: Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


477-477: Unordered list indentation
Expected: 2; Actual: 0

(MD007, ul-indent)


479-479: Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


481-481: Unordered list indentation
Expected: 2; Actual: 0

(MD007, ul-indent)


483-483: Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


484-484: Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)


494-494: Unordered list indentation
Expected: 2; Actual: 0

(MD007, ul-indent)


495-495: Unordered list indentation
Expected: 2; Actual: 0

(MD007, ul-indent)


496-496: Unordered list indentation
Expected: 2; Actual: 0

(MD007, ul-indent)


497-497: Unordered list indentation
Expected: 2; Actual: 0

(MD007, ul-indent)


498-498: Unordered list indentation
Expected: 2; Actual: 0

(MD007, ul-indent)


499-499: Unordered list indentation
Expected: 2; Actual: 0

(MD007, ul-indent)


500-500: Unordered list indentation
Expected: 2; Actual: 0

(MD007, ul-indent)


502-502: Multiple headings with the same content

(MD024, no-duplicate-heading)


504-504: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


505-505: Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)


507-507: Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)


510-510: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


511-511: Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)


513-513: Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)


516-516: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


517-517: Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)


519-519: Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)


522-522: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


523-523: Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)


525-525: Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)


529-529: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


530-530: Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)


532-532: Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)


534-534: Unordered list indentation
Expected: 2; Actual: 0

(MD007, ul-indent)


535-535: Unordered list indentation
Expected: 2; Actual: 0

(MD007, ul-indent)


536-536: Unordered list indentation
Expected: 2; Actual: 0

(MD007, ul-indent)


538-538: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


539-539: Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)


541-541: Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)


548-548: Unordered list indentation
Expected: 2; Actual: 0

(MD007, ul-indent)


549-549: Unordered list indentation
Expected: 2; Actual: 0

(MD007, ul-indent)


550-550: Unordered list indentation
Expected: 2; Actual: 0

(MD007, ul-indent)


552-552: Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


553-553: Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)


561-561: Multiple headings with the same content

(MD024, no-duplicate-heading)


563-563: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


564-564: Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)


572-572: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


573-573: Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)


580-580: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


581-581: Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)


589-589: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


590-590: Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Codacy Static Code Analysis
🔇 Additional comments (4)
docs/API/helpers/dynamic-components.md (4)

33-36: Clarify and verify retry/backoff semantics for options.ts.

Ensure the documented backoff (“starts at 10ms, +50% each retry, stop after >5000ms total wait”) exactly matches the implementation (total wait vs. max single delay, retry ceiling, and rejection error message).

I can align the wording after you confirm the exact algorithm used by get()/getAll().


126-137: findWithCursor usage may be misleading; ensure it’s public and show minimal working example.

The snippet references an undefined cursorData and a possibly internal method. Either define cursorData or use the already-documented find({ limit, offset }) pattern for consistency.

If findWithCursor is public, add a short cursorData example; else, replace with find. Example change:

-        return connection.findWithCursor(cursorData);
+        return connection.find({ limit: 50, offset: 0 });

366-374: Clarify how to access rows; document rowComponents if it’s public.

Examples use repeater.rowComponents[0], but rowComponents isn’t documented as public. Either:

  • Document rowComponents: Array<ListRepeaterRow>, or
  • Provide an official accessor (e.g. repeater.getRows()).

I can add the missing property description once you confirm intended public API.


603-614: Verify “Further reading” link path.

views.html may be incorrect relative to this page’s location (docs/API/helpers/). Ensure the relative link resolves in the built docs.

If needed, update to ../views.html or the correct route used by your site generator.

Comment on lines +20 to +59
### `Fliplet.DynamicContainer.get(filter, options)`

```js
Fliplet.DynamicContainer.get(filter, options)
```
Return a single Dynamic Container instance. If no `filter` is provided, the **first** available instance is returned.

**Parameters**

- **filter** `Number|String|Object` (optional)
- If a number or string is provided, it is treated as the **container id**.
- If an object is provided, it is used as an **exact-match** filter on instance properties (e.g. `{ id: 123 }`, `{ uuid: '...' }`).

- **options** `Object` (optional)
Controls retry behavior when the container hasn't finished rendering.
- **ts** `Number` – initial retry delay in milliseconds. If omitted, starts at `10` and increases by **50%** on each retry. Retries stop after `> 5000 ms` total wait; the Promise rejects with a timeout message.

**Returns**

- `Promise<Container>` — resolves with the matching container instance, or **rejects** after repeated attempts if not found.

**Example**
```js
// Find by id
Fliplet.DynamicContainer.get(123).then(container => {
// use container...
});

// Find by filter object
Fliplet.DynamicContainer.get({ uuid: 'abc-123' }).then(container => {
console.log('Found container:', container);
});

// With retry tuning
Fliplet.DynamicContainer.get(123, { ts: 20 }).then(c => {
console.log('Container is ready');
}).catch(err => {
console.error(err);
});
```
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Apply markdownlint fixes: convert emphasis-as-headings and add blank lines around fences.

Many sections use bold text for headings (MD036) and miss blank lines around fenced code blocks (MD031). Convert “Parameters/Returns/Example” to proper headings and add blank lines.

Example change for this block (repeat pattern elsewhere):

-**Parameters**
+#### Parameters
@@
-**Returns**
+#### Returns
@@
-**Example**
+#### Example

Also ensure a blank line before and after each ``` fence in this and subsequent sections.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
### `Fliplet.DynamicContainer.get(filter, options)`
```js
Fliplet.DynamicContainer.get(filter, options)
```
Return a single Dynamic Container instance. If no `filter` is provided, the **first** available instance is returned.
**Parameters**
- **filter** `Number|String|Object` (optional)
- If a number or string is provided, it is treated as the **container id**.
- If an object is provided, it is used as an **exact-match** filter on instance properties (e.g. `{ id: 123 }`, `{ uuid: '...' }`).
- **options** `Object` (optional)
Controls retry behavior when the container hasn't finished rendering.
- **ts** `Number` – initial retry delay in milliseconds. If omitted, starts at `10` and increases by **50%** on each retry. Retries stop after `> 5000 ms` total wait; the Promise rejects with a timeout message.
**Returns**
- `Promise<Container>` — resolves with the matching container instance, or **rejects** after repeated attempts if not found.
**Example**
```js
// Find by id
Fliplet.DynamicContainer.get(123).then(container => {
// use container...
});
// Find by filter object
Fliplet.DynamicContainer.get({ uuid: 'abc-123' }).then(container => {
console.log('Found container:', container);
});
// With retry tuning
Fliplet.DynamicContainer.get(123, { ts: 20 }).then(c => {
console.log('Container is ready');
}).catch(err => {
console.error(err);
});
```
### `Fliplet.DynamicContainer.get(filter, options)`
🧰 Tools
🪛 markdownlint-cli2 (0.17.2)

24-24: Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)


27-27: Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


29-29: Unordered list indentation
Expected: 2; Actual: 0

(MD007, ul-indent)


30-30: Unordered list indentation
Expected: 4; Actual: 2

(MD007, ul-indent)


31-31: Unordered list indentation
Expected: 4; Actual: 2

(MD007, ul-indent)


33-33: Unordered list indentation
Expected: 2; Actual: 0

(MD007, ul-indent)


35-35: Unordered list indentation
Expected: 4; Actual: 2

(MD007, ul-indent)


37-37: Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


39-39: Unordered list indentation
Expected: 2; Actual: 0

(MD007, ul-indent)


41-41: Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


42-42: Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)

🤖 Prompt for AI Agents
In docs/API/helpers/dynamic-components.md around lines 20 to 59, convert the
sections that currently use bold text as headings (e.g., **Parameters**,
**Returns**, **Example**) into proper Markdown headings (e.g., "### Parameters",
"### Returns", "### Example") and ensure there is a blank line before and after
each fenced code block; update the surrounding paragraphs so there is a single
blank line separating headings, prose, and each ``` fence to satisfy MD036 and
MD031 guidelines.

Comment on lines +72 to +74
- **filter** `Any` (optional)
If provided, instances are filtered using Lodash-style matching (e.g. `{ id: 123 }`). If omitted, **all** instances are returned.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick (assertive)

Make getAll(filter) filter typing and behaviour consistent.

Currently typed as “Any” with “Lodash-style matching”. Elsewhere you use specific unions (String|Object). Prefer Object here and explicitly state supported keys (e.g. { id, uuid }) to avoid ambiguity.

Proposed copy tweak:

-- **filter** `Any` (optional)
-  If provided, instances are filtered using Lodash-style matching (e.g. `{ id: 123 }`). If omitted, **all** instances are returned.
+- **filter** `Object` (optional)
+  Instances are filtered by shallow key/value match on instance properties (e.g. `{ id: 123 }`, `{ uuid: '...' }`). If omitted, **all** instances are returned.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- **filter** `Any` (optional)
If provided, instances are filtered using Lodash-style matching (e.g. `{ id: 123 }`). If omitted, **all** instances are returned.
- **filter** `Object` (optional)
Instances are filtered by shallow key/value match on instance properties (e.g. `{ id: 123 }`, `{ uuid: '...' }`). If omitted, **all** instances are returned.
🧰 Tools
🪛 markdownlint-cli2 (0.17.2)

72-72: Unordered list indentation
Expected: 2; Actual: 0

(MD007, ul-indent)

🤖 Prompt for AI Agents
In docs/API/helpers/dynamic-components.md around lines 72 to 74, the filter
parameter is currently documented as "Any" with vague "Lodash-style matching";
update the docs to type filter as "Object" (optional) and explicitly enumerate
supported match keys (e.g. { id, uuid }) and allowed match shapes, clarify that
Lodash-style shallow matching is used for those object keys, and remove the
ambiguous "Any" wording so the behavior and accepted keys are unambiguous.

Comment on lines +94 to +103
### Container instance API (returned by `.get()` / `.getAll()`)

A **Container** instance exposes the properties and methods below.

- **id** `Number` — Instance id.
- **uuid** `String` — Instance UUID.
- **parent** `Object|undefined` — Parent instance provided by the widget system.
- **dataSourceConnection** `Promise|undefined` — Cached Data Source connection Promise (populated after calling `.connection()`).
- **connection** `Function` — Method to connect to the configured Data Source (see below).

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick (assertive)

Document exact return type and caching semantics for container.connection().

State it returns Promise<DataSourceConnection>, that subsequent calls return the same Promise, and link to the Data Source API. This prevents confusion about whether a new connection is created per call.

Apply:

-- **dataSourceConnection** `Promise|undefined` — Cached Data Source connection Promise (populated after calling `.connection()`).
-- **connection** `Function` — Method to connect to the configured Data Source (see below).
+- **dataSourceConnection** `Promise<DataSourceConnection>|undefined` — Cached Promise set after the first `.connection()` call.
+- **connection() : Promise<DataSourceConnection>` — Returns a Promise for the configured Data Source connection. Subsequent calls reuse the cached Promise.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
### Container instance API (returned by `.get()` / `.getAll()`)
A **Container** instance exposes the properties and methods below.
- **id** `Number` — Instance id.
- **uuid** `String` — Instance UUID.
- **parent** `Object|undefined` — Parent instance provided by the widget system.
- **dataSourceConnection** `Promise|undefined` — Cached Data Source connection Promise (populated after calling `.connection()`).
- **connection** `Function`Method to connect to the configured Data Source (see below).
### Container instance API (returned by `.get()` / `.getAll()`)
A **Container** instance exposes the properties and methods below.
- **id** `Number` — Instance id.
- **uuid** `String` — Instance UUID.
- **parent** `Object|undefined` — Parent instance provided by the widget system.
- **dataSourceConnection** `Promise<DataSourceConnection>|undefined` — Cached Promise set after the first `.connection()` call.
- **connection() : Promise<DataSourceConnection>`Returns a Promise for the configured Data Source connection. Subsequent calls reuse the cached Promise.
🧰 Tools
🪛 markdownlint-cli2 (0.17.2)

98-98: Unordered list indentation
Expected: 2; Actual: 0

(MD007, ul-indent)


99-99: Unordered list indentation
Expected: 2; Actual: 0

(MD007, ul-indent)


100-100: Unordered list indentation
Expected: 2; Actual: 0

(MD007, ul-indent)


101-101: Unordered list indentation
Expected: 2; Actual: 0

(MD007, ul-indent)


102-102: Unordered list indentation
Expected: 2; Actual: 0

(MD007, ul-indent)

🤖 Prompt for AI Agents
In docs/API/helpers/dynamic-components.md around lines 94 to 103, update the
Container instance API docs to explicitly state that container.connection()
returns a Promise<DataSourceConnection>, that the resolved object conforms to
the Data Source API (add a link to the Data Source API docs), and that the
Promise is cached on the container (subsequent calls return the same Promise
rather than creating a new connection) so callers know to await the existing
Promise for reuse.

Comment on lines +231 to +237
# List Repeater JS API

### `Fliplet.ListRepeater.get(filter, options)`

```js
Fliplet.ListRepeater.get(filter, options)
```
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Fix heading level and duplication (“List Repeater JS API”).

This section appears under “## Repeater”; a top-level # breaks the hierarchy and triggers MD001/MD024. Use ### and avoid duplicating the “Example” headings.

Apply:

-# List Repeater JS API
+### List Repeater JS API
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
# List Repeater JS API
### `Fliplet.ListRepeater.get(filter, options)`
```js
Fliplet.ListRepeater.get(filter, options)
```
### List Repeater JS API
### `Fliplet.ListRepeater.get(filter, options)`
🧰 Tools
🪛 markdownlint-cli2 (0.17.2)

233-233: Heading levels should only increment by one level at a time
Expected: h2; Actual: h3

(MD001, heading-increment)

🤖 Prompt for AI Agents
In docs/API/helpers/dynamic-components.md around lines 231 to 237, the heading
"List Repeater JS API" is using a top-level `#` which breaks the existing
section hierarchy under "## Repeater" and duplicates "Example" headings; change
the heading level from `#` to `###` to match the surrounding structure and
remove or consolidate any duplicate "Example" headings so there is a single,
correctly-leveled example section for this API entry.

Comment on lines +239 to +247
- **filter** (`String|Object`)
The criteria used to find a List Repeater instance.
- If a `string` is provided, it is treated as the List Repeater `name`.
- If an `object` is provided, it is used as a set of key/value filters to match against existing repeaters.
- If omitted, the first available List Repeater instance will be returned.

- **options** (`Object`, optional)
Additional options for controlling retries.
- **ts** (`Number`) – Initial retry delay in milliseconds. (**Default**: `10`)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick (assertive)

Fix unordered list indentation for nested bullets.

Nested items under “filter” and “options” should be indented by two additional spaces to satisfy MD007.

Apply:

-- **filter** (`String|Object`)
-  The criteria used to find a List Repeater instance.
-  - If a `string` is provided, it is treated as the List Repeater `name`.
-  - If an `object` is provided, it is used as a set of key/value filters to match against existing repeaters.
-  - If omitted, the first available List Repeater instance will be returned.
+- **filter** (`String|Object`)
+  The criteria used to find a List Repeater instance.
+    - If a `string` is provided, it is treated as the List Repeater `name`.
+    - If an `object` is provided, it is used as a set of key/value filters to match against existing repeaters.
+    - If omitted, the first available List Repeater instance will be returned.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- **filter** (`String|Object`)
The criteria used to find a List Repeater instance.
- If a `string` is provided, it is treated as the List Repeater `name`.
- If an `object` is provided, it is used as a set of key/value filters to match against existing repeaters.
- If omitted, the first available List Repeater instance will be returned.
- **options** (`Object`, optional)
Additional options for controlling retries.
- **ts** (`Number`) – Initial retry delay in milliseconds. (**Default**: `10`)
- **filter** (`String|Object`)
The criteria used to find a List Repeater instance.
- If a `string` is provided, it is treated as the List Repeater `name`.
- If an `object` is provided, it is used as a set of key/value filters to match against existing repeaters.
- If omitted, the first available List Repeater instance will be returned.
🧰 Tools
🪛 markdownlint-cli2 (0.17.2)

239-239: Unordered list indentation
Expected: 2; Actual: 0

(MD007, ul-indent)


241-241: Unordered list indentation
Expected: 4; Actual: 2

(MD007, ul-indent)


242-242: Unordered list indentation
Expected: 4; Actual: 2

(MD007, ul-indent)


243-243: Unordered list indentation
Expected: 4; Actual: 2

(MD007, ul-indent)


245-245: Unordered list indentation
Expected: 2; Actual: 0

(MD007, ul-indent)


247-247: Unordered list indentation
Expected: 4; Actual: 2

(MD007, ul-indent)

🤖 Prompt for AI Agents
In docs/API/helpers/dynamic-components.md around lines 239 to 247, the nested
list items under the “filter” and “options” bullets are not indented correctly
for MD007; update the markdown so each nested bullet (the three sub-bullets
under filter and the ts default line under options) is indented by two
additional spaces relative to its parent list item, ensuring consistent
indentation for nested lists and passing the MD007 rule.

Comment on lines +387 to +395
### Events and Hooks

The List Repeater also emits hooks that can be listened to:

- `listRepeaterRowReady` – Fired when a row is first rendered.
- `listRepeaterRowUpdated` – Fired when a row is updated.
- `repeaterDataRetrieved` – Fired after data has been loaded.
- `repeaterDataRetrieveError` – Fired if data loading fails.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick (assertive)

Specify hook payload shapes for List Repeater events.

List event names are listed without payload contracts. Add minimal payload fields to improve DX and prevent guesswork.

Proposed addition (example):

  • listRepeaterRowReady{ repeater, row, index }
  • listRepeaterRowUpdated{ repeater, row, changes }
  • repeaterDataRetrieved{ repeater, rows, pagination }
  • repeaterDataRetrieveError{ repeater, error }
🧰 Tools
🪛 markdownlint-cli2 (0.17.2)

391-391: Unordered list indentation
Expected: 2; Actual: 0

(MD007, ul-indent)


392-392: Unordered list indentation
Expected: 2; Actual: 0

(MD007, ul-indent)


393-393: Unordered list indentation
Expected: 2; Actual: 0

(MD007, ul-indent)


394-394: Unordered list indentation
Expected: 2; Actual: 0

(MD007, ul-indent)

🤖 Prompt for AI Agents
In docs/API/helpers/dynamic-components.md around lines 387 to 395, the List
Repeater event list lacks payload contracts; update the docs to include minimal
payload shapes for each event to improve DX: specify that listRepeaterRowReady
emits { repeater, row, index }, listRepeaterRowUpdated emits { repeater, row,
changes }, repeaterDataRetrieved emits { repeater, rows, pagination }, and
repeaterDataRetrieveError emits { repeater, error }; add these payload examples
as bullet points directly under each event name and keep descriptions concise.

Comment on lines +391 to +404
- `listRepeaterRowReady` – Fired when a row is first rendered.
- `listRepeaterRowUpdated` – Fired when a row is updated.
- `repeaterDataRetrieved` – Fired after data has been loaded.
- `repeaterDataRetrieveError` – Fired if data loading fails.

### Example

```js
Fliplet.Hooks.on('listRepeaterRowReady', function(event) {
console.log('Row ready:', event.row);
});
```


Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick (assertive)

Remove consecutive blank lines.

Multiple MD012 violations here. Keep a single blank line between paragraphs/sections.

I can submit a follow-up formatting patch across the file if helpful.

🧰 Tools
🪛 markdownlint-cli2 (0.17.2)

391-391: Unordered list indentation
Expected: 2; Actual: 0

(MD007, ul-indent)


392-392: Unordered list indentation
Expected: 2; Actual: 0

(MD007, ul-indent)


393-393: Unordered list indentation
Expected: 2; Actual: 0

(MD007, ul-indent)


394-394: Unordered list indentation
Expected: 2; Actual: 0

(MD007, ul-indent)


396-396: Multiple headings with the same content

(MD024, no-duplicate-heading)


404-404: Multiple consecutive blank lines
Expected: 1; Actual: 2

(MD012, no-multiple-blanks)

🤖 Prompt for AI Agents
In docs/API/helpers/dynamic-components.md around lines 391 to 404 there are
consecutive blank lines creating MD012 lint violations; remove extra blank lines
so that only a single blank line separates paragraphs/sections (ensure the list
of events, the "Example" heading and the code block each have exactly one blank
line between them) and save the file.

Comment on lines +468 to +477
### `Fliplet.RecordContainer.getAll()`

```js
Fliplet.RecordContainer.getAll(filter)
```
Return **all** Record Container instances, optionally filtered.

**Parameters**

- **filter** `String|Object` (optional) — if omitted, returns **all** instances.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick (assertive)

Align heading and signature for RecordContainer.getAll.

Heading shows no params; signature and text mention filter. Make them consistent.

Apply:

-### `Fliplet.RecordContainer.getAll()`
+### `Fliplet.RecordContainer.getAll(filter)`
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
### `Fliplet.RecordContainer.getAll()`
```js
Fliplet.RecordContainer.getAll(filter)
```
Return **all** Record Container instances, optionally filtered.
**Parameters**
- **filter** `String|Object` (optional) — if omitted, returns **all** instances.
### `Fliplet.RecordContainer.getAll(filter)`
🧰 Tools
🪛 markdownlint-cli2 (0.17.2)

472-472: Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)


475-475: Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


477-477: Unordered list indentation
Expected: 2; Actual: 0

(MD007, ul-indent)

🤖 Prompt for AI Agents
In docs/API/helpers/dynamic-components.md around lines 468 to 477, the heading
and signature for RecordContainer.getAll are inconsistent: the heading implies
no parameters while the signature and description mention an optional filter.
Update the heading and surrounding text to consistently indicate that getAll
accepts an optional filter parameter (String|Object), or remove the filter
mention from the signature/description—preferably change the heading to include
the signature/parameters and ensure the parameters list documents the optional
filter type and behavior.

Comment on lines +494 to +501
- **id** `Number` — Instance id.
- **name** `String` — Instance name.
- **parent** `DynamicContainer` — Parent Dynamic Container instance. Use `parent.connection()` to access the Data Source.
- **entry** `Object|undefined` — The currently loaded data entry (e.g., `{ id, data, ... }`).
- **dataSourceId** `Number|undefined` — Data Source id (set after init).
- **isLoading** `Boolean` — Loading state.
- **error** `Any|undefined` — Last load error (if any).

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick (assertive)

Clarify parent type and usage for Record Container.

State parent: Container (Dynamic Container instance) for consistency with the earlier section, and add a short note “Use await parent.connection() to access the Data Source”.

Proposed copy tweak:

-- **parent** `DynamicContainer` — Parent Dynamic Container instance. Use `parent.connection()` to access the Data Source.
+- **parent** `Container` — Parent Dynamic Container instance. Use `await parent.connection()` to access the Data Source.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- **id** `Number` — Instance id.
- **name** `String` — Instance name.
- **parent** `DynamicContainer` — Parent Dynamic Container instance. Use `parent.connection()` to access the Data Source.
- **entry** `Object|undefined` — The currently loaded data entry (e.g., `{ id, data, ... }`).
- **dataSourceId** `Number|undefined` — Data Source id (set after init).
- **isLoading** `Boolean` — Loading state.
- **error** `Any|undefined` — Last load error (if any).
- **id** `Number` — Instance id.
- **name** `String` — Instance name.
- **parent** `Container` — Parent Dynamic Container instance. Use `await parent.connection()` to access the Data Source.
- **entry** `Object|undefined` — The currently loaded data entry (e.g., `{ id, data, ... }`).
- **dataSourceId** `Number|undefined` — Data Source id (set after init).
- **isLoading** `Boolean` — Loading state.
- **error** `Any|undefined` — Last load error (if any).
🧰 Tools
🪛 markdownlint-cli2 (0.17.2)

494-494: Unordered list indentation
Expected: 2; Actual: 0

(MD007, ul-indent)


495-495: Unordered list indentation
Expected: 2; Actual: 0

(MD007, ul-indent)


496-496: Unordered list indentation
Expected: 2; Actual: 0

(MD007, ul-indent)


497-497: Unordered list indentation
Expected: 2; Actual: 0

(MD007, ul-indent)


498-498: Unordered list indentation
Expected: 2; Actual: 0

(MD007, ul-indent)


499-499: Unordered list indentation
Expected: 2; Actual: 0

(MD007, ul-indent)


500-500: Unordered list indentation
Expected: 2; Actual: 0

(MD007, ul-indent)

🤖 Prompt for AI Agents
In docs/API/helpers/dynamic-components.md around lines 494 to 501, update the
`parent` entry to state `parent: Container` (Dynamic Container instance) for
consistency with the earlier section and change the usage note to "Use `await
parent.connection()` to access the Data Source" so the doc clarifies the correct
type and that connection() is async.

Comment on lines +572 to +577
### 2) Subscribe to live updates for the current entry
```js
Fliplet.RecordContainer.get('UserRecord').then(async recordContainer => {
const conn = await recordContainer.parent.connection();
recordContainer.setupDataSubscription(conn);
});
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Undocumented method recordContainer.setupDataSubscription(conn).

This is used in an example but not documented in the API. Add a method section with signature, purpose, and return (unsubscribe or void), and whether it auto-cleans on destroy.

Add:

+#### `recordContainer.setupDataSubscription(connection)`
+Sets up live updates for the current entry. Returns an unsubscribe handle.
+```js
+const unsub = recordContainer.setupDataSubscription(conn);
+// later...
+unsub && unsub();
+```
🧰 Tools
🪛 markdownlint-cli2 (0.17.2)

572-572: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below

(MD022, blanks-around-headings)


573-573: Fenced code blocks should be surrounded by blank lines

(MD031, blanks-around-fences)

🤖 Prompt for AI Agents
In docs/API/helpers/dynamic-components.md around lines 572 to 577, add
documentation for the undocumented method
recordContainer.setupDataSubscription(conn): describe the method signature
(recordContainer.setupDataSubscription(connection): Function | void), state its
purpose (subscribe the record container to live updates from the provided
connection and apply incoming changes to the container), indicate its return
value (returns an unsubscribe function when subscription is established,
otherwise undefined), specify lifecycle behavior (subscription is automatically
removed on recordContainer.destroy(), but callers may call the returned
unsubscribe to stop earlier), and include the usage example showing assignment
and later call to unsub if present (const unsub =
recordContainer.setupDataSubscription(conn); // later... unsub && unsub();).

Copy link
Contributor

@veljko7 veljko7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants