Remove interim `Tag` in Component render pipeline

Ouverte
#7,618 1 commentaire 0 réactions 0 personnes assignées Voir sur GitHub

Les mainteneurs répondent en général sous 1 jour

Personne n'a encore pris cette issue.

Évaluation

Difficulté
5/5
Temps estimé
Plus d'une semaine
Accessibilité débutants
25/100
Type d'issue
Refactorisation
Clarté
Clairement spécifiée
Activité
Active
Stack technique
javascript, python, react

Piste de recherche

Start with packages/reflex-base/src/reflex_base/components/component.py and trace how compiler templates consume the render dict. The issue also names packages/reflex-base/src/reflex_base/components/tags/ and related work #6235 and #6214 as context. Done means rendering produces a Var for the jsx(...) call, compiler templates consume it, and the deprecation path for _render() overrides is addressed.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

roadmap

Summary

Component._render() returns a Tag, and Component.render() turns it into a render dict that the compiler templates serialize into JSX. Replace that interim stage: Component.render() returns a Var representing the jsx(...) function call, and the Var carries the hooks, imports and app wraps the component requires through its VarData. This is a breaking change for code that subclasses the render path.

Why

  • A rendered component becomes an ordinary value in the Var system, so a component can appear wherever a Var is accepted (props, cond/match/foreach branches, memo returns) without the special-cased Component-to-Var conversion, which today drops part of the VarData (Linear ENG-9593).
  • The Tag/render-dict stage is an untyped dict between Python objects and emitted JS. Collapsing it removes a layer the single-pass compiler (#6235) has to walk and lets a _get_var_data()-style collection replace the separate hooks, app wraps, imports and custom-code paths on Component.
  • Immutable components (#6214) already treat a component as a value; rendering to a Var is the matching output side.

Scope

  • Component._render() / Component.render() produce a Var for the jsx call instead of a CommonTag / render dict (packages/reflex-base/src/reflex_base/components/component.py).
  • packages/reflex-base/src/reflex_base/components/tags/ is removed, or kept as an internal helper for the deprecation window only.
  • Compiler templates consume the rendered Var instead of the render dict.
  • Deprecation path for components that override _render() to return a Tag.

Related

  • #6235 Single Pass Compiler: Tracking Issue
  • #6214 Single-pass compiler: Make Component effectively immutable
Langage dominant
Python
Étoiles
29k
Forks
1.8k
Merge moyen
2 j 22 h
PR mergées (30 j)
143

Préparer son environnement

Ouvrir dans Codespaces

Lance le conteneur de développement du projet dans votre navigateur, avec votre propre compte GitHub.

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de reflex-dev/reflex

Toutes les issues de reflex-dev/reflex

Issues similaires

Plus d'issues Python

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.