Redwood:将Ruby on Rails开发体验带到JavaScript

{"type":"doc","content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"GitHub联合创始人Tom Preston-Werner发布了"},{"type":"link","attrs":{"href":"https:\/\/t.co\/4qsI2JP2Ld?amp=1","title":"","type":null},"content":[{"type":"text","text":"RedwoodJS"}]},{"type":"text","text":",一款全新的面向边缘的全栈JavaScript Web框架。Redwood集成了预先确定的后端和前端技术栈。Redwood遵循“"},{"type":"link","attrs":{"href":"https:\/\/en.wikipedia.org\/wiki\/Conventionoverconfiguration","title":"","type":null},"content":[{"type":"text","text":"惯例优先"}]},{"type":"text","text":"( convention-over-configuration)”的原则,并努力为开发者"},{"type":"link","attrs":{"href":"https:\/\/news.ycombinator.com\/item?id=22538563","title":"","type":null},"content":[{"type":"text","text":"提供类似Ruby on rails的开发体验"}]},{"type":"text","text":"。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"link","attrs":{"href":"https:\/\/github.com\/redwoodjs\/redwood","title":"","type":null},"content":[{"type":"text","text":"RedwoodJS的GitHub主页"}]},{"type":"text","text":"对Redwood的描述如下:"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"blockquote","content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"Redwood是一个全栈式无服务器Web应用程序框架,你可以轻松地用它构建和部署JAMstack应用程序。想象一下,一个由CDN提供的React前端通过GraphQL与运行在世界各地AWS Lambdas上的后端通信,所有这些都可以通过git push实现——这就是Redwood提供的能力。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"Redwood为你做了大量的决策,让你能够专注在应用程序上,而不是浪费时间去选择和重新选择各种技术和配置。"}]}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"Redwood技术栈包括React、GraphQL(Apollo)、"},{"type":"link","attrs":{"href":"https:\/\/www.prisma.io\/","title":"","type":null},"content":[{"type":"text","text":"Prisma"}]},{"type":"text","text":"、Babel、Webpack,还有其他即将发布的,如"},{"type":"link","attrs":{"href":"https:\/\/jestjs.io\/","title":"","type":null},"content":[{"type":"text","text":"Jest"}]},{"type":"text","text":"或"},{"type":"link","attrs":{"href":"https:\/\/storybook.js.org\/","title":"","type":null},"content":[{"type":"text","text":"Storybook"}]},{"type":"text","text":"。此外,Redwood支持"},{"type":"link","attrs":{"href":"https:\/\/www.infoq.com\/news\/2020\/04\/introducing-jamstack\/","title":"","type":null},"content":[{"type":"text","text":"JAMstack"}]},{"type":"text","text":",一种基于客户端JavaScript、可重用API和预构建标记的现代Web开发架构。Redwood还采用了自动部署和无服务器架构。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"Redwood的架构如下:"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"image","attrs":{"src":"https:\/\/static001.infoq.cn\/resource\/image\/c8\/23\/c8039ace3cedab4af97de4cf7a352f23.png","alt":null,"title":"","style":[{"key":"width","value":"75%"},{"key":"bordertype","value":"none"}],"href":"","fromPaste":false,"pastePass":false}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":"center","origin":null},"content":[{"type":"text","text":"RedwoodJS架构图,来自Netlify博客"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"Redwood提供了自己的内置路由"},{"type":"link","attrs":{"href":"https:\/\/redwoodjs.com\/docs\/redwood-router","title":"","type":null},"content":[{"type":"text","text":"解决方案"}]},{"type":"text","text":",开发人员可以"},{"type":"link","attrs":{"href":"https:\/\/redwoodjs.com\/docs\/redwood-router#link-and-named-route-functions","title":"","type":null},"content":[{"type":"text","text":"更新路由的路径"}]},{"type":"text","text":",而不会破坏到路由的链接。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"就像Ember一样,Redwood附带了大量CLI生成器,这些生成器减少了常见操作的样板文件(例如,创建一个新项目、一个新路由或一个新组件)并遵循Redwood的约定。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"link","attrs":{"href":"https:\/\/redwoodjs.com\/tutorial\/cells","title":"","type":null},"content":[{"type":"text","text":"Redwood Cells"}]},{"type":"text","text":"提供了声明式的方法来处理跨多个状态(加载、错误、成功)的远程数据抓取。"},{"type":"link","attrs":{"href":"https:\/\/redwoodjs.com\/tutorial\/everyone-s-favorite-thing-to-build-forms","title":"","type":null},"content":[{"type":"text","text":"Redwood Forms"}]},{"type":"text","text":"利用"},{"type":"link","attrs":{"href":"https:\/\/react-hook-form.com\/","title":"","type":null},"content":[{"type":"text","text":"React Hook Form"}]},{"type":"text","text":"(最近获得"},{"type":"link","attrs":{"href":"https:\/\/osawards.com\/react\/","title":"","type":null},"content":[{"type":"text","text":"2020年GitNation React OS大奖"}]},{"type":"text","text":")来管理表单。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"一位Reddit用户对Redwood表示欢迎,并将其与Rails进行了比较:"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"blockquote","content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"恭喜发布新版本,感觉就像是Rails在JavaScript时代一样,从:"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"REST => GraphQL,"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"Sprockets => Babel\/webpack,"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"VM => Lambda,"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"Caching => 静态站点,"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"ERb => React,"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"Active Record => Prisma,"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"Rspec => Jest,"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"routes.rb => Routes.js。"}]}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"另一位Reddit用户评价了Redwood为开发者所做出的决策:"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"blockquote","content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"我认为一个默认的工具箱可以让你快速启动和运行一个项目,这样你就可以进行POC或真正开始评估应用程序要解决的问题和它所提供的解决方案,还能获得快速的反馈循环,这非常有价值。"}]}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"这让人想起Geertjan Wielenga在FOSDEM 2020大会上发表的关于企业软件栈广度的演讲:"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"blockquote","content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"你不希望组织中的每个人都要自己去弄清楚应该使用什么技术栈。"}]}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"其他开发者对Redwood技术栈的某些部分表示怀疑。其中一个说:"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":">对于高级的应用场景来说,Prisma肯定是有局限性的。我已经用了两年,因为这个,我们现在改用"},{"type":"link","attrs":{"href":"https:\/\/www.graphile.org\/postgraphile\/","title":"","type":null},"content":[{"type":"text","text":"Postgraphile"}]},{"type":"text","text":"。Prisma 2帮不到我们,只会让情况更糟。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"另一个开发者"},{"type":"link","attrs":{"href":"https:\/\/medium.com\/javascript-in-plain-english\/redwoodjs-full-stack-javascript-framework-with-a-developer-in-mind-dfa7d7a6d905","title":"","type":null},"content":[{"type":"text","text":"提到"}]},{"type":"text","text":":"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"blockquote","content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"Lambda函数长度有限制,无服务器和关系型数据库的连接有问题……Redwood严重依赖目前还在测试当中的Prisma 2。"}]}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"Redwood文档"},{"type":"link","attrs":{"href":"https:\/\/redwoodjs.com\/docs\/form#form","title":"","type":null},"content":[{"type":"text","text":"提到"}]},{"type":"text","text":",Redwood仍在积极开发当中,应该谨慎使用:"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"blockquote","content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"Redwood正处在“可用、正确、快速”这三个阶段的“可用”阶段的后期。"}]}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"Redwood是一个基于MIT许可的开源项目。欢迎开发者反馈和贡献,并应遵循相应的"},{"type":"link","attrs":{"href":"https:\/\/github.com\/redwoodjs\/redwood\/blob\/main\/CONTRIBUTING.md","title":"","type":null},"content":[{"type":"text","text":"指南"}]},{"type":"text","text":"。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","marks":[{"type":"strong"}],"text":"原文链接"},{"type":"text","text":":"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"link","attrs":{"href":"https:\/\/www.infoq.com\/news\/2020\/11\/redwood-ruby-rails-javascript\/","title":"","type":null},"content":[{"type":"text","text":"Redwood - Bringing the Ruby on Rails Experience to JavaScript"}]}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}}]}
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章