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

[WIP & Experimental] fix: prevent memory bloat in associations when searchable is set to false #2646

Closed
wants to merge 13 commits into from

Conversation

Paul-Bob
Copy link
Contributor

@Paul-Bob Paul-Bob commented Mar 29, 2024

Description

This is just a POC of hotwire_combobox implementation to replace the attach modal select.

Can be intersting to implement hotwire_combobox on belongs to field and replace every select / searchable interface with hotwire_combobox.

As a con hotwire_combobox have dependency on rails 7 which breaks avo support for rails lower than 7.

Fixes #2406

Screen.Recording.2024-03-29.at.17.04.32.mov

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works

Screenshots & recording

Manual review steps

  1. Step 1
  2. Step 2

Manual reviewer: please leave a comment with output from the test if that's the case.

@Paul-Bob Paul-Bob self-assigned this Mar 29, 2024
@Paul-Bob Paul-Bob marked this pull request as draft March 29, 2024 15:18
app/javascript/js/application.js Outdated Show resolved Hide resolved
app/javascript/js/application.js Outdated Show resolved Hide resolved
app/javascript/js/application.js Outdated Show resolved Hide resolved
Copy link

codeclimate bot commented Mar 29, 2024

Code Climate has analyzed commit a321956 and detected 0 issues on this pull request.

View more on Code Climate.

Paul-Bob and others added 3 commits April 1, 2024 13:39
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@Paul-Bob
Copy link
Contributor Author

Paul-Bob commented Apr 1, 2024

Commented tests need refactor to test scenarios with hotwire_combobox

Comment on lines 45 to +49
def new
@resource.hydrate(record: @record)
end

def options
Copy link
Contributor Author

Choose a reason for hiding this comment

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

To increase performance we can serialize and encrypt the query and pass from new to options through params avoiding the query compute on each options request.

spec/system/avo/has_one_field_name_spec.rb Show resolved Hide resolved
spec/system/avo/has_one_field_name_spec.rb Show resolved Hide resolved
spec/system/avo/has_one_field_name_spec.rb Show resolved Hide resolved
spec/system/avo/has_one_field_name_spec.rb Show resolved Hide resolved
spec/system/avo/has_one_field_name_spec.rb Show resolved Hide resolved
spec/system/avo/has_one_field_name_spec.rb Show resolved Hide resolved
spec/system/avo/has_one_field_name_spec.rb Show resolved Hide resolved
spec/system/avo/has_one_field_name_spec.rb Show resolved Hide resolved
spec/system/avo/has_one_field_name_spec.rb Show resolved Hide resolved
spec/system/avo/has_one_field_name_spec.rb Show resolved Hide resolved
@adrianthedev
Copy link
Collaborator

Closing to keep the PR list clean.

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

Successfully merging this pull request may close these issues.

Prevent memory bloat in associations when searchable is set to false
2 participants