-
Notifications
You must be signed in to change notification settings - Fork 58
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
Changes to integrate Gutenberg-Mobile into the WPiOS App #195
Merged
Merged
Changes from 43 commits
Commits
Show all changes
47 commits
Select commit
Hold shift + click to select a range
1d54536
RN App running inside iOS App
etoledom 4dee77a
Merge branch 'master' into try/WPiOS-integration
etoledom cb372de
Update reference to WPiOS.
etoledom 99a3bef
Updating react-native-aztec and WordPress-iOS submodule references
etoledom 3f84337
Update submodules reference
etoledom 815f8d6
Merge branch 'master' into try/WPiOS-integration
etoledom 242a76d
Adding Done button to send a 'Done' message to native app.
etoledom 5c66839
Removed WordPress-iOS from submodules
etoledom d45eb94
Recovering original ios example project
etoledom 701f1d0
Changing folder name to react-native-aztec
etoledom 7961460
Update react-native-aztec submodule reference
etoledom c8a004a
Merge branch 'master' into try/WPiOS-integration
etoledom bc30f4e
Added buttons to save and close at top.
etoledom 6723e1d
Organizing dependencies to run example proyect.
etoledom cb198c9
Refactored MediaProvider to be easely implemented on different projects.
etoledom fa77088
Update RNAztec reference
etoledom e2ace68
Merge branch 'master' into try/WPiOS-integration
etoledom bc2049b
Update gutenberg reference
etoledom b43baf3
Fix lint issues
etoledom 011f10d
Adding `block-serializer` helper to reuse code.
etoledom 6e5f6d4
Removed React dependency from AppDelegate
etoledom 0c0075c
Update RNAztec reference
etoledom c6c10b4
Fixing flow warning on `block-serializer`
etoledom 27bbb33
GutenbergBridge: rootView is now a function to receive initial props.
etoledom 99f6cb5
Merge branch 'master' into try/WPiOS-integration
etoledom 39bd7da
Updated Aztec and Gutenberg references
etoledom 2b4abb7
Merge branch 'master' into try/WPiOS-integration
etoledom 69348e5
Implementing react-native-gutenberg-bridge on ios example app.
etoledom 56cc4d0
Merge branch 'master' into try/WPiOS-integration
etoledom 67be16a
Clean up deprecated bridge communication.
etoledom 3a05f6e
Solving pod warnings on RNReactNativeGutenbergBridge.podspec
etoledom 73c147d
Bridge and aztec updates
etoledom 17450f4
Reconnect Gutenberg Bridge to native Save action.
etoledom 5929749
Modified iOS example project to test bridge methods easely.
etoledom 78b66e4
Update Aztec reference.
etoledom 16f1a4d
iOS Brdige: Remove extra delegate.
etoledom 495c866
Update Aztec reference
etoledom 05b394f
Merge branch 'master' into try/WPiOS-integration
etoledom d5097ab
iOS Gutenberg.m: Refactoring `gutenbergBridgeModule` init.
etoledom c21e8cf
iOS Bridge: Refactor `Gutenberg` class init.
etoledom 6c0ca2e
iOS Bridge: Fix retain cycle.
etoledom 2ed47c4
html-text-input.js: Roll back `block-serializer` changes.
etoledom bc7a52e
iOS Bridge: Small syntax fixes.
etoledom 23877bc
Merge branch 'master' into try/WPiOS-integration
etoledom ab1a355
iOS Bridge: Removed unused protocol declaration.
etoledom 292b31e
Updating Aztec reference to current master
etoledom 2372f40
Merge branch 'master' into try/WPiOS-integration
etoledom File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
|
||
import UIKit | ||
|
||
class GutenbergViewController: UIViewController { | ||
lazy var gutenberg = Gutenberg() | ||
|
||
override func loadView() { | ||
view = gutenberg.rootView | ||
} | ||
|
||
override func viewDidLoad() { | ||
super.viewDidLoad() | ||
addSaveButton() | ||
gutenberg.delegate = self | ||
navigationController?.navigationBar.isTranslucent = false | ||
} | ||
|
||
func addSaveButton() { | ||
navigationItem.leftBarButtonItem = UIBarButtonItem(barButtonSystemItem: .save, target: self, action: #selector(saveButtonPressed(sender:))) | ||
} | ||
|
||
@objc func saveButtonPressed(sender: UIBarButtonItem) { | ||
gutenberg.requestHTML() | ||
} | ||
} | ||
|
||
extension GutenbergViewController: GutenbergBridgeDelegate { | ||
func gutenbergDidProvideHTML(_ html: String) { | ||
print("Did receive HTML: \(html)") | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Going the route of providing a VC in Gutenberg is a double edged sword, and one that I'd really try to avoid, if possible.
I realize I may not see the full picture so my initial question is: was this choice because of advantages? requirements?
To explain a bit more why I think this is a bigger deal that can be apparent at first... this is all coming from my experience working in Aztec:
gutenberg-mobile
. If the UI needs to be customized we'll need to add extra code to support any such customization (that'd be otherwise for free). Think of the app needing to show different colors... change the whole layout... move buttons around. Or even worse, us wanting to use this library in two different Apps.gutenberg-mobile
(things likeWordPressShared
... the media provider... services... UI components that exist in WPiOS... etc).Overall, while it may seem simpler, it may end up adding a ton of extra work to access things that we'd get for free if we just provided a view component.
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.
Thanks for your comments @diegoreymendez !
I believe there's a misunderstanding. Probably I haven't explained this implementation properly.
This
GutenbergViewController
only exists in the Example app and is meant to be a testing platform for the native modules (the communication between RN and Native).The plan (as I see it so far) would be to provide just the
Gutenberg.h
interface to thegutenberg-mobile
users (i.e: WPiOS).Gutenberg.h
currently lives insidereact-native-gutenberg-bridge
but ideally we would provide it as the public header in a Pod framework. It provide access to the Gutenberg RootView (plainUIView
), and it doesn't have any React / ReactNative public dependencies (all the React dependencies are managed internally). It also has methods to send messages to the RN side and a delegate to receive messages from RN.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.
Maybe we could rename it
GutenbergExampleController
, or planeExampleController
to be more explicit about it.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 think my confusion stems from the fact there's no mention of
Example
in the file path or name... it's not a big deal to be honest. If this is an Example App VC we should be good.