Skip to content

Conversation

@lepresk
Copy link
Contributor

@lepresk lepresk commented Jun 15, 2023

Description
This pull request aims to enhance the codebase by introducing several significant changes. The primary focus is on code refactoring to improve readability, maintainability, and adherence to coding best practices. Additionally, this pull request includes the implementation of unit tests for better code quality assurance. The Button component has been reorganized to follow a cleaner and more modular structure, allowing for easier maintenance and extensibility. Furthermore, comprehensive documentation updates have been made to provide clear usage instructions and explanations for developers. Lastly, localization support has been introduced to enable multi-language functionality within the application.

Changes Made

  1. Conducted extensive code refactoring to enhance code readability and maintainability. This includes restructuring code blocks, improving variable and function names, and eliminating redundant or duplicated code.
  2. Implemented a comprehensive suite of unit tests to ensure proper functionality and code quality. These tests cover various use cases, edge cases, and possible error scenarios.
  3. Reorganized the Button component to adhere to a more modular and organized structure. This allows for easier maintenance, extensibility, and reusability of the component.
  4. Updated and expanded the documentation to provide comprehensive usage instructions, code examples, and explanations for the Button component and related features.
  5. Introduced localization support to enable multi-language functionality within the application. This includes the addition of language files, integration with a localization library, and updating relevant components to support language translation.

Testing

  • Developed a suite of unit tests covering various scenarios and edge cases to ensure the proper functioning of the codebase.
  • Ran the existing test suite to validate the compatibility and stability of the changes made.

Documentation

  • Updated the documentation to reflect the changes made in the pull request.
  • Expanded the documentation to provide clear instructions, usage examples, and explanations for the Button component and related features.
  • Ensured that the documentation is consistent with the updated codebase.

Localization

  • Introduced localization support to enable multi-language functionality.
  • Added language files and integrated a localization library to facilitate translations.
  • Updated relevant components, including the Button component, to support dynamic content translation.

Please review this pull request and provide your feedback. Any comments, suggestions, or improvements are highly appreciated.

@MarienMupenda
Copy link
Member

Thank you for your contribution @lepresk.

Question
What formatting style did you use to reformat the code base?

Here are some suggestions.

  1. We need to consider those changes for the next major release. v4.x as the modularity on buttons will introduce a break change. (for those projects who are already in production)
  2. If possible, also make the inputs modular, but i was also thinking about making them shorter eg. <x-form:image> instead of <x-form:input.image> or as for now <x-form:input-image>. What's your thoughts on it?
  3. Add tests for other components.
  4. Make the codebase documentation more consistent as you did for buttons.
  5. Provide more explanation and usage examples for the <x-form:input-image>, specifically when you use it on Livewire with his ability to preview the image you select. You can also notice that x-media::list is used to display selected files.
image
  1. Add more lang for EN et FR.

Those suggestions could be added as issues at first.

Also, you've probably noticed that i tried to create a Symfony like FormBuilder, the goal was to provide a way to build a form directly from your controller.

Best regards
@MarienMupenda

@MarienMupenda MarienMupenda merged commit 2ef860a into smirltech:master Jun 17, 2023
@MarienMupenda
Copy link
Member

The PR merged to 4.x branch🌿

@lepresk
Copy link
Contributor Author

lepresk commented Jun 19, 2023

Hello @MarienMupenda,

I did not use any specific formatting rules; I organized things the way I am accustomed to seeing and doing in various PHP projects.

Indeed, the modifications to the buttons will introduce a break with what already exists, but I didn't have much choice given the existing code. I believe the idea of including this in future versions is a good approach.

  • In my opinion, the notation x-form:input.image is more appropriate than x-form:image because not only is it concise and easy to read, but it is also conventional for custom Blade components.

  • Adding tests is obviously the most important element for a library's survival and stability in the long run. In this regard, it is necessary to extend unit tests everywhere.

For the rest, it can be done gradually. I will do my best to contribute as soon as I have some free time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants