作死?放棄堅持15年的原生開發,1Password用Electron重寫了全部代碼

{"type":"doc","content":[{"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":"作爲世界上最受歡迎的密碼管理器,1Password 放棄了 15 年來始終堅持的原生開發方式,轉向了 Electron 框架,並徹底地重寫了所有的程序。"}]},{"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":"1Password 的聯合創始人 Roustem Karimov "},{"type":"link","attrs":{"href":"https:\/\/www.youtube.com\/watch?v=Dro1OgSkbAU","title":"xxx","type":null},"content":[{"type":"text","text":"表示"}]},{"type":"text","text":",“這是一次徹底的重寫,沒有複製以前的任何一行代碼。重寫我們所有的 Apps,是一個巨大的挑戰,一般人不該這麼做(Nobody should do this)。但是我們需要這樣一個核心的根本性變革,能推動我們面向未來,爲下一個十年取得成功奠定基礎。”"}]},{"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":"大多數用戶其實並不關心開發人員用什麼來編寫我們所使用的應用程序,但 1Password 的情況顯然不同。8 月 11 日,沉寂多年的 1Password 發佈了 Early Access 大版本,作爲蘋果平臺上最流行的密碼管理器應用, 這個版本一經釋出,1Password 的用戶社區就炸了!"}]},{"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:\/\/www.reddit.com\/r\/1Password\/comments\/p2dmpt\/all_aboard_1password_8_for_mac_is_now_in_early\/","title":"xxx","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":"“我對改用 Electron 感到非常失望。”"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"image","attrs":{"src":"https:\/\/static001.geekbang.org\/wechat\/images\/72\/72927178d8de91e0e5b47824ed171499.png","alt":null,"title":null,"style":null,"href":null,"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},"content":[{"type":"text","text":"輿論幾乎是一邊倒,1Password 的技術 VP Michael Fey 不得不發了"},{"type":"link","attrs":{"href":"https:\/\/blog.1password.com\/1password-8-the-story-so-far\/","title":"xxx","type":null},"content":[{"type":"text","text":" 一篇長文"}]},{"type":"text","text":" 解釋他們爲什麼要做出使用 Electron 重寫 Mac 版的決定。在文中,他說道:“這可能是我們必須做出的最複雜的決定。”"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"heading","attrs":{"align":null,"level":3},"content":[{"type":"text","text":"將 1Password 8 轉向 Electron 的理由"}]},{"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":"1Password 擁有 15 年的歷史,但這些年來他們構建應用程序的方式基本相同。"}]},{"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":"1Password 最初是 Dave 和 Roustem 的業餘項目,他們的日常工作是作爲程序員來構建網站,但他們厭倦了測試中需要不斷地手動填寫用戶名、密碼和聯繫信息,於是他們編寫了一個工具來實現自動化。這個業餘項目迅速取代了他們的全職工作,並由此催生出了一整個公司和一個相關行業。"}]},{"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":"1Password 的首個版本是一個 Mac 專用程序。當蘋果之後公佈 iPhone SDK 時,這支小團隊繼續努力、開發出相應的 iPhone 版應用。在此之後,他們又逐漸推出了 Windows 與 Android 等多個版本,併爲各個平臺聘請了獨立的開發人員。這些開發者能夠獲得文件格式規範,瞭解應用如何在 Mac 及 iPhone 上運行,之後就自由爲實際負責的平臺創建原生版應用程序。"}]},{"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":"發展多年之後的結果,就是同一款應用程序在不同平臺之上呈現出完全不同的使用界面。Windows 版本的 1Password 就跟 Mac 版在使用感受以及外觀上存在巨大差異,Android 與 iOS 版之間也是如此。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"image","attrs":{"src":"https:\/\/static001.geekbang.org\/wechat\/images\/ec\/ec42ff247ce17689b1831b47812d4027.png","alt":null,"title":null,"style":null,"href":null,"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},"content":[{"type":"text","text":"而且蘋果 Mac 是出了名的生命力頑強,目前仍有很多用戶在使用不支持 SwiftUI 的舊版 Mac,1Password 開發商 Agilebits 就還需要做出一個艱難的選擇——要麼爲這款應用程序創建兩個 MacOS 版本,保證能夠繼續在較舊的 Mac 上運行;要麼直接放棄陳舊 Mac 硬件,繼續推動更新之路。當然,Agilebtis 也有第三種選擇,就是把應用程序直接轉向 Electron 平臺之上。乍看之下,第三種選擇似乎是下下之策,但琢磨之後這好像又是最好的方案。"}]},{"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":"Electron 是一套跨平臺應用程序構建方案,能夠幫助開發者在無需編寫原生代碼的情況下獲得良好的跨平臺運行能力。Electron 允許編碼人員使用 JavaScript、HTML 以及 CSS 構建自己的應用程序。而且無論最終用戶使用的是 MacOS、Windows 還是 Linux,Electron 編寫出的應用程序都能使用相同的代碼庫。"}]},{"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":"目前,Slack、WhatsApp Desktop、Microsoft Teams 以及 Discord 等常用軟件都在使用 Electron。但這套框架的問題在於,經它之手的應用程序往往要比原生版本佔用更多系統資源,特別是內存。儘管如此,看起來 1Password 轉向 Electron 已經成爲板上釘釘的事實。"}]},{"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":"也正因爲如此,不少人對轉向 Electron 的決定表示不理解。畢竟既然考慮的是使用較舊 Mac 設備的用戶,就應該注意到這類硬件的內存容量本來就有限。而且在運行這種應用程序時,我們還得同時啓動另一位知名內存佔用大戶——谷歌 Chrome 瀏覽器。"}]},{"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":"這也是引發爭議的根源。沒錯,這款軟件源於 Mac,但其開發商卻放棄了原生開發以擴展支持 MacOS 操作系統的更多版本——這着實令人感到不安。但至少可以明確一點,開發商並不打算放棄 Mac。他們做出的 Electron 框架使用決定雖然會佔用更多內存,但核心目標確實是想讓相同的代碼庫能繼續順利運行在舊版 MacOS 之上。"}]},{"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":"總之,將 1Password 轉向 Electron 的基本思路,是爲了減少 Agilebits 所需維護的應用程序數量。爲了與更多 MacOS 版本保持兼容,開發者只能爲同一操作系統構建兩款不同的應用程序。對於最新版本的 MacOS,Agilebits 使用 SwiftUI 工具包進行 1Password 8 開發;但對於舊版本,開發人員只能提供基於 Web 的應用程序。"}]},{"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":"Electron 本身就基於 Web,因此 1Password 8 的 MacOS 版本有望運行在較舊的 Mac 設備之上。畢竟 SwiftUI 只支持 MacOS 10.15 以及更高版本。雖然調整之後,新版本的運行方式和使用感受可能與之前版本有所區別,但至少它還是能爲簡化開發流程貢獻力量。我們只能希望它能比其他常規 Electron 應用程序少消耗一點內存。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"heading","attrs":{"align":null,"level":3},"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":"用跨平臺 Electron 取代之前廣受歡迎的 Mac 原生應用程序,這一舉動引發的反響確實巨大,但關於跨平臺應用程序技術的討論始終圍繞着一個簡單到有些粗暴的前提:跨平臺開發更便宜,原生開發更優質。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"image","attrs":{"src":"https:\/\/static001.geekbang.org\/wechat\/images\/b8\/b8f9ad0028351fedb2d5871317ce7b4e.png","alt":null,"title":null,"style":null,"href":null,"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},"content":[{"type":"text","text":"此話倒也不假,畢竟跨平臺工具的超高人氣確實主要來自更低的多平臺開發成本。但這種心理模型並不一定能確切解釋每一家選擇走跨平臺路線的軟件開發商的真實訴求。每當有跨平臺應用程序被推上互聯網輿論的風口浪尖時,我們都會聽到這樣一個問題:“"},{"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":"text","text":"但在實踐中,跨不跨平臺所權衡的絕不僅僅是“便宜和優質”。有過開發經驗的朋友們應該清楚,原生技術有時候也能帶來低成本,而跨平臺在特定情況下反而有助於提升軟件質量。那麼,我們在權衡跨不跨平臺時,到底是在糾結什麼?"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"heading","attrs":{"align":null,"level":4},"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":"宏觀來看,跨平臺 UI 技術優先考慮的並不是完善的用戶體驗、而是功能的順暢協調。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"image","attrs":{"src":"https:\/\/static001.geekbang.org\/wechat\/images\/f4\/f454b4ef11713ca39d9dd0e2a9c724e0.png","alt":null,"title":null,"style":null,"href":null,"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},"content":[{"type":"text","text":"我們設想這樣一個典型的跨平臺 UI 案例:有一款複雜的企業級應用程序,供數千名員工在各類平臺上日常使用。他們需要用它處理工作內容,還需要接受相關使用培訓——但是,這款應用程序需要取悅用戶嗎?並不需要。於是,“用着爽”就成了優先事項列表中墊底的一條,基本等同於“音效好聽”和“支持遊戲手柄”這個層級。只有先滿足了跨平臺一致性和成本效益等核心訴求,之後纔可能考慮這些項目。"}]},{"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":"有鑑於此,企業當然更喜歡跨平臺工具。企業軟件最關注的就是功能支持效果,也向來是“不講使用體驗”的典型代表。對於跨平臺工具的常見批評意見,就是它能快速讓應用的質量達到預期的 75%,但餘下的 25% 則再難寸進。不過只要 75% 已經處於可以接受的範圍,那麼投標合同應該就能順利收款了,還費別的勁幹什麼呢?"}]},{"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":"於是很自然地,內部企業應用程序率先開始了跨平臺 UI 融合之旅——尤其以 Web 爲主。確實是難看難使,但就是能發揮正常作用,你說氣不氣。"}]},{"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":"而在面向客戶的軟件方面,情況就要複雜得多。體驗成了決定產品生死存亡的關鍵,只有針對特定平臺的 UI 代碼能夠觸及“用戶體驗上限”,這類軟件才能真正留住付費用戶的心。從概念上說,一家願意花大錢開發高質量原生 Mac 及 Windows 版本軟件的廠商應該能夠在競爭中壓倒 Electron 版的 Slack、Figma 以及 Spotify 纔對,但爲什麼實際情況不是這樣呢?"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"heading","attrs":{"align":null,"level":4},"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":"在小型產品團隊中,讓幾款原生應用程序保持一致並不困難。在這樣的規模下,原生工具的用戶體驗與便捷性完全碾壓跨平臺。但是,隨着產品及組織規模的快速發展,一致性開始成爲真正的難題。當我們快速招聘新員工、快速添加客戶功能並逐漸需要爲第三、第四乃至第五種平臺提供支持時,情況將越來越危急。1Password 的 Michael Fey 在開發博文中做出瞭如下解釋:"}]},{"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":"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":"這很重要,因爲隨着平臺之間功能、設計與 bug 的快速增加,對不同版本做出協調正逐漸變得不可能。"}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"bulletedlist","content":[{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"這項功能要何時在 Mac 上推出?"}]}]},{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"這份支持文檔符合 Web 用戶的情況嗎?"}]}]},{"type":"listitem","attrs":{"listStyle":null},"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":"起初,企業還可以向銷售及支持團隊提供資金支持來勉強維持統一,但隨着設計衝突的積累,更加危險的問題出現了:產品團隊越來越難以理解自己打理的產品。最終,各個平臺團隊已經不在同一個頻道上,產品交流效率變低、密密麻麻的“路線”彼此交織、重要的細節慘遭忽略……"}]},{"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":"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":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"bulletedlist","content":[{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"一位重要客戶很生氣,因爲銷售說新版本提供一項功能,但在對方的實際平臺上根本找不到。"}]}]},{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"有人在 Twitter 上批評我們,說我們的文檔內容有誤;產品經理進行了深入研究,並發現這部分內容只是不符合 Android 版本的情況。"}]}]},{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"我們無法測試有希望的新改進,因爲新功能必須同時在所有平臺上運行,而 Windows 團隊的正常更新進度已經嚴重落後了。"}]}]},{"type":"listitem","attrs":{"listStyle":null},"content":[{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null},"content":[{"type":"text","text":"iOS 與 Android 產品團隊之間的術語差異導致某個討厭的 bug 在 iOS 上存在了 5 個禮拜,混亂的溝通反而讓 Android 團隊推出了一款沒啥作用的修復程序。"}]}]}]},{"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":"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":"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":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"heading","attrs":{"align":null,"level":4},"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":"對於產品開發商來說,緩慢是個致命的弱點。速度慢的產品團隊往往會被行動更快的對手所擊敗。我們經常抱怨 Figma 和 Slack 之類的產品給不了原生使用體驗,但爲什麼大多數人仍在使用 Figma 與 Slack 這些?因爲它們的實際表現確實壓倒了原生競爭對手。這些產品中當然還有很多可以改進的地方,但它們確實在自己設定的發展路線上做到了最好。"}]},{"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":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}},{"type":"image","attrs":{"src":"https:\/\/static001.geekbang.org\/wechat\/images\/d7\/d7f1b87ae4d66fdc1bdf5f521b6ff302.png","alt":null,"title":null,"style":null,"href":null,"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},"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":"當然,我們也可以從多種跨平臺方案中做出選擇,儘可能把協調負擔降下去。不同於此次 1Password 投向 Electron 所引發的巨大批評,之前他們決定將所有應用程序版本轉向共享 Rust 庫的決定就廣受歡迎。有趣的是,近年來 Dropbox 及 Slack 等知名團隊都發表過如何避免使用跨平臺核心庫來支持移動應用的文章——目前,雙方都在使用完全原生的 iOS 與 Android 代碼庫。就目前的情況看,市場似乎分成了兩大派別——一派宣佈全面轉向 React Native,另一派則決定徹底放棄 React Native。這也是個有趣的話題,以後有機會再單獨討論。"}]},{"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":"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":"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:\/\/blog.1password.com\/1password-8-the-story-so-far\/","title":"","type":null},"content":[{"type":"text","text":"https:\/\/blog.1password.com\/1password-8-the-story-so-far\/"}]}]},{"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:\/\/allenpike.com\/2021\/gravity-of-cross-platform-apps","title":"","type":null},"content":[{"type":"text","text":"https:\/\/allenpike.com\/2021\/gravity-of-cross-platform-apps"}]}]},{"type":"paragraph","attrs":{"indent":0,"number":0,"align":null,"origin":null}}]}
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章