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}}]}
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章