Consider renaming javascript component ID to 'id' rather than machineName

Created on 27 January 2025, 2 days ago

Overview

See https://git.drupalcode.org/project/experience_builder/-/merge_requests/5...

Proposed resolution

User interface changes

πŸ“Œ Task
Status

Active

Version

0.0

Component

Config management

Created by

πŸ‡¦πŸ‡ΊAustralia larowlan πŸ‡¦πŸ‡ΊπŸ.au GMT+10

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

Comments & Activities

  • Issue created by @larowlan
  • πŸ‡§πŸ‡ͺBelgium wim leers Ghent πŸ‡§πŸ‡ͺπŸ‡ͺπŸ‡Ί

    FYI: \Drupal\experience_builder\Entity\JavaScriptComponent::$machineName was specifically chosen to match SDC's core/assets/schemas/v1/metadata-full.schema.json#properties.machineName

    As documented in config schema:

        # See core/assets/schemas/v1/metadata-full.schema.json#properties.machineName
        machineName:
          type: machine_name
          label: 'Machine Name'
          constraints:
            Regex:
              pattern: '/^[a-z]([a-zA-Z0-9_-]*[a-zA-Z0-9])*$/'
              message: 'The %value machine name is not valid.'
    
  • πŸ‡¬πŸ‡§United Kingdom longwave UK

    I get that we are following SDC, but we also use snake case for all other config entity properties. Not sure what is best here.

  • πŸ‡§πŸ‡ͺBelgium wim leers Ghent πŸ‡§πŸ‡ͺπŸ‡ͺπŸ‡Ί

    I don't feel strongly, I was just explaining the rationale!

    If you got confused by it, and it sounds like #2 does not convince you.

    So: you decide! πŸ˜„ What did you expect? What would've caused the least friction for you? Name it so! πŸ‘

Production build 0.71.5 2024