-
Notifications
You must be signed in to change notification settings - Fork 1k
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
feat(iOS): Refactoring configuration #3759
Conversation
…InstanceConfiguration. Removed reference to CAPConfig from CAPLog and replaced with a static flag.
ce2cb01
to
e30e927
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- I found
@class CAPConfig;
inCAPPlugin.h
-- is this a problem?
for (itemIndex, item) in items.enumerated() { | ||
Swift.print(item, terminator: itemIndex == items.count - 1 ? terminator : separator) | ||
} | ||
} | ||
} | ||
|
||
public static func hideLogs() -> Bool { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure why this was public to begin with, but just noting that it is something being removed from the public API.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, its replacement property is public as well but we should probably note that.
Good catch. It's an unused forward declaration so, no, it's not a problem but it should be removed anyway. |
This branch revisits configuration with multiple goals:
Move the configuration store away from a key/value container to typed properties. This reduces the risk of "stringly-typed" parsing scattered around the project and improves type safety.
Centralize all configuration defaults and file keys so they are not spread over the codebase. This also allows for easier testing and updating of the configuration file.
Provide a programmatic structure so applications can configure the capacitor bridge without relying on injecting JSON.
Add unit tests.
The configuration file(s) is parsed into an intermediate structure which can be modified (supported in a future refactoring of CAPBridgeViewController), and then transformed into an immutable store on the bridge.
CAPLog has been updated to use a simple boolean to control logging instead of loading a second instance of CAPConfig (and making assumptions about its location). The initialization has been reworked to set that flag based on the configuration before any logging might occur.