Uncategorized

Compare Popular React Native Component Libraries

In this post I’d like to compare three popular React Native(“RN”): NativeBase, Shoutem and React Native Elements. Create an app on Expo. The app contain three screen: Make an wordpress REST API call to render list of post, rendering a post(HTML) and a login Form. To compare their UI and usage, not include quality of source code and compatibility across the platform/device. NativeBase GitHub: https://github.com/GeekyAnts/NativeBase npm: npm install native-base –save Demo: NativeBase-demo List Login NativeBase has the most components. The other two libraries not have Drawer, FABs, Footer Tabs etc. NativeBase uses more JSX and less props which makes it flexible. Frontend engineers not hard to get started due to components named as HTML element(Content/Header/Footer). Even has Container to replace RN’s View. Seem NativaBase likes Boostrap on RN: It’s simple and abundant but these are some of the problems you could encounter when you have extra requirements. Shoutem GitHub: https://github.com/shoutem/ui npm: npm install @shoutem/ui –save Demo: shoutem-ui-demo List WebView/HTML Shoutem has the most beautiful UI. To be precise, it’s Shoutem UI toolkit, to belong to Shoutem platform which has theme and animation libraries. By contrast with NativeBase, components of Shoutem have many props. For example, passing data to Listview will be render items. Shoutem seem not attach importance to their open source projects: the documentation is still lacking and not update often. BTW, Html component is excellent for render HTML code. It could be worth a look. React Native Elements GitHub: https://github.com/react-native-training/react-native-elements npm: npm install react-native-elements –save Demo: react-native-elements-demo Native Elements because is the first RN component library I used because it has the most Stars in GitHub. At that time, I wanted to do some style beautification after using RN to complete the App function. It was enough for me. But it seem has no advantage compared others. The component is not as rich as NativeBase; the style details are not as good as Shoutem. If I have to find a feature: You can comfortable use it due to React Native Elements is completely community-driven and MIT Licence. List WebView/HTML Login

Continue Reading
Uncategorized

Index of ReactJS Source Code

React's design is often discussed, but because of the many related documents, the source code reads more tired.Just recently saw under the Hood:reactjs this project shared a flowchart of the React Core code (MIT Protocol), taking several of them as a directory index when writing this article for reading source. The article is divided into 4 parts: Reactdom.render&reactmount Transaction Mount This.setstate Source code to v15.6.1 as an example, will not directly copy a large segment of coding, mainly with hyperlinks to the GitHub source corresponding to the location-usually linked to the location of the function is called, a few cases will be linked to the location of the statement.The core code will of course involve vdom and event agents, online related articles are very many, this article no longer repeat, the official documents already have content will try to omit.The flowchart is an SVG format, and the graphic fill color uses different colors depending on the file.Embedded with an IFRAME tag.This is the best way to compatibility, but do not know where this article will be taken to the crawler, and the various RSS reader support, so attach the original address: dmyz.org/archives/983

Continue Reading
Uncategorized

AES Between Python, Javascript(NodeJS) and PHP

AES Wikipedia: https://en.wikipedia.org/wiki/Advanced_Encryption_Standard. AES needs Key, IV and PKCS. Use 256 bits key length, Python can auto choice by key length your passed. Named MCRYPT_RIJNDAEL_128 in PHP5, Nodejs/PHP7.1 is aes-256-cbc. Use CBC mode due to ECB no IV. Key is AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA (256 bits),IV is AAAAAAAAAAAAAAAA(128bits). Python use pycrypto(pip install pycrypto),NodeJS require crypto(npm install crypto),PHP5 need mcrypt. Python

Javascript(NodeJS)

PHP

Testing Environment: Ubuntu 14.04.2, Python 2.7.6, NodeJS v0.10.25, PHP 5.5.9

Continue Reading