{"id":21815719,"url":"https://github.com/shy2850/f2e-demo","last_synced_at":"2025-07-17T03:08:29.899Z","repository":{"id":149727170,"uuid":"118580179","full_name":"shy2850/f2e-demo","owner":"shy2850","description":"ReactRouter project Build By f2e-server \u0026\u0026 Typescript","archived":false,"fork":false,"pushed_at":"2018-01-26T12:14:05.000Z","size":44,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-14T00:57:13.730Z","etag":null,"topics":["f2e-server","immutable","react","reactredux","reactrouter","requirejs","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/shy2850.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-01-23T08:22:56.000Z","updated_at":"2018-08-02T01:03:33.000Z","dependencies_parsed_at":null,"dependency_job_id":"39ae05fb-edde-4a0d-b0f3-e381d9d96c40","html_url":"https://github.com/shy2850/f2e-demo","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/shy2850/f2e-demo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shy2850%2Ff2e-demo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shy2850%2Ff2e-demo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shy2850%2Ff2e-demo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shy2850%2Ff2e-demo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/shy2850","download_url":"https://codeload.github.com/shy2850/f2e-demo/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/shy2850%2Ff2e-demo/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265562312,"owners_count":23788504,"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","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":["f2e-server","immutable","react","reactredux","reactrouter","requirejs","typescript"],"created_at":"2024-11-27T15:22:10.805Z","updated_at":"2025-07-17T03:08:29.869Z","avatar_url":"https://github.com/shy2850.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# f2e-server demo project\n使用 [f2e-server](https://github.com/shy2850/f2e-server) 构建的简易 React 项目脚手架\n主要技术栈包括 `react react-router immutable`, 模块化方案基于 `requirejs`\n\n## Special list\n项目主要特点包括:\n1. 内置基于 [immutable](http://facebook.github.io/immutable-js/docs/#/) 实现了一个简易版本的 [react-redux](./src/store.ts) static-API:\n    - dispatch(state=\u003estate)\n    - getState()\n    - connect(mapStateToProps)(Component)\n2. 项目配置简单, 所有配置参见: [.f2econfig.js](./.f2econfig.js)\n3. 基于Typescript可以做到前后端接口同构开发\n4. 不做模块解析，虽然给模块引入带来不便，但提高了构建速度\n5. 提供了一些基本的服务端接口模拟方式，包括 json/jsonp/server-sent\n\n## Download and Start\n```bash\ngit clone https://github.com/shy2850/f2e-demo\ncd f2e-demo\nnpm install\nnpm start\n```\n\n## f2e-server utils\nf2e-server 常用功能\n1. 通过 `$include[filePath]` 引入文本资源，所有第三方库都是通过这个方式引入\n    - 如 `$include[immutable.js]` 同目录存在 `.min`文件，build模式下自动加载 `.min`文件\n    - 不存在时可以使用 `$include[react.development.js][react.production.min.js]` 表示 \n2. 模板引擎 在配置中添加 `middlewares: [{middleware: 'template'}]` 可以开启lodash模板引擎支持在任意文本资源中使用`\u003c%-JavaScript代码%\u003e`\n3. 参考 [serve/index.ts](./serve/index.ts) 书写服务端接口，方便前端使用\n4. 如果需要直接代理某服务端接口，还可以从这里找 `proxy` [https://github.com/shy2850/f2e-middleware](https://github.com/shy2850/f2e-middleware)\n\n\n## Typescript\n项目主要使用 [Typescript](https://www.tslang.cn) 构建\n- 前后端代码均使用 [interface.ts](./interface.ts) 作为顶层接口文件, 同构开发。\n- 前端代码目录为 [src](./src)\n    1. 通过 [f2e-middle-typescript](https://github.com/shy2850/f2e-middleware/tree/master/typescript)使用配置文件 `tsconfig.json`, 并设置了 `getModuleId` 用来为所有模块添加唯一ID\n    2. `建议`: 不需要进行`jsx`编译的文件使用 `.ts`后缀 否则使用 `.tsx`\n- 服务端代码目录为 [serve](./serve)\n    1. serve端代码通过 `tsc`(typescript-cli) 编译， 参见 [package.json](./package.json) scripts.tsc\n    2. 代码运行时输出目录为: `dist`\n\n\n## END\n\u003e 正则是需要的","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshy2850%2Ff2e-demo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fshy2850%2Ff2e-demo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fshy2850%2Ff2e-demo/lists"}