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

[REF-889] useContext per substate #2149

Merged
merged 36 commits into from
Nov 21, 2023
Merged

Commits on Nov 7, 2023

  1. Each substate has its own context

    Var has _var_hooks and _var_imports
    
    Instead of relying on the page/component having
    the appropriate imports statically, allow these to
    be dynamically calculated for greater flexibility
    masenf committed Nov 7, 2023
    Configuration menu
    Copy the full SHA
    27cd95c View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    be6fa14 View commit details
    Browse the repository at this point in the history
  3. Use _var_data throughout

    Ensure that adding additional Var metadata in the
    future does not require lots of changes everywhere,
    by placing all carryable metadata into _var_data
    masenf committed Nov 7, 2023
    Configuration menu
    Copy the full SHA
    139c01a View commit details
    Browse the repository at this point in the history
  4. Account for all imports and hooks where they are used

    Remove all* default imports for a page, instead relying
    on the components and vars that use a particular
    import to name it explicitly with an ImportVar
    
    Remove hardcoded hooks, instead format these in for
    components that depend on them.
    
    Move ImportVar to reflex.utils.imports so it can live
    next to the ImportDict and avoid circular import with
    reflex.vars
    masenf committed Nov 7, 2023
    Configuration menu
    Copy the full SHA
    9c81f8a View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    e8de0e9 View commit details
    Browse the repository at this point in the history
  6. Fixup tests

    masenf committed Nov 7, 2023
    Configuration menu
    Copy the full SHA
    27f527c View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    da6a367 View commit details
    Browse the repository at this point in the history

Commits on Nov 8, 2023

  1. Configuration menu
    Copy the full SHA
    c9ebed4 View commit details
    Browse the repository at this point in the history
  2. Cond var must be _var_is_local=False

    It needs to render with curly braces wrapped around it
    masenf committed Nov 8, 2023
    Configuration menu
    Copy the full SHA
    aa574e5 View commit details
    Browse the repository at this point in the history
  3. Component: do not mutate event_triggers

    Instead avoid rendering triggers in Component.render,
    but otherwise leave them alone so that components
    may be rendered multiple times without changing the
    output.
    masenf committed Nov 8, 2023
    Configuration menu
    Copy the full SHA
    846fe51 View commit details
    Browse the repository at this point in the history
  4. Fixup static issues

    masenf committed Nov 8, 2023
    Configuration menu
    Copy the full SHA
    b9960d3 View commit details
    Browse the repository at this point in the history

Commits on Nov 9, 2023

  1. Configuration menu
    Copy the full SHA
    4b63a8b View commit details
    Browse the repository at this point in the history

Commits on Nov 13, 2023

  1. client_side_routing: use rx.cond instead of the Cond component

    Using `rx.cond` helper ensures that the condition carries the `isTrue` import.
    masenf committed Nov 13, 2023
    Configuration menu
    Copy the full SHA
    5157ed2 View commit details
    Browse the repository at this point in the history
  2. Fixup color_mode_toggle var

    Do not surround the formatted values with extra curly braces
    masenf committed Nov 13, 2023
    Configuration menu
    Copy the full SHA
    06d8fa2 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    4afd4e8 View commit details
    Browse the repository at this point in the history

Commits on Nov 14, 2023

  1. Configuration menu
    Copy the full SHA
    34c3c2c View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    a29ca2e View commit details
    Browse the repository at this point in the history

Commits on Nov 15, 2023

  1. Add tests for Component._get_vars

    Ensure that Vars used in different contexts in a Component are correctly
    identified and returned.
    masenf committed Nov 15, 2023
    Configuration menu
    Copy the full SHA
    78ddc79 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    62b9332 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    454226f View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    a356bcb View commit details
    Browse the repository at this point in the history

Commits on Nov 19, 2023

  1. Configuration menu
    Copy the full SHA
    9329e18 View commit details
    Browse the repository at this point in the history
  2. cond: Carry VarData before format_cond

    `format_cond` doesn't really work with f-string semantics due to a blind `{`,
    `}` removal which breaks the JSON-encoding of VarData. So instead, we carry the
    VarData explicitly on the cond_var and change `format_cond` to `str` the Var
    before formatting to ensure it does not emit a VarData-encoded f-string.
    masenf committed Nov 19, 2023
    Configuration menu
    Copy the full SHA
    90159b0 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    1ee5702 View commit details
    Browse the repository at this point in the history
  4. Update pyi files

    masenf committed Nov 19, 2023
    Configuration menu
    Copy the full SHA
    1ef7dee View commit details
    Browse the repository at this point in the history

Commits on Nov 21, 2023

  1. Configuration menu
    Copy the full SHA
    006ca66 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    3c54c66 View commit details
    Browse the repository at this point in the history
  3. remove weird indentation

    masenf committed Nov 21, 2023
    Configuration menu
    Copy the full SHA
    475694b View commit details
    Browse the repository at this point in the history
  4. cond: remove unnecessary elif

    masenf committed Nov 21, 2023
    Configuration menu
    Copy the full SHA
    0f36629 View commit details
    Browse the repository at this point in the history
  5. remove relative imports

    masenf committed Nov 21, 2023
    Configuration menu
    Copy the full SHA
    96b6090 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    70cb517 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    569ff86 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    00d137e View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    bf385fb View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    2230d10 View commit details
    Browse the repository at this point in the history
  11. Performance optimizations

    * Do not cast to Style() early in `Component.add_style`
    * Memoize return value of `Component._get_vars`
    * Defer `VarData.merge` for most operations -- call it once
    * Avoid `serializers.serialize` for primitive JSON types
    masenf committed Nov 21, 2023
    Configuration menu
    Copy the full SHA
    1d78788 View commit details
    Browse the repository at this point in the history