[2.0.0-rc1] Remove TODOs and obsolete stuff

Created on 11 December 2024, 11 months ago

Problem/Motivation

Some obsolete stuff according to Christian:

  • Move this hook function ui_patterns_field_config_delete(FieldConfigInterface $field_config): void TO ::UiPatternsEntitySchemaSubscriber
  • Remove ui_patterns_plugin_filter_block__ui_patterns_alter ?
  • Remove ui_patterns_test_theme. I think we don't need it anymore ?
  • Remove test components alert, close_button, prop_types_tests ?
  • Remove ui-patterns-actions.html.twig ?

Some TODO following πŸ“Œ [2.0.0-rc1] Remove temporary compatibilty layers Active :

$ grep -ir "todo" src/
src/Form/ComponentFormBuilderTrait.php:    // @todo This highlights the link between a configuration key and a form
src/SourcePluginBase.php:    // @todo select the shortest conversion path?
src/SourcePluginBase.php:   * @todo use NestedArray::mergeDeep ?
src/Element/ComponentFormBase.php:    // @todo better organize sources in groups.
src/Element/ComponentElementAlter.php:   * @todo Move this to Drupal Core.
src/Element/ComponentElementBuilder.php:    /* @todo Performance issue...
src/Plugin/UiPatterns/PropType/LinksPropType.php:        // @todo System path is deprecated - use the route name and parameters.
src/Plugin/UiPatterns/DerivableContext/EntityReferencedDerivableContext.php:    // @todo better implementation with service 'entity_type.bundle.info'
src/Plugin/UiPatterns/Source/TextfieldWidget.php:    // @todo change when issue https://www.drupal.org/project/drupal/issues/2633550 is fixed.
src/SourcePluginManager.php:    // @todo use a method of the plugin instead?

$ grep -ir "todo" modules/
modules/ui_patterns_views/src/ViewsPluginUiPatternsTrait.php:    // @todo better implementation with service 'entity_type.bundle.info'
modules/ui_patterns_field_formatters/src/Plugin/UiPatterns/Source/FieldFormatterSource.php:    // @todo remove ui patterns formatters from the list of options ?
modules/ui_patterns_field_formatters/src/Plugin/UiPatterns/Source/FieldFormatterSource.php:    // @todo Ensure it is right to empty all values here, see:
modules/ui_patterns_field_formatters/src/Plugin/Field/FieldFormatter/ComponentFormatterBase.php:    // @todo better implementation with service 'entity_type.bundle.info'
modules/ui_patterns_field_formatters/src/Plugin/Field/FieldFormatter/ComponentFormatterBase.php:    // @todo does this really makes sense to propagate the externally injected context

Which ones can you safely do before 2.0.0?

Proposed resolution

Remove what can be removed. Be careful.

πŸ“Œ Task
Status

Active

Version

2.0

Component

Code

Created by

πŸ‡«πŸ‡·France pdureau Paris

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @pdureau
  • πŸ‡«πŸ‡·France pdureau Paris
  • πŸ‡«πŸ‡·France pdureau Paris

    Mikael, can you have a look before Christian do it? (You may also take it if Christian is busy)

  • πŸ‡«πŸ‡·France pdureau Paris

    Can we also remove this from ComponentElementBuilder::buildProp() ?

        if (empty($data) && $prop_type->getPluginId() !== 'attributes') {
          // For JSON Schema validator, empty value is not the same as missing
          // value, and we want to prevent some of the prop types rules to be
          // applied on empty values: string pattern, string format, enum, number
          // min/max...
          // However, we don't remove empty attributes to avoid an error with
          // Drupal\Core\Template\TwigExtension::createAttribute() when themers
          // forget to use the default({}) filter.
          return $build;
        }

    It looks like a security we may not need anymore

  • πŸ‡«πŸ‡·France pdureau Paris

    Mikael got a look, so back to Christian

  • πŸ‡«πŸ‡·France pdureau Paris
  • πŸ‡©πŸ‡ͺGermany Christian.wiedemann

    christian.wiedemann β†’ made their first commit to this issue’s fork.

  • Merge request !312Cleanup unused stuff β†’ (Merged) created by Christian.wiedemann
  • Pipeline finished with Failed
    10 months ago
    Total: 574s
    #376871
  • πŸ‡©πŸ‡ͺGermany Christian.wiedemann

    I removed everything I was sure it doesn' break anything. For that reason I did not remove:

    if (empty($data) && $prop_type->getPluginId() !== 'attributes') {
          // For JSON Schema validator, empty value is not the same as missing
          // value, and we want to prevent some of the prop types rules to be
          // applied on empty values: string pattern, string format, enum, number
          // min/max...
          // However, we don't remove empty attributes to avoid an error with
          // Drupal\Core\Template\TwigExtension::createAttribute() when themers
          // forget to use the default({}) filter.
          return $build;
        }
    

    Where is the logic moved? I think we need it.

    And we need also ui_patterns_field_config_delete. We could optimize the code and call the event inside the hook but it is a very little optimization so I decided to let it as it is.

  • Pipeline finished with Failed
    10 months ago
    Total: 595s
    #376875
  • πŸ‡«πŸ‡·France pdureau Paris

    Let's create an other ticket for this specific empty($data) && $prop_type->getPluginId() !== 'attributes') issue.

    If everything else is done (or skipped because considered unsafe) you can give the current ticket to Mikael for review

  • Pipeline finished with Success
    10 months ago
    Total: 678s
    #376891
  • First commit to issue fork.
  • πŸ‡«πŸ‡·France just_like_good_vibes PARIS

    looks ok for merge. then i just rebased to prepare merge

  • Pipeline finished with Success
    10 months ago
    Total: 721s
    #377259
  • Automatically closed - issue fixed for 2 weeks with no activity.

  • Pipeline finished with Success
    10 months ago
    Total: 50s
    #388414
  • Status changed to Fixed 3 months ago
  • Pipeline finished with Failed
    12 days ago
    Total: 648s
    #630724
  • Pipeline finished with Success
    12 days ago
    Total: 916s
    #630833
  • Pipeline finished with Success
    12 days ago
    Total: 682s
    #630862
Production build 0.71.5 2024