Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow lazy as an option for select fields using contenttype-queries #3485

Merged
merged 4 commits into from
Oct 13, 2023

Conversation

xiaohutai
Copy link
Member

What this does

Allows the use of lazy: true for contenttype-queries on select fields. Potentially useful on sites that have a lot of records that need to be processed before rendering the template/response. This is a proof-of-concept for now. I've chosen an opt-in method since this will be very niche, and we will have to see whether we get the gains, or not.

selected_pages:
    type: select
    label: "Select Pages"
    values: "pages/{contenttype} Nº{id}: {title} - {status}"
    autocomplete: true
    multiple: true
    limit: 1000
    variant: inline
+   lazy: true

Issues

When components get initialized (mounted), they will each query the server for the list of options. This is to ensure that the selected values are properly selected and shown in the UI. The problem stems that they will do so simultaneously. After that the response will be stored in the cache.

  • How to remake a proper Field instance from a bunch of strings?
  • How to cache both client-side and server-side?
  • What is the proper permission for the Async route?

@xiaohutai xiaohutai changed the title [WIP] Allow lazy as an option for select fields using contenttype-queries Allow lazy as an option for select fields using contenttype-queries Oct 13, 2023
Copy link
Member

@bobdenotter bobdenotter left a comment

Choose a reason for hiding this comment

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

Whoop, whoop, let's roll!

@bobdenotter bobdenotter merged commit 7b12b2c into bolt:master Oct 13, 2023
16 of 24 checks passed
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