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

Introducting WebAssembly rendering and ReactApeTree #124

Closed
wants to merge 3 commits into from

Conversation

raphamorim
Copy link
Owner

@raphamorim raphamorim commented Jun 22, 2022

Summary

This PR introduces two new features to the React Ape render:

  • WASM render
  • ReactApeTree

Below the explanation/overview for each of the features

ReactApeTree Overview

Since React Ape render using canvas, it can't properly read parent styles correctly. The idea behind this PR is to reduce issues regarding hierarchy, those problems makes the App looks super weird unless you rule/specify intentionally in every View which style it should carry (it's how Ape works nowaday unfortanelly).

This PR introduces a tree that contains the layout and style property for each node, so can easily propagate it between children

Related #67

Known issues:

  • Text style hierarchy doesn't work (it should render in orange)
  • View positions aren't correctly geometrically
  • View backgroundColor isn't correct, 2nd View should have same bgc as 1st and also 4th should have same as 3rd

Demo

return (
  <View style={{width: 80, height: 80, backgroundColor: 'grey', color: 'orange'}}>
    <View>
      <View style={{width: 80, height: 80, backgroundColor: 'powderblue'}}>
        <View
          style={{
            width: 30,
            height: 30
          }}>
          <Text>should be in orange</Text>
        </View>
      </View>
    </View>
  </View>
);

Before

Skärmavbild 2022-06-22 kl  06 46 07

After

Usage of _reactApeTree when process.env.NODE_ENV !== 'production'

Screen Shot 2022-07-11 at 19 52 03

@raphamorim raphamorim self-assigned this Jun 22, 2022
@raphamorim raphamorim added the bug Something isn't working label Jun 22, 2022
@raphamorim raphamorim added this to the 0.2.0 milestone Jun 22, 2022
@raphamorim raphamorim changed the title intial approach for style hierarchy fix ReactApeTree ~ style hierarchy fix Jul 11, 2022
@raphamorim raphamorim changed the title ReactApeTree ~ style hierarchy fix Introducting WebAssembly rendering and ReactApeTree Jul 12, 2022
@raphamorim raphamorim added the enhancement New feature or request label Jul 12, 2022
@raphamorim raphamorim closed this Jul 12, 2022
@raphamorim raphamorim deleted the style-hierarchy branch July 12, 2022 12:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

1 participant