-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Address some warnings in the Gutenberg iOS code used by the React Native layer #49739
Address some warnings in the Gutenberg iOS code used by the React Native layer #49739
Conversation
See compiler warning: > Using 'class' keyword to define a class-constrained protocol is deprecated; > use 'AnyObject' instead
This makes it easier to scan them.
@@ -35,7 +35,7 @@ extension SourceFile { | |||
|
|||
public func jsScript(with argument: String? = nil) throws -> WKUserScript { | |||
let content = try getContent() | |||
let formatted = String(format: content, argument ?? []) | |||
let formatted = String(format: content, argument ?? "") |
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.
static let retrieveHtml = SourceFile(name: "content-functions", type: .js) | ||
static let editorBehavior = SourceFile(name: "editor-behavior-overrides", type: .js) | ||
static let editorStyle = SourceFile(name: "editor-style-overrides", type: .css) | ||
static let wpBarsStyle = SourceFile(name: "wp-bar-override", type: .css) | ||
static let gutenbergObserver = SourceFile(name: "gutenberg-observer", type: .js) | ||
static let injectCss = SourceFile(name: "inject-css", type: .js) | ||
static let retrieveHtml = SourceFile(name: "content-functions", type: .js) | ||
static let insertBlock = SourceFile(name: "insert-block", type: .js) | ||
static let localStorage = SourceFile(name: "local-storage-overrides", type: .json) | ||
static let preventAutosaves = SourceFile(name: "prevent-autosaves", type: .js) | ||
static let gutenbergObserver = SourceFile(name: "gutenberg-observer", type: .js) | ||
static let supportedBlocks = SourceFile(name: "supported-blocks", type: .json) | ||
static let editorBehavior = SourceFile(name: "editor-behavior-overrides", type: .js) | ||
static let wpBarsStyle = SourceFile(name: "wp-bar-override", type: .css) |
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.
This wasn't addressing a warning, but as per commit message it made it easier for me to scan the contents and compare them with what was in the generated resources folder. I thought it'd made sense to use it here, too.
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.
These changes make sense to me. It's nice to resolve distracting warnings. Thank you for taking the time to contribute this! 🙇🏻
I verified the Demo editor successfully builds and runs via npm run native ios
and via Xcode. I also verified the Demo editor successfully builds and runs using wordpress-mobile/gutenberg-mobile#5659 too.
What? & Why?
I've been touching the code in
packages/react-native-bridge/ios
as part of my experiment to see whether I can figure out how to distributedgutenberg-mobile
as a binary XCFramework for the iOS app(s) to use.While around there, I noticed a few warnings and addressed to reduce the noise in my IDE.
How?
Refer to the commit messages for details on the individual warnings
Testing Instructions
The code changes here are relevant only to the React Native implementation. I opened a mirror PR on
gutenberg-mobile
pointing to them to verify CI is green and that the iOS demo app runs locally. See wordpress-mobile/gutenberg-mobile#5659.Testing Instructions for Keyboard
N.A.