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

fix(ui): improve editor performance and fix Submit button. Fixes #13892 #13915

Merged
merged 2 commits into from
Nov 22, 2024

Commits on Nov 17, 2024

  1. fix(ui): improve editor performance and fix Submit button. Fixes argo…

    …proj#1382
    
    The `<ObjectEditor>` component used by all the edit pages encapsulates
    the logic for serializing/deserializing the object being edited, but
    it's extremely inefficient. For example, if you're editing a
    `WorkflowTemplate`, every single keystroke will cause `parse()` to be
    called twice and `stringify()` to be called 4 times. For large
    documents, this serializatino/deserialization overhead adds up quickly.
    
    Additionally, the "Submit" button is sometimes incorrectly grayed out,
    e.g. after clicking the "Update" button. This is happening because
    `useEditableObject()` is using reference comparisons on the object being
    edited, since it doesn't have access to the serialized string version
    encapsulated by `<ObjectEditor>`.
    
    This decouples `<ObjectEditor>` from serialization/deseralization and
    lifts the state involved up to the `useEditableObject()` hook, as
    discussed in
    argoproj#13593 (comment).
    Doing so eliminates unnecessary serialization/deseralization: now, if
    you're editing a `WorkflowTemplate`, each keystroke will only call
    `parse()` once and won't call `stringify()` at all. This also fixes
    issues with the Submit button not reflecting the current page state,
    since `useEditableObject()` now uses string comparisons instead of ref
    comparisons.
    
    Signed-off-by: Mason Malone <[email protected]>
    MasonM committed Nov 17, 2024
    Configuration menu
    Copy the full SHA
    60b91ba View commit details
    Browse the repository at this point in the history

Commits on Nov 19, 2024

  1. Merge branch 'main' into fix-13892-2

    Signed-off-by: Mason Malone <[email protected]>
    MasonM committed Nov 19, 2024
    Configuration menu
    Copy the full SHA
    d92bfa2 View commit details
    Browse the repository at this point in the history