Skip to content

fix(worker-image): Add attribute functions for worker-image #681

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

Merged
merged 4 commits into from
Jul 16, 2025

Conversation

mws19901118
Copy link
Contributor

@mws19901118 mws19901118 commented Jul 2, 2025

What is it?

  • Feature / enhancement
  • Bug
  • Docs / tests

Description

This PR adds setAttribute(), getAttribute(), hasAttribute(), removeAttribute(), toggleAttribute() functions to HTMLImageElement class. with unit tests.

Use cases and why

Checklist:

  • My code follows the developer guidelines of this project
  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • Added new tests to cover the fix / functionality

Copy link

changeset-bot bot commented Jul 2, 2025

🦋 Changeset detected

Latest commit: 4d83e27

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@qwik.dev/partytown Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@mws19901118 mws19901118 marked this pull request as ready for review July 2, 2025 18:48
Copy link
Member

@gioboa gioboa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your help @mws19901118
I think we should have the complete implementation here. Can you add this missing piece please?

@mws19901118
Copy link
Contributor Author

mws19901118 commented Jul 11, 2025

Thanks for your help @mws19901118 I think we should have the complete implementation here. Can you add this missing piece please?

Hey, yep, sure. A full set of attribute functions?

  1. getAttribute()
  2. setAttribute()
  3. hasAttribute()
  4. removeAttribute()
  5. toggleAttribute()

Copy link
Member

@gioboa gioboa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes please. These methods will prevent other issues I guess.

- Add getAttribute(), hasAttribute(), removeAttribute(), toggleAttribute()
- Enhance setAttribute() to handle src attribute properly
- Add attributes Map to store element attributes
- Create comprehensive unit tests covering all attribute methods

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
@mws19901118 mws19901118 force-pushed the worker-image-dummy-setattribute branch from 6c20972 to f471d49 Compare July 14, 2025 04:02
@mws19901118
Copy link
Contributor Author

Hi @gioboa, just updated the functions with the help of Claude, if that is okay in this repo. Please take a look, thanks!

@mws19901118 mws19901118 changed the title fix(worker-image): Add a dummy setAttribute for worker-image fix(worker-image): Add attribute functions for worker-image Jul 14, 2025
Copy link
Member

@gioboa gioboa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks great to me 👏
Kudos for your first PR in the project 🎉

@gioboa gioboa merged commit aca3af2 into QwikDev:main Jul 16, 2025
6 checks passed
@github-actions github-actions bot mentioned this pull request Jul 16, 2025
@mws19901118
Copy link
Contributor Author

It looks great to me 👏 Kudos for your first PR in the project 🎉

Thank you so much!!!

@mws19901118 mws19901118 deleted the worker-image-dummy-setattribute branch July 16, 2025 16:12
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