电子反应海模板
最编程
2024-03-31 20:54:39
...
electron-react-umi-tpl
English Version
electron 8.2
+ umi 3.1
+ typescript react 16.12
+ redux
+ antDesign 4.0
+ eslint tslint react-tslint
脚手架, 下载即用,已经为你做好了基座设施
客户端集成:
- 自动更新(electron-builder)
- 托盘菜单
- app启动loading加载条
- electron打印(electron 5.0以上支持)
- 灰度发布方案
- electron-log 本地日志
- electron-store 本地存储
- app打包图标
TODOLIST: 1. app崩溃信息采集
2. app消息通知,快捷键等
web端:
- 基于umi脚手架,基础配置已集成,开发者关注业务代码编写即可
- 本地存储redux(redux-saga)
- antDesign >= 4.0
- iconfont图标
- 菜单配置
src/layouts/menu/config.tsx
TODOLIST: 1. node Api功能封装与渲染进程业务解耦
开启
npm i
npm start
npm run pack
目录树
|-- project
|-- .editorconfig
|-- .eslintrc.js
|-- .gitignore
|-- .gitlab-ci.yml
|-- .prettierignore
|-- .prettierrc.js
|-- directoryList.md
|-- package-lock.json
|-- package.json
|-- README.md
|-- tsconfig.json
|-- typings.d.ts
|-- eslint-rules 自定义eslint配置
| |-- base.js
| |-- react.js
| |-- ts.js
|-- src
|-- main 主进程
| |-- app-update.yml 生产环境自动更新配置
| |-- bundle.js 自动生成
| |-- bundle.js.map
| |-- dev-app-update.yml 开发环境自动更新配置
| |-- index.js 入口
| |-- loading.html
| |-- preload.js
| |-- README.md
| |-- config 编译配置
| | |-- config.js
| | |-- webpack.config.js
| |-- controls 控制集
| | |-- AppAutoUpdater.js
| | |-- AppMainWindow.js
| | |-- AppTray.js
| | |-- electron-helper.js
| |-- print 打印
| | |-- print.html
| | |-- print.js
| |-- public 附件
| | |-- icon.ico
| | |-- icon.png
| | |-- tray.png
| |-- script 编译脚本
| |-- build.js
|-- render 渲染进程
|-- .env
|-- .umirc.ts
|-- app.ts
|-- global.less
|-- README.md
|-- .umi umi自动生成配置和插件等
| |-- umi.ts
| |-- core
| |-- plugin-dva
| |-- plugin-initial-state
| |-- plugin-model
| |-- plugin-request
|-- api 接口集合
| |-- api.list.ts
|-- assets 附件
| |-- image
| | |-- yay.jpg
| |-- style
| |-- bootstrap-part.less
| |-- common.less
|-- common 通用
| |-- enum.ts
| |-- global.ts
|-- components 组件
| |-- readme.md
| |-- AutoUpdate
| | |-- index.tsx
| | |-- style.less
| |-- FormCps
| | |-- index.tsx
| | |-- readme.md
| |-- TableCps
| |-- index.tsx
| |-- readme.md
|-- config 配置
| |-- iconfont.ts
| |-- menus.tsx
|-- dist 本地打包生成文件
|-- layouts 布局
| |-- index.less
| |-- index.tsx
| |-- header
| | |-- index.less
| | |-- index.tsx
| |-- loading
| | |-- index.less
| | |-- index.tsx
| |-- menu
| |-- index.less
| |-- index.tsx
|-- mock
| |-- foo.ts
|-- models redux
| |-- xxStore.ts
|-- pages
| |-- home.normal.less
| |-- index.tsx
| |-- Foo 示例
| | |-- index.tsx
| | |-- components
| | | |-- TableList.tsx
| | |-- models
| | | |-- foo.ts
| | |-- services
| | |-- foo.ts
| |-- Home 业务
| |-- Edge
| | |-- index.tsx
| |-- Settings
| |-- index.tsx
|-- utils 工具集
eslint
默认开启alloy配置eslint-config-alloy
log
- 本地调试日志
const log = require('electron-log');
// log.transports.file.file = 'xx/record.log' 本地可指定文件
// 默认日志存放
// on Linux: ~/.config/{appName}/log.log
// on macOS: ~/Library/Logs/{appName}/log.log
// on Windows: user\AppData\Roaming\{appName}\log.log
log.info('Hello, log');
log.warn('Some problem appears');
注意事项
- 下载依赖和打包运行错误,请用cnpm或者配置npm config的electron ERROR路径
- 任何地方的component文件夹名不可首字母大写 会被umi识别为路由而影响热加载等
- 卡在node install.js : npm config edit 添加:electron_mirror="https://npm.taobao.org/mirrors/electron/"
原文地址:https://www.cnblogs.com/mapleChain/p/12906098.html
上一篇: 边缘浏览器的快捷方式在哪里?
推荐阅读
-
使用 Foxmail 自定义电子邮件模板
-
电子反应海模板
-
小红书大产品部架构 小红书产品概览--经过性能、稳定性、成本等多个维度的详细评估,小红书最终决定选择基于腾讯云星海自研硬件的SA2云服务器作为主力机型使用。结合其秒级的快速扩缩、超强兼容和平滑迁移能力,小红书在抵御上亿次用户访问、保证系统稳定运行的同时,也实现了成本的大幅降低。 星海SA2云服务器是基于腾讯云星海的首款自研服务器。腾讯云星海作为自研硬件品牌,通过创新的高兼容性架构、简洁可靠的自主设计,结合腾讯自身业务以及百万客户上云需求的特点,致力于为云计算时代提供安全、稳定、性能领先的基础架构产品和服务。如今,星海SA2云服务器也正在为越来越多的企业提供低成本、高效率、更安全的弹性计算服务。 以下是与小红书SRE总监陈敖翔的对话实录。 问:请您介绍一下小红书及其主要商业模式? 小红书是一个面向年轻人的生活方式平台,在这里,他们发现了向上、多元的真实世界。小红书日活超过 3500 万,月活跃用户超过 1 亿,日均笔记曝光量达 80 亿。小红书由社交平台和在线购物两大部分组成。与其他线上平台相比,小红书的内容基于真实的口碑分享,播种不止于线上,还为线下实体店赋能。 问:围绕业务发展,小红书的系统架构经历了怎样的变革和演进? 系统架构变化不大,影响最深的是资源开销。过去三年,资源开销大幅增加,同比增长约 10 倍。在此背景下,我们努力进行优化,包括很早就开始使用 K8S 进行资源调度。到 18 年年中,绝大多数服务已经完全实现了容器化。 问:目前小红书系统架构中的计算基础设施建设和布局是怎样的? 我们目前的建设方式可以简单描述为星型结构。腾讯云在上海的一个区是我们的计算中心,承载着我们的核心数据和在线业务。在外围,我们还有两个数据中心进行计算分流,同时承担灾备和线上业务双活的角色。 与其他新兴电子商务互联网公司类似,小红书的大部分计算能力主要用于线下数据分析、模型训练和在线推荐等平台。随着业务的发展,对算力的需求也在加速增长。
-
HTML | 分享一些 HTML 电子邮件样式模板
-
2024 图表分析网页模板大数据可视化大屏幕电子沙盘集合包含金融行业智慧大厅智慧交通智慧门店智慧物流智慧社区