Consistently prefix components with drupal-

Created on 30 March 2023, about 1 year ago

Problem/Motivation

We want to enable people to nicely organize the frontend code. A consistent drupal-prefix would help clearly separate drupal custom-elements from other components.

Proposed resolution

Improve defaults in custom-elements 3.x to apply the drupal prefix everywhere.

πŸ“Œ Task
Status

Active

Version

1.0

Component

Code

Created by

πŸ‡¦πŸ‡ΉAustria fago Vienna

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

Comments & Activities

  • Issue created by @fago
  • πŸ‡¦πŸ‡ΉAustria fago Vienna
  • πŸ‡¦πŸ‡ΉAustria fago Vienna
  • This would be a breaking change for existing Nuxt projects. One would have to move components in Nuxt projects in a sub-folder "Drupal" or write additional component config in nuxt config file or have prefixed component names with "Drupal". It adds another layer to think about when developing frontend, I don't like that.

    What I'm doing right now in a Nuxt 3 project is, I put all drupal custom-elements in a subfolder "global". That way the components are grouped and are global (Dynamic Components) without the need for additional components config and can be rendered with Vue Render Function API (nuxtjs-drupal-ce renderCustomElements helper uses it). Other components, that are not rendered with Vue Render Function API, don't need to be global.

Production build 0.69.0 2024