{"id":29894238,"url":"https://github.com/worldzhao/music-react","last_synced_at":"2025-08-01T04:46:08.750Z","repository":{"id":39577855,"uuid":"115209186","full_name":"worldzhao/music-react","owner":"worldzhao","description":"An online music player project which was built by react.","archived":false,"fork":false,"pushed_at":"2023-01-03T20:27:02.000Z","size":8405,"stargazers_count":60,"open_issues_count":26,"forks_count":24,"subscribers_count":2,"default_branch":"master","last_synced_at":"2023-03-02T22:37:11.578Z","etag":null,"topics":["netease-cloud-music","react","react-router-v4","redux"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/worldzhao.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-12-23T16:51:07.000Z","updated_at":"2022-08-30T05:55:12.000Z","dependencies_parsed_at":"2023-02-01T09:46:59.264Z","dependency_job_id":null,"html_url":"https://github.com/worldzhao/music-react","commit_stats":null,"previous_names":[],"tags_count":null,"template":null,"template_full_name":null,"purl":"pkg:github/worldzhao/music-react","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/worldzhao%2Fmusic-react","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/worldzhao%2Fmusic-react/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/worldzhao%2Fmusic-react/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/worldzhao%2Fmusic-react/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/worldzhao","download_url":"https://codeload.github.com/worldzhao/music-react/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/worldzhao%2Fmusic-react/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268171719,"owners_count":24207418,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-01T02:00:08.611Z","response_time":67,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["netease-cloud-music","react","react-router-v4","redux"],"created_at":"2025-08-01T04:46:04.711Z","updated_at":"2025-08-01T04:46:08.691Z","avatar_url":"https://github.com/worldzhao.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# music-react\n\n\u003e 本项目基于[violet-cli](https://github.com/worldzhao/violet-cli)移动端项目模板生成\n\u003e UI 参考：[mango-music](https://github.com/code-mcx/mango-music)\n\u003e API 来源：[NeteaseCloudMusicApi](https://github.com/Binaryify/NeteaseCloudMusicApi)\n\n欢迎 star ✨\n\nPC 端代码见分支`feature/pc`，代码 emmm...，刚接触 react 的时候写的，一言难尽。\n\n## 基本命令\n\n```\nyarn start | yarn dev 启动开发环境\nyarn build       打包生产环境\nyarn build:analyze    进行打包分析\n```\n\n## 技术栈\n\n- 开发语言：typescript\n- 基础库：react(with hooks)\n- UI 库：[dora-ui](https://github.com/worldzhao/dora-ui)\n- 状态管理：[rematch](https://github.com/rematch/rematch)\n- 移动端布局：rem 布局(使用 post-css 插件使用)\n- 其他：[immer.js](https://github.com/immerjs/immer)\n\n## 性能（体验）优化\n\n- 代码分割（`code splitting`）：基于`React.lazy`与`Suspense`（为了加快开发环境热更新速度，使用[babel-plugin-dynamic-import-node](https://github.com/airbnb/babel-plugin-dynamic-import-node)将 `import()`转义为 `require()`）；\n- 图片懒加载：带图列表场景较多，使用 [react-lazyload](https://github.com/twobin/react-lazyload) 实现图片懒加载；\n- 减少 `re-render`：immer.js 搭配 PureComponent/React.memo/React.useMemo 减少父组件`render`所导致的子组件无意义 `re-render`（tips：可使用 [react-devtools](https://github.com/facebook/react-devtools) 查看组件 render 状态，点击右上角 ⚙ 即可配置）；\n- 长缓存（long-term caching）：基于 `content hash` 生成打包文件名，非覆盖发布配合长缓存提高用户体验（推荐阅读：[大公司里怎样开发和部署前端代码？](https://www.zhihu.com/question/20790576/answer/32602154)）；\n- 滚动：基于 better-scroll 封装 Scroll 组件以提供接近原生的滚动体验（参考：[mango-music](https://github.com/code-mcx/mango-music)，推荐阅读：[React 全家桶构建一款 Web 音乐 App 实战（三）：推荐页开发及公用组件封装](https://juejin.im/post/5a3a6c12f265da4325297408)）；\n- 动画：基于 react-transition-group 实现路由切换动画与其他细节动画（推荐阅读：[一次 react-router + react-transition-group 实现转场动画的探索](https://juejin.im/post/5cb1e4275188251ace1feee9)）；\n- loading 闪烁：极短时间内的 loading 会一闪而过，体验较差。此处结合`@rematch/loading`插件以及 dora-ui 中的 Spin 组件 delay 属性进行优化。\n\n## 其他\n\n- husky: eslint/commit lint\n- dev: proxy/mock\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fworldzhao%2Fmusic-react","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fworldzhao%2Fmusic-react","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fworldzhao%2Fmusic-react/lists"}