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

Fold aztec wrapper in main repo #465

Merged
merged 413 commits into from
Jan 21, 2019
Merged

Conversation

hypest
Copy link
Contributor

@hypest hypest commented Jan 3, 2019

Fixes #460

This PR replaces the react-native-aztec Aztec wrapper project submodule, putting in its place a git subtree'd version of its files and git history.

Followed these steps to remove the submodule: https://gist.github.com/myusuf3/7f645819ded92bda6677
And used this command to introduce the subtree: g subtree add --prefix=react-native-aztec git@github.com:wordpress-mobile/react-native-aztec.git master.

Also made changes to the Android side of the bridge and react-native-aztec projects to have them compile successfully on JitPack as before, but as a single (multi-module) project instead of separate repos.

With this PR, development of the react-native-aztec subproject can happen directly in the gutenberg-mobile repo, without the need to open a PR at https://github.com/wordpress-mobile/react-native-aztec. We can deprecate that repo soon if we want to.

Note: this PR has lots of commits, but all the ones dated in 2018 are actually carbon copies of the react-native-aztec commits from the separate repo. Only the ones dated on Jan 3rd (today at the time of writing) are new and are related to the work to make JitPack export 2 different Android modules: "gutenberg-mobile" which is the bridge project and react-native-aztec which is the Aztec wrapper.

To test:

Test 1:

Run the gutenberg-mobile demo app as normal. It should work without needing to update a react-native-aztec submodule (there's no such git submodule anymore)

Test 2 (Android):

Use wpandroid and point the gutenberg-mobile submodule to this PR. The build should work as normal.

Test 3 (iOS): (not ready yet, needs iOS dev)

Build the wpios app. It should work as normal.

SergioEstevao and others added 30 commits August 12, 2018 18:19
Add placeholder properties for iOS AztecView.
Update the sample app to keep a separated size property for each item.
…eCommand can be invoked on the parent if necessary.
…e_event

Add event to RCTAztecView to propagate format changes.
…r in the editor, and make updates to the toolbar
…ts_active_event

Android - Add event to RCTAztecView to propagate format changes
…interface

Improve callback for contentSize.
@koke
Copy link
Member

koke commented Jan 15, 2019

A bit late to the conversation but would cocoapods subspecs help here? Instead of having a separate podspec in a subdirectory (which is slightly problematic for versioning), we can add have Gutenberg/Bridge and Gutenberg/Aztec in Gutenberg.podspec.

I'm not sure if it's worth the effort, but wanted to share the idea.

@mzorz
Copy link
Contributor

mzorz commented Jan 17, 2019

Nice work @hypest ! Gave it a quick look, found out the Test 1 (yarn run android) gives this when trying on a clean checkout:

* Where:
Build file '/Users/mariozorz/proyectos/tests/gutenberg-mobile/react-native-aztec/android/build.gradle' line: 88

* What went wrong:
A problem occurred evaluating project ':react-native-aztec'.
> Cannot get property 'buildGutenbergFromSource' on extra properties extension as it does not exist

Tried a couple of things without luck though, so thought of at least reporting here but afraid I can't offer any solution as a follow up 😞

pinarol and others added 2 commits January 17, 2019 20:30
…l-position

Add onCaretVerticalPositionChange event
The value is picked up from gradle.properties and defaults to `true`.
@hypest
Copy link
Contributor Author

hypest commented Jan 18, 2019

Thanks for the report @mzorz ! I pushed aa88979 with a fix. The issue was that the root project (in yarn android's case it's the demo app) needs to set the flag to some value. Copied the logic from the wpandroid for this one so, the flag can be set via the gradle.properties file too.

@hypest
Copy link
Contributor Author

hypest commented Jan 18, 2019

Updated from develop to resolve conflicts.

The update commit is 0de87da and then fcfa370 is for updating from react-native-aztec too.

That update was rather painful in general since the submodule is removed from this branch and I had to figure out how to wrangle git to convince it to keep the commit history adopted from the subtree.

For the record, here are the steps I think I performed to do the update:

git merge develop

# Resolve conficts. Chosen the Gutenberg hash from develop but the submodule deletion from local
git mergetool 

# Ignore the Aztec wrapper changes that came from develop
git rm --cached react-native-aztec

# finish the merge
git commit

# get the latest commits from the react-native-aztec master
git subtree pull --prefix=react-native-aztec git@github.com:wordpress-mobile/react-native-aztec.git master

@hypest
Copy link
Contributor Author

hypest commented Jan 18, 2019

👋 @etoledom , @diegoreymendez , @koke . Are you all content with the iOS side of changes in this PR so we can merge it? Ideally, is the solution in this PR workable down the road and hopefully not a deadend? Also, will it still be an improvement over how we develop the Aztec wrapper so far (the separate repo)?

@etoledom
Copy link
Contributor

I made a test of @koke's idea about using subspec and looks promising (
#465 (comment))

I could send an update on early Monday, but it can be a later improvement too (future PR).

@etoledom
Copy link
Contributor

@hypest
Copy link
Contributor Author

hypest commented Jan 18, 2019

but it can be a later improvement too

I'd personally favor a future PR so we avoid having to update this PR from develop again. It's not exactly fun :)

@etoledom
Copy link
Contributor

I found a problem while testing the subspec approach.
The import RNTAztecView from /react-native-gutenberg-bridge/ios/Gutenberg.swift fails on WPiOS (dependencies installed with cocoapods), and it is solved by deleting that line.

But that import is required to build the example project.

I'm not sure how to solve that problem. Maybe we could use cocoapods in the example project?

Anyway, I think this PR is good to go, and as mentioned, we can improve the iOS side later.

@hypest
Copy link
Contributor Author

hypest commented Jan 21, 2019

Thanks for the update @etoledom!

I think we should go ahead and merge this PR. Also, regarding #465 (comment), can you do that change before we merge?

@etoledom
Copy link
Contributor

etoledom commented Jan 21, 2019

Sure! I'll make a PR for that as soon as this one is merged the change now 👍 (edited)

@etoledom
Copy link
Contributor

Should be ready to 🛳

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.

Fold react-native-aztec into main gutenberg-mobile repo
10 participants