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

Convert shortcode package to TypeScript #60526

Open
wants to merge 2 commits into
base: trunk
Choose a base branch
from

Conversation

mikeybinns
Copy link
Contributor

What?

Converting the shortcodes package to TypeScript.

Why?

It's an enhancement, while not necessary it is helpful to reduce bugs in both the code of the package and end users code if they consume types.

How?

  • All JS files converted to TypeScript
  • Changed object.assign to JS Class declaration for clarity.
  • Removed attrs method from shortcode class as it was inaccessible due to a property of the same name. attrs function is still exported separately as before.
  • Types exported from package.json
  • I fixed a bug in the implementation of the shortcode class where valid attribute objects were treated as shallow objects.
  • Add a few extra automated tests to cover that bug

Testing Instructions

Covered by automatic tests.

Testing Instructions for Keyboard

N/A

Screenshots or screencast

N/A

Copy link

github-actions bot commented Apr 6, 2024

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: mikeybinns <mikeybinns@git.wordpress.org>
Co-authored-by: manzoorwanijk <manzoorwanijk@git.wordpress.org>
Co-authored-by: gziolo <gziolo@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@gziolo gziolo added [Type] Code Quality Issues or PRs that relate to code quality Developer Experience Ideas about improving block and theme developer experience labels Apr 6, 2024
@manzoorwanijk
Copy link
Member

We can close or redo this following #67416.

CC @gziolo

@mikeybinns
Copy link
Contributor Author

Happy to close mine :)

@mikeybinns mikeybinns closed this Nov 30, 2024
@gziolo
Copy link
Member

gziolo commented Nov 30, 2024

Nice! It’s exactly what needs to happen next. We definitely need to refresh this PR. @mikeybinns, will you have time to rebase this branch with trunk or is it fine to open another branch based on the existing code?

@gziolo
Copy link
Member

gziolo commented Nov 30, 2024

Ok, good. We definitely want to reuse all the new tests introduced in addition to other changes proposed ❤️

@mikeybinns
Copy link
Contributor Author

Okay, in that case, I will rebase it when I have time :)

@mikeybinns mikeybinns reopened this Nov 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Developer Experience Ideas about improving block and theme developer experience [Type] Code Quality Issues or PRs that relate to code quality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants