Commit Graph

412 Commits

Author SHA1 Message Date
Devon Govett
5af85c5ef6 Inline some isUndefined calls 2015-10-03 23:14:04 -07:00
Devon Govett
0f5d3ae8f0 Don't use the in operator 2015-10-03 23:13:33 -07:00
Devon Govett
39b45c65c1 Speed up margin/padding/border lookups 2015-10-03 23:11:09 -07:00
Christopher Chedeau
948241b659 Merge pull request #136 from getsetbro/patch-1
Update README.md
2015-10-02 15:51:43 -07:00
Seth Broweleit
2cf795c118 Update README.md
"alignContent" is not supported - see image: https://raw.githubusercontent.com/getsetbro/images/gh-pages/screenshots/reactnative.no.flexbox.aligncontent.png
2015-10-02 16:36:29 -05:00
Christopher Chedeau
9eb00949ae Merge pull request #135 from pragmatrix/csharp5-pr
Don't use C#6 language features for the time being
2015-09-30 09:21:05 -07:00
Armin Sander
2e908bfdee don't use C#6 language features for the time being 2015-09-30 07:57:59 +02:00
Christopher Chedeau
cefd6ccb96 Merge pull request #134 from vjeux/fix_dim_0
Fix width being ignored when has a value of 0
2015-09-25 14:43:52 -07:00
Christopher Chedeau
e280a577ae Fix width being ignored when has a value of 0
8f6a96adbc added a test in isDimDefined that checks if `value > 0.0`, but unfortunately, it did not faithfully port the JavaScript version which is `value >= 0.0`. Sadly, no test covered this so it went unnoticed.
2015-09-25 13:10:21 -07:00
Christopher Chedeau
246005cc84 Update dist/ to be the latest version 2015-09-24 11:56:18 -07:00
Christopher Chedeau
4ca2ea3466 Merge pull request #129 from pragmatrix/csharp-fb-pr
C# Transpiler, API, and Tests
2015-09-23 09:08:15 -07:00
Armin Sander
4de0721a24 C# transpiler, API, and tests 2015-09-23 09:27:45 +02:00
Lucas Rocha
4ef24028be Merge pull request #126 from AaaChiuuu/master 2015-09-16 08:20:50 +01:00
Aaron Chiu
a353a11bf4 Merge pull request #1 from AaaChiuuu/publicConstants
Make CSSLayout constants public
2015-09-15 11:43:10 +01:00
Aaron Chiu
4a7936aa24 Make CSSLayout constants public 2015-09-15 11:42:30 +01:00
Aaron Chiu
f51c2d004d Merge pull request #123 from lucasr/omg-faster-flexbox
Even faster flexbox
2015-09-15 04:37:43 +01:00
Lucas Rocha
e43a8b28d6 Add 'package' comment in CSSNode for consistency 2015-09-14 18:23:36 +01:00
Lucas Rocha
cf94d35b51 Implement cascasing checks via bitwise flags
It turns the spacing resolution in Java is fairly expensive right now
because it doesn't a bunch of unnecessary checks in the array,
especially when the Spacing instance doesn't have any values set on it.

This diff changes Spacing to store the state of the defined values in a
bitwise flag so that padding/border/margin queries are a lot faster
during layout calculations. This gives us as extra 20% performance win
in my local benchmarks on Android
2015-09-14 18:23:36 +01:00
Lucas Rocha
ebc56fee59 Inline private methods at build time in Java
Unfortunately, Java doesn't have any build-time inlining solution and
method invocations do have a big performance impact on Android. This
changes Java's transpiler to inline almost all internal methods at build
time. This gives us a 30% performance win in my local benchmarks.

There's a drawback from moving code to the transpiler but I think this
is worth it (given the massive perf wins here) and the inlined methods
are fairly simple.
2015-09-14 18:23:36 +01:00
Christopher Chedeau
2120285467 Merge pull request #122 from lucasr/even-faster-flexbox
Even faster flexbox
2015-09-10 14:25:41 -07:00
Lucas Rocha
765ff8463e Add fast path for simple stack layouts
Change the initial line loop to opportunistically position children in
the in container with simple stacking params i.e. vertical/horizontal
stacking on non-flexible STRETCH/FLEX_START aligned. This allows us to
skip the main and cross axis loops (Loop C and D, respectively)
partially and even completely in many common scenarios.

In my benchamrks, this gives us about ~15% performance win in many
setups.
2015-09-10 11:19:28 +01:00
Lucas Rocha
2d869489ef More efficient resetResult() loop in LayoutEngine 2015-09-10 11:19:28 +01:00
Lucas Rocha
909c14117f Fix dimension check for STRETCH children
The correct check is on the layout state, no the style.
2015-09-10 11:19:28 +01:00
Lucas Rocha
9a149c83ff Avoid extra work when justifyContent is FLEX_START
Remaining space and between space only need to be updated when
justifyContent is not FLEX_START.
2015-09-10 11:19:28 +01:00
Lucas Rocha
2321165d53 Move condition to the non-redundant block
No need to check for RELATIVE position when position type is ABSOLUTE
and dimension is set.
2015-09-08 15:34:51 +01:00
Lucas Rocha
d1a49a4f0b Reduce search range of flexible children
We were traversing all children to only perform calculations/changes to
flexible children in order to avoid new allocations during layout. This
diff ensures we only visit flexible children during layout calculations
if any are present. We accomplish this by keeping a private linked list
of flexible children.
2015-09-08 15:34:51 +01:00
Lucas Rocha
793220faf8 Skip final loop on absolute children, if possible
There's no need to go through all absolute children at the end of the
layout calculation if the node at hand doesn't have any. This also
ensures only absolutely positioned children are traversed in the final
loop.
2015-09-08 15:34:51 +01:00
Lucas Rocha
996f2a03d5 Merge pre-fill loop into main line loop
There's no need to go through all children before starting the main line loop
as we'll visit all children in the former loop anyway. This diff merges the
pre-fill loop into the main line one to avoid an extraneous traversal on the
node's children.
2015-09-08 15:34:27 +01:00
Lucas Rocha
877a2838a6 Skip trailing position loop, if possible
There's no need to set the trailing position on left-to-right layouts
as the nodes will already have what we need (x, y, width, and height).
This means we still have an extra cost for reversed layout directions
but they are not as common as LTR ones.
2015-09-08 15:33:26 +01:00
Lucas Rocha
1ab785b7a3 Inline immutable values in layout algorithm
Store immutable values from the node being laid out to avoid unnecessary
method invocations during layout calculation. This gives us a 3%-5%
performance boost in my benchmarks on Android.
2015-09-08 15:15:52 +01:00
Lucas Rocha
06c708053f Change Java to use array indexes instead of methods
Method invocations are not entirely free on Android. Change the
generated Java code to use the same array-based approach used in
JS and C to compute dimensions, positions, etc instead of relying
too heavily on method invovations. As a bonus, the Java transpiler
becomes a lot simpler because the code is more analogous to the C
counterpart.

In my local benchmarks this change gives us a major performance
boost on Android (between 15% and 30%) depending on the device
and the runtime (Dalvik|Art).
2015-09-08 15:15:46 +01:00
Colin Eberhardt
486b9a84bf 1.0.0 v1.0.0 2015-09-08 07:45:08 +01:00
Colin Eberhardt
00c8428015 Merge pull request #119 from ColinEberhardt/keywords
Keywords
2015-09-01 06:51:59 +01:00
Colin Eberhardt
ecb8f8e610 Added layout keyword 2015-09-01 06:10:34 +01:00
Colin Eberhardt
baf34484fe Updated repo to include cdnjs / npm instructions 2015-08-31 22:15:46 +01:00
Colin Eberhardt
5dd1482148 Minor build change
removed duplication of the step that creates the 'dist' folder
2015-08-31 22:09:30 +01:00
Colin Eberhardt
9d1abd8d51 added keywords 2015-08-31 22:05:14 +01:00
Christopher Chedeau
e6d3aea73d Merge pull request #117 from paramaggarwal/watch
Watch for changes and run tests during development using `grunt watch`.
2015-08-28 09:49:46 -07:00
Param Aggarwal
f9d308f923 Watch for changes and run tests during development using grunt watch. 2015-08-28 22:15:57 +05:30
Colin Eberhardt
68d45b4b9a 0.0.6 v0.0.6 2015-08-21 11:05:20 +01:00
Colin Eberhardt
99f44302fe Giving up on travis!
OK, Travis you have defeated me! reverting to a more manual release process
2015-08-21 11:04:46 +01:00
Colin Eberhardt
1e9a212799 0.0.5 v0.0.5 2015-08-21 09:20:12 +01:00
Colin Eberhardt
ca5490bdc5 updated npm login details - again! 2015-08-21 09:19:56 +01:00
Colin Eberhardt
0a80d40351 0.0.4 v0.0.4 2015-08-21 09:10:17 +01:00
Colin Eberhardt
d3c891f39a Updated the release process
Trying base64 encoded npm credentials
2015-08-21 08:59:49 +01:00
Colin Eberhardt
9c31f68f2e 0.0.3 release 0.0.3 2015-08-18 19:38:46 +01:00
Colin Eberhardt
ee6cf7129e Merge pull request #113 from ColinEberhardt/ci-releases
Added npm deploy when tags are pushed
2015-08-18 19:34:18 +01:00
Colin Eberhardt
eef605c221 Added npm deploy when tags are pushed 2015-08-17 21:48:57 +01:00
Colin Eberhardt
f85393fb01 Merge pull request #112 from ColinEberhardt/package-json-fix
Package json fix
2015-08-17 21:26:41 +01:00
Colin Eberhardt
fefc7b7496 Fixed variable name error
(should have run the code before commiting!)
2015-08-17 17:16:18 +01:00