Skip to content
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

Follow our own convention when registering a UI component #209

Closed
Reinmar opened this issue Dec 23, 2024 · 0 comments · Fixed by #210
Closed

Follow our own convention when registering a UI component #209

Reinmar opened this issue Dec 23, 2024 · 0 comments · Fixed by #210
Assignees
Labels
intro Good first ticket. squad:platform Issue to be handled by the Platform team. type:improvement This issue reports a possible enhancement of an existing feature.
Milestone

Comments

@Reinmar
Copy link
Member

Reinmar commented Dec 23, 2024

📝 Provide a description of the improvement

We generated this code by default:

		// Add the "fullScreenButton" to feature components.
		editor.ui.componentFactory.add( 'fullScreenButton', locale => {
			const view = new ButtonView( locale );

While our convention is to not suffix the name with the "type" of the component. Which is well visible in the sample that we generate:

		toolbar: [
			'undo',
			'redo',
			'|',
			'fullScreenButton',
			'|',
			'heading',
			'|',
			'bold',
			'italic',
			'link',
			'code',
			'bulletedList',
			'numberedList',

By suggesting an incompatible convention we cause the community plugins to differ from official ones.

BTW, answering "but the suffix make it more clear what we're registering": Yes, it does. But there's also a comment above which we should improve. Ideally, code comments should add something to the code, but right now it reads what the line below says 1:1.

📃 Other details

  • Node: …
  • Npm / Yarn: …
  • First affected version: …

If you'd like to see this improvement implemented, add a 👍 reaction to this post.

@Reinmar Reinmar added the type:improvement This issue reports a possible enhancement of an existing feature. label Dec 23, 2024
@pomek pomek added intro Good first ticket. squad:platform Issue to be handled by the Platform team. labels Dec 23, 2024
@CKEditorBot CKEditorBot added the status:planned Set automatically when an issue lands in the "Sprint backlog" column. We will be working on it soon. label Dec 23, 2024
@psmyrek psmyrek self-assigned this Dec 27, 2024
@CKEditorBot CKEditorBot added status:in-progress Set automatically when an issue lands in the "In progress" column. We are working on it. and removed status:planned Set automatically when an issue lands in the "Sprint backlog" column. We will be working on it soon. labels Dec 27, 2024
psmyrek added a commit that referenced this issue Dec 31, 2024
Other (generator): Aligned the UI component name from the generated package to naming convention in CKEditor 5. Closes #209.
@CKEditorBot CKEditorBot removed the status:in-progress Set automatically when an issue lands in the "In progress" column. We are working on it. label Dec 31, 2024
@CKEditorBot CKEditorBot added this to the iteration 82 milestone Dec 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
intro Good first ticket. squad:platform Issue to be handled by the Platform team. type:improvement This issue reports a possible enhancement of an existing feature.
Projects
None yet
4 participants