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

Massive Code Cleanup - pt3 (bookmarks and added TODOs) #462

Merged
merged 11 commits into from
Jan 19, 2025

Conversation

ZiClaud
Copy link
Contributor

@ZiClaud ZiClaud commented Jan 10, 2025

📝 Description

Cleaned code for Bookmarks - Needs testing, I can't do it
Added many TODOs at the start of script.js, with the stuff that still needs to be done (will need help to do all of those)

📸 Screenshots / 📹 Videos

N/A

🔗 Related Issues

✅ Checklist

  • I have read and followed the Contributing Guidelines.
  • I have tested my changes by installing them as an extension (not just running via localhost) to ensure it builds, installs, and works as expected.
  • I have tested these changes in at least Chrome and Firefox (other browsers if applicable).
  • Attached visual evidence of changes (screenshots or videos) if applicable.

@ZiClaud
Copy link
Contributor Author

ZiClaud commented Jan 10, 2025

@Minuga-RC, I've added a TODO just for you
Could you move the proxy stuff in a file called proxy.js?
I would do it, but I wouldn't be able to test if it works, and I don't want to break anything

@prem-k-r

This comment was marked as outdated.

@prem-k-r prem-k-r added the refactor Improve code structure, readability, or performance without changing functionality label Jan 10, 2025
@Minuga-RC
Copy link
Contributor

@ZiClaud @prem-k-r I think I will find time I was redoing the v3 yesterday night anyway

@ceskyDJ
Copy link
Contributor

ceskyDJ commented Jan 10, 2025

Hmm, it started getting better! Thanks for a good job, @ZiClaud!

As modules are used, now there is a place to use Webpack or a similar tool to create a single optimized script and stylesheet from all the separate modules. Could you look for it or add it to TODOs?

@Minuga-RC
Copy link
Contributor

ok idk its becs weather of @ZiClaud sometimes things doesnt seeems to load very well in vite maybe becs of too many js scripts

@Minuga-RC
Copy link
Contributor

@ZiClaud made a pr on ur repo
ZiClaud#2

@itz-rj-here
Copy link
Collaborator

Look who's here after these days...

This was referenced Jan 11, 2025
@Minuga-RC
Copy link
Contributor

Look who's here after these days...

Lol finally got some motivation

@Minuga-RC
Copy link
Contributor

image
👀

Copy link
Collaborator

@itz-rj-here itz-rj-here left a comment

Choose a reason for hiding this comment

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

Conflicts

@itz-rj-here itz-rj-here added enhancement New feature or request changes required PR requires updates based on review feedback and removed refactor Improve code structure, readability, or performance without changing functionality labels Jan 11, 2025
@prem-k-r prem-k-r added refactor Improve code structure, readability, or performance without changing functionality and removed enhancement New feature or request labels Jan 11, 2025
@ZiClaud
Copy link
Contributor Author

ZiClaud commented Jan 11, 2025

ok idk its becs weather of @ZiClaud sometimes things doesnt seeems to load very well in vite maybe becs of too many js scripts

Could it be that I created too many document.addEventListener(...)?
If so, is there a way to fix it, like using another function?

As modules are used, now there is a place to use Webpack or a similar tool to create a single optimized script and stylesheet from all the separate modules. Could you look for it or add it to TODOs?

I'll try to look into it, if we're lucky it might fix the problem mentioned above

@prem-k-r
Copy link
Collaborator

prem-k-r commented Jan 11, 2025

ok idk its becs weather of @ZiClaud sometimes things doesnt seeems to load very well in vite maybe becs of too many js scripts

Could it be that I created too many document.addEventListener(...)? If so, is there a way to fix it, like using another function?

I don't have such issues most of the time.. there were some, translation function was causing some unwanted things but after adding setTimeout, it's almost none

@ceskyDJ
Copy link
Contributor

ceskyDJ commented Jan 11, 2025

Could it be that I created too many document.addEventListener(...)?
If so, is there a way to fix it, like using another function?

How much did you increase the number of event listeners? It could be a problem, but it's pretty highly limited so that you can add many listeners without a problem. There is a solution, of course—you aggregate multiple event listeners into one, where you decide what to do based on target, etc. So, you have, e.g., one addEventListener() per module, which registers one function, where you select and call the final functions for handling the event. This is a little harder to implement, so it works well, and the code is still of high quality. If it's not necessary, it'd avoid it.

Another common problem could be registering the same event listener multiple times. It could be due to updating DOM for fetched data, where you don't properly deallocate the old structures (event listeners targeting old data) and just add event listeners for new data. In general, this problem could be in code, where you generate DOM from data and use addEventListener() in every update case. It's even worse when you add event listeners inefficiently in cycles, etc.

I don't have time for more than these words, so I hope they'll help you.

@prem-k-r
Copy link
Collaborator

couldn't draft PR so had to edit it :(

@prem-k-r prem-k-r removed the changes required PR requires updates based on review feedback label Jan 14, 2025
prem-k-r
prem-k-r previously approved these changes Jan 15, 2025
itz-rj-here
itz-rj-here previously approved these changes Jan 16, 2025
@itz-rj-here itz-rj-here added the ready to merge The pull request is ready to merge label Jan 16, 2025
@prem-k-r prem-k-r dismissed stale reviews from itz-rj-here and themself via 699d6bf January 19, 2025 13:36
@prem-k-r
Copy link
Collaborator

Resolved conflicts

@XengShi XengShi merged commit 927ff03 into XengShi:main Jan 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready to merge The pull request is ready to merge refactor Improve code structure, readability, or performance without changing functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants