在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):benoitvallon/react-native-nw-react-calculator开源软件地址(OpenSource Url):https://github.com/benoitvallon/react-native-nw-react-calculator开源编程语言(OpenSource Language):JavaScript 91.6%开源软件介绍(OpenSource Introduction):Mobile, desktop and website Apps with the same codeThis project shows how the source code can be architectured to run on multiple devices. As of now, it is able to run as:
A demo for the Website App is available here. ScreenshotsMobile Apps (iOS & Android)Desktop Apps (NW & Electron)Website AppLibraries/toolsThis project uses libraries and tools like:
Basic philosophyAll the code is contained in the
Flux architecture actions/storesAll the flux architecture is share to 100% to all the different builds. This means that all the logic and data management code is done only once and reuse everywhere. This allows us to have an easy tests suite as well and to ensure that our code is working properly on all the devices. ComponentsThe real interest of the project is in how the components have been structured to shared most of their logic and only redefined what is specific to every device. Basically, every component has a main The At the end, every component is defined by 6 files. If we look at the screen component, here is its structure.
And here is the main 'use strict';
import Base from './ScreenBase';
import Render from './ScreenRender';
export default class Screen extends Base {
constructor (props) {
super(props);
}
render () {
return Render.call(this, this.props, this.state);
}
} What's nextHere are some thoughts about what can come next:
Thank you Robert for your awesome designI want to thank Robert O'Dowd who kindly authorized me the reuse his very beautiful design. The original design made by Robert was part of his project called "Simplifycation" visible here. How to build/run the projectsGeneral requirements before running any specific project
With some versions of npm (>=v3.3.10 <=v3.6.0)Some builds from npm included bugs while
The Mobile Apps (iOS & Android)Requirements for React NativeiOS
Android
Running the Mobile AppsiOS
Android
Congratulations! You've just successfully run the project as an iOS or Android App. The Website AppRequirements for ReactThere isn't any additional requirements since you already installed the deps with Quick start
Congratulations! You've just successfully run the project as a Website App. The Desktop AppYou can either run the project with NW or electron. Requirements for NWTo run the project, you are supposed to run something like:
On OSX, the executable binary is in a hidden directory within the .app file. The easier solution to install it is to download the app on http://nwjs.io/ then copying it to your application folder. You will now be able to run:
You can also setup an alias to call the binary.
Quick start with NW
Congratulations! You've just successfully run the project as a Desktop App. Quick start with Electron
Congratulations! You've just successfully run the project as a Desktop App. Run the testsTo run the tests, simply run:
|
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论