Skip to content

remove IDOM_FEATURE_INDEX_AS_DEFAULT_KEY opt #840

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

Merged
merged 1 commit into from
Nov 23, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion docs/source/about/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ more info, see the :ref:`Contributor Guide <Creating a Changelog Entry>`.
Unreleased
----------

No changes.
**Removed**

- :pull:`840` - remove ``IDOM_FEATURE_INDEX_AS_DEFAULT_KEY`` option


v0.41.0
Expand Down
16 changes: 0 additions & 16 deletions src/idom/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,22 +62,6 @@
)
"""This has been renamed to :data:`IDOM_WEB_MODULES_DIR`"""

IDOM_FEATURE_INDEX_AS_DEFAULT_KEY = _Option(
"IDOM_FEATURE_INDEX_AS_DEFAULT_KEY",
default=True,
mutable=False,
validator=lambda x: bool(int(x)),
)
"""Use the index of elements/components amongst their siblings as the default key.

The flag's default value is set to true. To return to legacy behavior set
``IDOM_FEATURE_INDEX_AS_DEFAULT_KEY=0``. In a future release, this flag will be removed
entirely and the indices will always be the default key.

For more information on changes to this feature flag see:
https://github.com/idom-team/idom/issues/351
"""

IDOM_TESTING_DEFAULT_TIMEOUT = _Option(
"IDOM_TESTING_DEFAULT_TIMEOUT",
5.0,
Expand Down
19 changes: 2 additions & 17 deletions src/idom/core/layout.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,7 @@
from uuid import uuid4
from weakref import ref as weakref

from idom.config import (
IDOM_CHECK_VDOM_SPEC,
IDOM_DEBUG_MODE,
IDOM_FEATURE_INDEX_AS_DEFAULT_KEY,
)
from idom.config import IDOM_CHECK_VDOM_SPEC, IDOM_DEBUG_MODE
from idom.utils import Ref

from ._event_proxy import _wrap_in_warning_event_proxies
Expand Down Expand Up @@ -755,7 +751,7 @@ def _process_child_type_and_key(
key = None

if key is None:
key = _default_key(index)
key = index

yield (child, child_type, key)

Expand All @@ -765,14 +761,3 @@ def _process_child_type_and_key(
_DICT_TYPE = _ElementType(1)
_COMPONENT_TYPE = _ElementType(2)
_STRING_TYPE = _ElementType(3)


if IDOM_FEATURE_INDEX_AS_DEFAULT_KEY.current:

def _default_key(index: int) -> Any:
return index

else:

def _default_key(index: int) -> Any: # pragma: no cover
return object()