Introducing WebAssembly, Specs, ReactApeTree and Platform module #129
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.
Summary
This PR introduces:
Below the explanation/overview for each of the features
Specs
This pull request introduces specs. Specs are formal agreement and documentation regarding React Ape Elements behavior, example below:
Render with WASM/Canvas (fallback to JS/Canvas)
More information soon.
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:
Demo
Before
After
Usage of
_reactApeTree
whenprocess.env.NODE_ENV !== 'production'
Platform
When building a cross-platform app, you'll want to re-use as much code as possible. You'll probably have different scenarios where different code might be necessary.
For instance, you may want to implement separated visual components for
LG-webOS
andSamsung-Tizen
.This PR also introduces the Platform module to easily organize your code and separate it by platform: