mirror of
https://github.com/django-components/django-components.git
synced 2025-09-26 07:29:09 +00:00
refactor: change repo name and URL after org migration (#924)
This commit is contained in:
parent
ace9194733
commit
92f5497c74
34 changed files with 134 additions and 119 deletions
|
@ -236,7 +236,7 @@ class ComponentsSettings(NamedTuple):
|
|||
> From v0.67 to v0.78 (incl) the default value was `"isolated"`.
|
||||
>
|
||||
> For v0.79 and later, the default is again `"django"`. See the rationale for change
|
||||
> [here](https://github.com/EmilStenstrom/django-components/issues/498).
|
||||
> [here](https://github.com/django-components/django-components/issues/498).
|
||||
"""
|
||||
|
||||
dynamic_component_name: Optional[str] = None
|
||||
|
|
|
@ -21,7 +21,7 @@ class ComponentsConfig(AppConfig):
|
|||
|
||||
# NOTE: This monkeypatch is applied here, before Django processes any requests.
|
||||
# To make django-components work with django-debug-toolbar-template-profiler
|
||||
# See https://github.com/EmilStenstrom/django-components/discussions/819
|
||||
# See https://github.com/django-components/django-components/discussions/819
|
||||
monkeypatch_template_cls(Template)
|
||||
|
||||
# Import modules set in `COMPONENTS.libraries` setting
|
||||
|
@ -31,7 +31,7 @@ class ComponentsConfig(AppConfig):
|
|||
autodiscover()
|
||||
|
||||
# Auto-reload Django dev server when any component files changes
|
||||
# See https://github.com/EmilStenstrom/django-components/discussions/567#discussioncomment-10273632
|
||||
# See https://github.com/django-components/django-components/discussions/567#discussioncomment-10273632
|
||||
if app_settings.RELOAD_ON_FILE_CHANGE:
|
||||
_watch_component_files_for_autoreload()
|
||||
|
||||
|
@ -56,7 +56,7 @@ class ComponentsConfig(AppConfig):
|
|||
registry.register(app_settings.DYNAMIC_COMPONENT_NAME, DynamicComponent)
|
||||
|
||||
|
||||
# See https://github.com/EmilStenstrom/django-components/issues/586#issue-2472678136
|
||||
# See https://github.com/django-components/django-components/issues/586#issue-2472678136
|
||||
def _watch_component_files_for_autoreload() -> None:
|
||||
from django_components.util.loader import get_component_dirs
|
||||
|
||||
|
|
|
@ -981,12 +981,12 @@ class Component(
|
|||
|
||||
# Allow to provide a dict instead of Context
|
||||
# NOTE: This if/else is important to avoid nested Contexts,
|
||||
# See https://github.com/EmilStenstrom/django-components/issues/414
|
||||
# See https://github.com/django-components/django-components/issues/414
|
||||
if not isinstance(context, Context):
|
||||
context = RequestContext(request, context) if request else Context(context)
|
||||
|
||||
# Required for compatibility with Django's {% extends %} tag
|
||||
# See https://github.com/EmilStenstrom/django-components/pull/859
|
||||
# See https://github.com/django-components/django-components/pull/859
|
||||
context.render_context.push({BLOCK_CONTEXT_KEY: context.render_context.get(BLOCK_CONTEXT_KEY, {})})
|
||||
|
||||
# By adding the current input to the stack, we temporarily allow users
|
||||
|
@ -1045,7 +1045,7 @@ class Component(
|
|||
_COMPONENT_SLOT_CTX_CONTEXT_KEY: component_slot_ctx,
|
||||
_REGISTRY_CONTEXT_KEY: self.registry,
|
||||
# NOTE: Public API for variables accessible from within a component's template
|
||||
# See https://github.com/EmilStenstrom/django-components/issues/280#issuecomment-2081180940
|
||||
# See https://github.com/django-components/django-components/issues/280#issuecomment-2081180940
|
||||
"component_vars": ComponentVars(
|
||||
is_filled=is_filled,
|
||||
),
|
||||
|
@ -1400,8 +1400,8 @@ def _prepare_template(
|
|||
with context.update(context_data):
|
||||
# Associate the newly-created Context with a Template, otherwise we get
|
||||
# an error when we try to use `{% include %}` tag inside the template?
|
||||
# See https://github.com/EmilStenstrom/django-components/issues/580
|
||||
# And https://github.com/EmilStenstrom/django-components/issues/634
|
||||
# See https://github.com/django-components/django-components/issues/580
|
||||
# And https://github.com/django-components/django-components/issues/634
|
||||
template = component._get_template(context)
|
||||
|
||||
if not is_template_cls_patched(template):
|
||||
|
@ -1414,7 +1414,7 @@ def _prepare_template(
|
|||
|
||||
# Set `Template._djc_is_component_nested` based on whether we're currently INSIDE
|
||||
# the `{% extends %}` tag.
|
||||
# Part of fix for https://github.com/EmilStenstrom/django-components/issues/508
|
||||
# Part of fix for https://github.com/django-components/django-components/issues/508
|
||||
# See django_monkeypatch.py
|
||||
template._djc_is_component_nested = bool(context.render_context.get(BLOCK_CONTEXT_KEY))
|
||||
|
||||
|
|
|
@ -738,7 +738,7 @@ def _resolve_component_relative_files(
|
|||
if isinstance(filepath, str):
|
||||
filepath_abs = os.path.join(comp_dir_abs, filepath)
|
||||
# NOTE: The paths to resources need to use POSIX (forward slashes) for Django to wor
|
||||
# See https://github.com/EmilStenstrom/django-components/issues/796
|
||||
# See https://github.com/django-components/django-components/issues/796
|
||||
filepath_rel_to_comp_dir = Path(os.path.join(comp_dir_rel, filepath)).as_posix()
|
||||
|
||||
if os.path.isfile(filepath_abs):
|
||||
|
|
|
@ -23,7 +23,7 @@ def make_isolated_context_copy(context: Context) -> Context:
|
|||
copy_forloop_context(context, context_copy)
|
||||
|
||||
# Required for compatibility with Django's {% extends %} tag
|
||||
# See https://github.com/EmilStenstrom/django-components/pull/859
|
||||
# See https://github.com/django-components/django-components/pull/859
|
||||
context_copy.render_context = context.render_context
|
||||
|
||||
# Pass through our internal keys
|
||||
|
|
|
@ -135,7 +135,7 @@ class NodeMeta(type):
|
|||
# # {'data-id': 1}
|
||||
# ```
|
||||
#
|
||||
# See https://github.com/EmilStenstrom/django-components/discussions/900#discussioncomment-11859970
|
||||
# See https://github.com/django-components/django-components/discussions/900#discussioncomment-11859970
|
||||
resolved_params_without_invalid_kwargs = []
|
||||
invalid_kwargs = {}
|
||||
did_see_special_kwarg = False
|
||||
|
|
|
@ -436,7 +436,7 @@ class SlotNode(BaseNode):
|
|||
# Required for compatibility with Django's {% extends %} tag
|
||||
# This makes sure that the render context used outside of a component
|
||||
# is the same as the one used inside the slot.
|
||||
# See https://github.com/EmilStenstrom/django-components/pull/859
|
||||
# See https://github.com/django-components/django-components/pull/859
|
||||
render_ctx_layer = used_ctx.render_context.dicts[-2] if len(used_ctx.render_context.dicts) > 1 else {}
|
||||
with used_ctx.render_context.push(render_ctx_layer):
|
||||
# Render slot as a function
|
||||
|
|
|
@ -60,7 +60,7 @@ def monkeypatch_template_render(template_cls: Type[Template]) -> None:
|
|||
# Modify `Template.render` to set `isolated_context` kwarg of `push_state`
|
||||
# based on our custom `Template._djc_is_component_nested`.
|
||||
#
|
||||
# Part of fix for https://github.com/EmilStenstrom/django-components/issues/508
|
||||
# Part of fix for https://github.com/django-components/django-components/issues/508
|
||||
#
|
||||
# NOTE 1: While we could've subclassed Template, then we would need to either
|
||||
# 1) ask the user to change the backend, so all templates are of our subclass, or
|
||||
|
|
|
@ -184,7 +184,7 @@ def get_component_files(suffix: Optional[str] = None) -> List[ComponentFileEntry
|
|||
# For for apps, the directories may be outside of the project, e.g. in case of third party
|
||||
# apps. So we have to resolve the python import path relative to the package name / the root
|
||||
# import path for the app.
|
||||
# See https://github.com/EmilStenstrom/django-components/issues/669
|
||||
# See https://github.com/django-components/django-components/issues/669
|
||||
for conf in apps.get_app_configs():
|
||||
for app_dir in app_settings.APP_DIRS:
|
||||
comps_path = Path(conf.path).joinpath(app_dir)
|
||||
|
|
|
@ -16,7 +16,7 @@ from django_components.expression import process_aggregate_kwargs
|
|||
from django_components.util.tag_parser import TagAttr, parse_tag
|
||||
|
||||
|
||||
# For details see https://github.com/EmilStenstrom/django-components/pull/902#discussion_r1913611633
|
||||
# For details see https://github.com/django-components/django-components/pull/902#discussion_r1913611633
|
||||
# and following comments
|
||||
def validate_params(
|
||||
tag: str,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue