-
Notifications
You must be signed in to change notification settings - Fork 54
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
First stab at having Aztec in the RN app #60
Conversation
Support lib version set to `27.1.0` as the list project seems to not support 27.1.1.
Looks good to me! @diegoreymendez @mzorz, @SergioEstevao Would some of you take a look at this PR and merge in afterwards? |
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.
Went through this, left some comments
src/block-management/block-holder.js
Outdated
type StateType = { | ||
selected: boolean, | ||
focused: boolean, | ||
aztecheight: number, |
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.
Could we make aztecheight
-> aztecHeight
? I think for readability and following how other variables are named
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.
Changed with 1995392.
src/block-management/block-holder.js
Outdated
...this.props.attributes, | ||
content: event.nativeEvent.text, | ||
} ); | ||
} } |
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've been considering this a while and opening here for discussion - what do you think about using the ReactAztecFocusEvent
and ReactAztecEndEditingEvent
events to control when to update the state only, instead of making each TextChange event reflect on the RN kept state in this case?. I understand this is counterintuitive in terms of the React logic, but it rings as something plausible given the performance issues, and is a "pure JS" solution (as opposed to involving Java and more Js/Java interaction controlling code).
I've made tests here just changing onChange
for onEndEditing
in line 84 up here and it seems to work pretty well (no more lagging / weird refreshing issues). This, without the code in #62 and wordpress-mobile/react-native-aztec#24 cc @daniloercoli @hypest
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.
👋 @mzorz . I'm not well informed yet on the lifecycle events in RN, and in light of wordpress-mobile/react-native-aztec#24 that fixes the editing consistency issue atm, I'd say let's leave the proposal for onEndEditing
for a separate PR. I'm actually sure we will visit that since yeah, it is probably suboptimal to update the Redux state on every key press.
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.
it is probably suboptimal to update the Redux state on every key press.
👍 Opened #65
Thanks for the review @mzorz ! I addressed all the points on the feedback. Feel free to have another look! 🙇♂️ |
This one is good to go as far as I can tell, as we'll keep working on the basis of it. I'd say feel free to merge, but don't know if @diegoreymendez or @SergioEstevao want to give it a look first just in case? |
@mzorz - I'd say move ahead for now, and we can eventually discuss improvements starting next week. |
👌 @diegoreymendez, then nothing to add @daniloercoli @hypest except this 👇
|
Update AztecRN wrapper to the latest version and fix typing delays
OK, I'll leave it to @daniloercoli (as the assignee) to merge this. In the meantime, I merge #62 which even though it's not a blocker for this PR, it's useful and good-to-go anyway 👍. |
Cool! Thanks you all for the review! |
Improve dependency checking for scripts
This PR add an Aztec instance running on the list.
Features:
<b>
styling to showcase that Aztec is working normally and styles the rendered text.Gotchas:
RichText
) use Aztec instead of hardcoding Aztec onto the list. But, it's a useful first step as to how to start integrating.To test:
Run the app (Android and iOS too) and play with the Aztec "block". On iOS, the Aztec block is just a blue placeholder for now but, it should at least display as such.