作者:林不渡 https://juejin.cn/post/6935670539088461855最近在知乎看到了这么个问题:学完Vue还有必要学习React和Node吗?[1], 有很奇妙的感觉,因为我在最开始入门前端时,也是以Vue入的门,在“学完”Vue之后, 我也有了类似的疑问,但当时的我没多想,觉得“技多不压身”,反正都是前端,以后肯定用得上,那就学呗。
结果我一路到现在都是处于这么一种状态:看到一个新的框架—看看文档和场景—嗯哼,不错—学! 虽然这样也造成我目前没有特别深入的方向,比如21届的大佬们在工程化、微前端、AST、NodeJS等等方向都已经开始深耕,我还在追着各种新框架学当弟弟,但不得不说,在学习新事物的过程中,你会逐渐对这些框架进行分类(比如我下面进行的归类),提取他们的共同点,这样在开始学习一个新东西时,你通常已经拥有了可复用的经验(比如在之前我感兴趣的研究了一些装饰器相关,使得后面入门Nest/Angular等都特别快),所以你的学习能力通常会是越来越强的。
这个问题的题主很明显遇到了大部分同学入门前端时会遇到的困惑:怎么这个还没学完又看到说那个才是主流的,怎么这个版本还没吃透又来了一个break change的新版本,怎么前端出框架的速度这么快??
很简单,如果学有余力,学就是了。如果学不动了,就完全没必要盯着前沿方向学(虽然前端网红圈不是吹的),不要被“2021前端必备!再不学你就out了!” “学会这些,立刻月薪30k!”此类的标题迷花了眼,觉得不学就被人卷死了。就盯着一个方向甚至是一个框架吃透,在简历上,“了解过A、B、C,使用过D、E、F” 绝对不如 “深入了解A原理,精通B架构实现,C的collaborator/maintainer之一”。
但有一点请注意,学有余力不是因为当前方向浅尝辄止而学有余力,是在当前方向足够深入同时还学有余力~对于不知道学啥的同学,就有了这篇文章,我会在接下来罗列我深入/尝试/了解过的,认为值得学习的各个方向框架与工具类库,并且对它们做一个简要介绍。
对于我认为较为主流的则不会包含(如Vue与React框架本身这种~)。
ts-node-dev -r tsconfig-paths/register xxx/index.ts这一行命令即可~
夹带私货时间到 GraphQL是我稍微比较深入一点的方向,这里相关的类库也会多一些。
.graphql文件到语言可以直接使用的方法/类型定义,这个思想实际上各个语言都有,如Dart和Ruby等。在TS中这个工具的主要能力就是生成TS的类型定义,同时它的插件体系还提供了更多的额外能力,如Apollo-Client的插件,让你可以直接使用封装好的的useXXXQuery等,前端连查询语句都不用写了;又或者基于Schema生成TypeGraphQL的Class定义,这一波反向生成我直接好家伙。GraphQL Engine其实是一个非常神奇的方向,有点像REST那边的各种自动生成REST API的工具。简单地说,你提供一个数据库,GraphQL Engine会为你基于数据库的结构(可能这就是目前都支持PostgreSQL的原因?)生成GraphQL Schema、API、查询语句(Query/Mutation/Subscription都支持,并且是根据你的Schema组合来的)等,可以说是非常猛了。

Hasura还提供了前面说的GraphQURL作为client,hasura-code-gen来从Hasura服务生成TS代码,所以基本上可以用Hasura的生态做为一套方案了,包括我也有看到过一些创业公司就在使用Hasura(有提供企业级支持)。
最常见的方式:使用这些服务托管静态页面,然后域名解析到自己的。
import { QueryDocument } from "@app/graphql", 爽!还支持React、Gatsby、NextJS、普通Web应用等,甚至集成好了Jest、Cypress、StoryBook等。一体化框架指的是, 你的前后端项目放在同一个repo里(后端是Node),同时前端直接调用在后端定义的方法,由框架在编译时去自动的把前端对后端的方法调用转换成HTTP请求。这是最近前端还挺火热的一个方向,主要的基于Node的一体化框架主要有这么几个:
db.entity.create()这样去写数据库)。@ngrx/router-store;对于集合类型的适配:@ngrx/entity;副作用管理:@ngrx/effects,以及必不可少的schematics:@ngrx/schematics等,最大的优势是和RxJS的深度集成。pre-commit执行linter和prettier,commit-msg检查commit信息,pre-push构建、打tag、发包、运行测试等等。以上就是我 关注/接触/尝试/深度使用 过的大部分框架与工具库了,如果你恰好学有余力又不知道该学啥,不妨就从这里找找感兴趣的,最后再打个广告,我所在的组(阿里巴巴-淘系技术部-前端架构)正在招2022级的前端实习生,如果你有兴趣或恰好知道身边有这样的同学,欢迎投递简历到我的邮箱:linbudu@qq.com。
欢迎关注 ssh,前端潮流趋势、原创面试热点文章应有尽有。
记得关注后加我好友,我会不定期分享前端知识,行业信息。2021 陪你一起度过。
点赞并分享给你的朋友是最好的支持~
[1]
学完Vue还有必要学习React和Node吗?: https://www.zhihu.com/question/446723495/answer/1756515485
[2]
Jotai: https://github.com/pmndrs/jotai
[3]
IceStore: https://github.com/ice-lab/icestore
[4]
XState: https://github.com/davidkpiano/xstate
[5]
finite state machines: https://en.wikipedia.org/wiki/Finite-state_machine
[6]
SWR: https://github.com/vercel/swr
[7]
React-Query: https://github.com/tannerlinsley/react-query
[8]
useRequest: https://github.com/alibaba/hooks
[9]
GatsbyJS: https://github.com/gatsbyjs/gatsby
[10]
React-Testing-Library: https://github.com/testing-library/react-testing-library
[11]
AHooks: https://github.com/alibaba/hooks
[12]
Huse: https://github.com/ecomfe/react-hooks
[13]
Dumi: https://github.com/umijs/dumi
[14]
Immer: https://github.com/immerjs/immer
[15]
Angular: https://angular.cn/
[16]
TypeScript的另一面:类型编程: https://linbudu.top/posts/2020/10/19/typescript%E7%B1%BB%E5%9E%8B%E7%BC%96%E7%A8%8B.html
[17]
Taro: https://github.com/NervJS/taro
[18]
Rax: https://github.com/alibaba/rax
[19]
Remax: https://remaxjs.org/
[20]
Ionic: https://github.com/ionic-team/ionic-framework
[21]
Electron: https://github.com/electron/electron
[22]
zcbenz: https://www.zhihu.com/people/zcbenz
[23]
Flutter: https://github.com/flutter/flutter
[24]
NestJS: https://nestjs.com/
[25]
走近MidwayJS:初识TS装饰器与IoC机制: https://linbudu.top/posts/2020/08/10/midway-initial.html
[26]
MidwayJS: https://github.com/midwayjs/midway
[27]
Midway-Serverless: https://www.yuque.com/midwayjs/faas
[28]
Serverless: https://github.com/serverless/serverless
[29]
Midway-Hooks: https://github.com/midwayjs/hooks
[30]
ts-node-dev: https://github.com/wclr/ts-node-dev
[31]
tsconfig-paths: https://github.com/dividab/tsconfig-paths
[32]
TypeORM: https://github.com/typeorm/typeorm
[33]
PM2: https://github.com/Unitech/pm2
[34]
Prisma-Article-Example: https://github.com/linbudu599/Prisma-Article-Example
[35]
Apollo-Client: https://github.com/apollographql/apollo-client
[36]
ApolloGraphQL: https://www.apollographql.com/
[37]
Apollo-Client-Vue: https://github.com/vuejs/vue-apollo
[38]
Angular版本: https://github.com/kamilkisiela/apollo-angular
[39]
Relay: https://github.com/facebook/relay
[40]
GraphQURL: https://github.com/hasura/graphqurl
[41]
GraphQL-Zeus: https://github.com/graphql-editor/graphql-zeus
[42]
Apollo-Server: https://github.com/apollographql/apollo-server
[43]
GraphQL-Yoga: https://github.com/prisma-labs/graphql-yoga
[44]
TypeGraphQL: https://github.com/MichalLytek/type-graphql
[45]
GraphiQL: https://github.com/graphql/graphiql
[46]
GraphQL-Playground: https://github.com/graphql/graphql-playground
[47]
Apollo Federation: https://www.apollographql.com/docs/federation
[48]
GraphQL-Code-Generator: https://github.com/dotansimha/graphql-code-generator
[49]
DataLoader: https://github.com/graphql/dataloader
[50]
GraphQL N+1 问题到DataLoader源码解析: https://linbudu.top/posts/2021/01/29/dataloader%E6%BA%90%E7%A0%81.html
[51]
GraphQL-Tools: https://www.graphql-tools.com/
[52]
这里: https://github.com/linbudu599/GraphQL-Explorer-Server/blob/master/server/directives/restrictions.ts
[53]
Hasura: https://hasura.io/
[54]
PostGraphile: https://www.graphile.org/
[55]
Webpack5: https://github.com/webpack/webpack
[56]
Vite: https://github.com/vitejs/vite
[57]
Parcel: https://parceljs.org/
[58]
SnowPack: https://github.com/snowpackjs/snowpack
[59]
ESBuild: https://github.com/evanw/esbuild
[60]
不支持装饰器语法: https://esbuild.github.io/content-types/#emit-decorator-metadata
[61]
SWC: https://github.com/swc-project/swc
[62]
Rollup: https://github.com/rollup/rollup
[63]
Rich Harris: https://github.com/Rich-Harris
[64]
GitHub Actions: https://docs.github.com/en/actions
[65]
TravisCI: https://travis-ci.com/
[66]
CircleCI: https://circleci.com/
[67]
GitLabCI: https://about.gitlab.com/stages-devops-lifecycle/continuous-integration/
[68]
Vercel(原@zeit/now): https://vercel.com/
[69]
Surge: https://surge.sh/
[70]
GitHub Pages: https://docs.github.com/en/github/working-with-github-pages/getting-started-with-github-pages
[71]
Netlify: https://www.netlify.com/
[72]
Heroku: https://dashboard.heroku.com/
[73]
Apollo Studio: https://www.apollographql.com/docs/studio/
[74]
Vercel Functions: https://vercel.com/docs/serverless-functions/introduction
[75]
Netlify Functions: https://docs.netlify.com/functions/overview/
[76]
Nx Cloud: https://nx.app/
[77]
Nx: https://github.com/nrwl/nx
[78]
Lerna: https://github.com/lerna/lerna
[79]
Yarn Workspace: https://yarn.bootcss.com/docs/workspaces/
[80]
PNPM: https://github.com/pnpm/pnpm
[81]
BlitzJS: https://blitzjs.com/
[82]
RedwoodJS: https://redwoodjs.com/
[83]
Midway-Hooks: https://github.com/alibaba/hooks
[84]
繁易: https://github.com/Lxxyx
[85]
API Routes: https://nextjs.org/docs/api-routes/introduction
[86]
RxJS: https://github.com/ReactiveX/rxjs
[87]
RxDart: https://github.com/ReactiveX/rxdart
[88]
RxJava: https://github.com/ReactiveX/RxJava
[89]
RxPy: https://github.com/ReactiveX/RxPY
[90]
RxGo: https://github.com/ReactiveX/RxGo
[91]
Redux-Observable: https://github.com/redux-observable/redux-observable
[92]
Reactive.How: https://reactive.how/
[93]
NgRx: https://ngrx.io/
[94]
Cypress: https://github.com/cypress-io/cypress
[95]
PlayWright: https://github.com/microsoft/playwright
[96]
StoryBook: https://github.com/storybookjs/storybook
[97]
Babel: https://github.com/babel/babel
[98]
Tailwind: https://tailwindcss.com/
[99]
Husky: https://github.com/typicode/husky
[100]
LowDB: https://github.com/typicode/lowdb
[101]
JSON-Server: https://github.com/typicode/json-server
[102]
TypeStack: https://github.com/typestack
[103]
Class-Validator: https://github.com/typestack/class-validator
[104]
Class-Transformer: https://github.com/typestack/class-transformer
[105]
TypeDI: https://github.com/typestack/typedi
[106]
Routing-Controllers: https://github.com/typestack/routing-controllers
[107]
GenQL: https://genql.now.sh/docs
[108]
GraphQL-Voyager: https://github.com/APIs-guru/graphql-voyager
[109]
Voyager: http://voyager.linbudu.top/
[110]
Majestic: https://github.com/Raathigesh/majestic
[111]
scully: https://github.com/scullyio/scully