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

Replace booleans with dark | light strings #10

Merged
merged 4 commits into from
Oct 26, 2023

Conversation

ollema
Copy link
Collaborator

@ollema ollema commented Oct 26, 2023

I could not get #9 to work - ran into some very weird issues.

This patch changes less things, and now all tests pass and it works for apps as well, as far as I can tell.

In this patch:

  • I still keep (up to) 3 persistent stores.
  • The derived store is no longer needed
  • Unused code is removed (getModeUserPrefers, getModeAutoPrefers, autoModeWatcher)
  • Variables (and localStorage keys) are renamed, mostly to ensure that there are no unforeseen consequences for end users when persistent stores are changed from booleans to strings
  • I also fixed the bug mentioned in Discord

All in all, I hope this patch will improve readability

@changeset-bot
Copy link

changeset-bot bot commented Oct 26, 2023

🦋 Changeset detected

Latest commit: 0564701

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

This PR includes changesets to release 1 package
Name Type
mode-watcher 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

Copy link
Member

@huntabyte huntabyte left a comment

Choose a reason for hiding this comment

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

Thank you for taking the time to do this! Just a few minor things, mostly naming-related but one regarding an export. If you have any questions feel free to hit me up on Discord or if you want me to take care of this last bit, let me know and I can certainly do so!

src/lib/mode.ts Outdated Show resolved Hide resolved
src/lib/mode.ts Outdated Show resolved Hide resolved
src/lib/mode.ts Outdated Show resolved Hide resolved
src/lib/mode.ts Outdated Show resolved Hide resolved
src/lib/mode.ts Outdated Show resolved Hide resolved
src/lib/mode.ts Outdated Show resolved Hide resolved
src/lib/mode.ts Outdated Show resolved Hide resolved
src/lib/mode-watcher.svelte Outdated Show resolved Hide resolved
src/lib/mode-watcher.svelte Outdated Show resolved Hide resolved
src/lib/mode.ts Outdated Show resolved Hide resolved
@ollema
Copy link
Collaborator Author

ollema commented Oct 26, 2023

Thank you for taking the time to do this! Just a few minor things, mostly naming-related but one regarding an export. If you have any questions feel free to hit me up on Discord or if you want me to take care of this last bit, let me know and I can certainly do so!

I think I fixed it all now, let me know if I missed anything. tests are passing and my test app is also working

@ollema ollema requested a review from huntabyte October 26, 2023 20:23
@huntabyte
Copy link
Member

Incredible, thanks a ton @ollema!

@huntabyte huntabyte merged commit 487c5e3 into svecosystem:main Oct 26, 2023
3 checks passed
@ollema ollema deleted the replace-bool-with-string branch November 8, 2023 20:43
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