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

Add nested settings support #487

Open
wants to merge 21 commits into
base: main
Choose a base branch
from

Conversation

yofukashino
Copy link
Contributor

added support for nested settings and fixed type for findInReactTree

this pr will close #383

sorry closed the old pr by mistake coz of renaming the branch. sorry

added support for nested settings and fixed type for findInReactTree
Copy link
Member

@asportnoy asportnoy left a comment

Choose a reason for hiding this comment

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

To prevent breaking changes, add a fallback as the original string with the dot included.

@asportnoy asportnoy added bug Something isn't working enhancement New feature or request semver: patch Requires a patch semver version bump addon development Relates to developing addons, eg APIs or scripts labels Jun 18, 2023
@yofukashino
Copy link
Contributor Author

yofukashino commented Jun 18, 2023

To prevent breaking changes, add a fallback as the original string with the dot included.

i dont get what you mean. if you think not including . will break for not nested settings then its not the case ig

edit: i dont get what you mean after reading multiple times so can you elaborate or say in simpler terms

@FedeIlLeone FedeIlLeone changed the title util update Add nested settings support Jun 18, 2023
@asportnoy
Copy link
Member

If an addon is already relying on a key like hello.world, that data essentially will be wiped after this PR. So the initial behavior needs to be added as a fallback on the getter.

@yofukashino
Copy link
Contributor Author

How do I add that? Any ideas?

@asportnoy
Copy link
Member

Just add a fallback to use the initial behavior if the new behavior is undefined

@yofukashino
Copy link
Contributor Author

How do I decide if new behavior is undefined or not. What is the new behavior anyways

@netlify
Copy link

netlify bot commented Jul 23, 2023

Deploy Preview for replugged-docs failed.

Name Link
🔨 Latest commit 41f90cf
🔍 Latest deploy log https://app.netlify.com/sites/replugged-docs/deploys/663f041972e0a700082ef397

@yofukashino
Copy link
Contributor Author

fixed types, and fallback value usage. also added a check if the key given is already in settings ignoring the path separator it will be treated as a key.
well should be enough for what you wanted

src/renderer/util.ts Outdated Show resolved Hide resolved
src/renderer/util.ts Outdated Show resolved Hide resolved
src/renderer/util.ts Outdated Show resolved Hide resolved
src/renderer/util.ts Outdated Show resolved Hide resolved
bin.mjs Outdated Show resolved Hide resolved
src/renderer/util.ts Show resolved Hide resolved
src/renderer/util.ts Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
addon development Relates to developing addons, eg APIs or scripts bug Something isn't working enhancement New feature or request semver: patch Requires a patch semver version bump
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Nested setting support
3 participants