feat(css): Added optional css-tree parser#8076
Conversation
680e0f4 to
5eb7569
Compare
|
This is awesome. Do we have some times comparing the 2 parsers you've given with the one at: https://github.com/nativescript/css-parser |
|
@pana-cc, yes I have compared the performance of the two parsers using the new V8 based iOS runtime. As a reference for my tests I used a pretty large CSS file (192KB from the bootstrap project):
The big difference comes from the fact that the css-parser uses regular expressions which are not very efficient when V8 runs in jitless mode (iOS). I have found that css-tree is the fastest possible javascript based CSS parser in this scenario. Until we implement a CSS parser in pure C++, css-tree seems to be efficient enough and also standards compliant. |
|
I was going to add the css-parser to benchmarks but that's totally pointless now. Real iron is what only matters. Back in the time when I was writing css-parser iOS was not running on V8. Good job! |
5eb7569 to
680b6b6
Compare
680b6b6 to
ad16c5c
Compare
|
test --ignore branch-animations#myankov/css-tree branch-groceries#myankov/css-tree api24 ios12 |
2 similar comments
|
test --ignore branch-animations#myankov/css-tree branch-groceries#myankov/css-tree api24 ios12 |
|
test --ignore branch-animations#myankov/css-tree branch-groceries#myankov/css-tree api24 ios12 |
99705bf to
67c1e96
Compare
|
test --ignore branch-animations#myankov/css-tree branch-groceries#myankov/css-tree api24 ios12 |
1f08bf8 to
edd0cbc
Compare
|
test --ignore branch-animations#myankov/css-tree branch-groceries#myankov/css-tree api24 ios12 |
* feat(css): Added optional css-tree parser * test: css-tree parser compat tests * test: more css-tree compat tests
* feat: add 3d rotation * chore: fix build errors * chore: fix tslint errors * chore: add @types/chai dev dep * chore: unused import cleanup * chore: update tests for x,y rotation * chore: rebase upstream/master * fix: iOS Affine Transform test verification * feat(css): Added optional css-tree parser (#8076) * feat(css): Added optional css-tree parser * test: css-tree parser compat tests * test: more css-tree compat tests * feat(dialogs): Setting the size of popup dialog thru dialog options (#8041) * Added iOS specific height and width attributes to ShowModalOptions * Set the height and width of the popup dialog to the presenting controller * dialog options ios attributes presentationStyle, height & width are made optional * Updated NativeScript.api.md for public API changes * Update with git properties * Public API * CLA update * fix: use iOS native-helper for 3d-rotate * test: Fix tests using _getTransformMismatchError * fix: view.__hasTransfrom not set updating properly * test: fix css-animations test page Co-authored-by: Alexander Vakrilov <alexander.vakrilov@gmail.com> Co-authored-by: Darin Dimitrov <darin.dimitrov@gmail.com> Co-authored-by: Shailesh Lolam <slolam@live.com> Co-authored-by: Dimitar Topuzov <dtopuzov@gmail.com>
PR Checklist
What is the current behavior?
The developer can choose between
reworkandnativescriptcss parsers (rework being the default)What is the new behavior?
The developer can choose between
rework,nativescriptandcss-tree(rework being the default)According to benchmarks, css-tree is the fastest available css parser written in javascript at the moment. It is orders of magnitude faster than the default rework parser.