RubyonRails的一些代码知识点

杰瑞发布于2023-11-01

内容
角色
Bun:
Bun is a JavaScript runtime.Bun is a new JavaScript runtime built from scratch to serve the modern JavaScript ecosystem. It has three major design goals:
Speed. Bun starts fast and runs fast. It extends JavaScriptCore, the performance-minded JS engine built for Safari. As computing moves to the edge, this is critical. Elegant APIs. Bun provides a minimal set of highly-optimimized APIs for performing common tasks, like starting an HTTP server and writing files.Cohesive DX.
Bun is a complete toolkit for building JavaScript apps, including a package manager, test runner, and bundler.
Rails7.1:
https://rubyonrails.org/2023/10/5/Rails-7-1-0-has-been-released.
Dockfile;own authentication;more async queries, async_count;trilogy:new MySQL database adapter;composite primary keys;perform_all_later;config.autoload_lib;
ConnectionPool:
Opening a new connection is usually an expensive operation. Connection to RabbitMQ is done with TCP protocol. Creating a new one requires many steps, such as DNS lookup, TCP handshake, TLS handshake, authentication, etc.
Ahoy:
When someone visits your website, Ahoy creates a visit with lots of useful information.
traffic source - referrer, referring domain, landing page
location - country, region, city, latitude, longitude
technology - browser, OS, device type
utm parameters - source, medium, term, content, campaign
.
utm:
https://example.com/?utm_source=facebook.com&utm_medium=display&utm_campaign=summer+sale+2018.
UTM参数的全名是Urchin Tracking Module Urchin跟踪模块,
流量渠道标记一般是使用UTM,UTM的全称是Urchin Tracking Module/Urchin Tracking Manager,
Urchin是就是Google Analytics的前生.
UTM成为行业术语了,如百度统计、神策、GrowiongIO、诸葛IO都支持或兼容UTM,可以说UTM就是流量跟踪、流量标记的代名词.
utm_campaign:表示广告系列,就是广告活动的名字
Nokolexbor-Nokogiri:
Nokolexbor is a drop-in replacement for Nokogiri. It's 5.2x faster at parsing HTML and up to 997x faster at CSS selectors.
Nokolexbor是Nokogiri的替补。它在解析HTML方面快5.2倍,在CSS选择器方面快997倍。
Passwordless:
A system to add password-free ‘magic link’ style authentication to your Rails apps.
Personal growth stuck:
Hey folks!
I'm Ruby/Rails developer with 5 years of experience. I want to become a senior developer but I feel like I'm stuck and not sure where should I go. Some thing became boring and routine, and I want to learn something on the basis I already have, but there are so many new things. It's confusing me . I would be appreciate for any advise. Peace!
Horizontal investments:
learn django, laravel, and/or spring boot. (other backend battery included frameworks with different philosophies). If you a hardcore ruby main, elixir/phoenix it is. Or learn Vuejs (a frontend framework that is quite compatible for those coming from ruby/php/python/golang).
Vertical investments:
try out 4 nosql databases/7 db paradigms, GraphQL, microservice + golang, kubernetes.
By building smaller parts, one at a time, you can change directions as you get to higher-level components after you build a solid lower-level foundation.
You set out to test a single object and end up with a whole sub-system.
Feedback Loops:
A tight feedback loop is a game changer. Shortening your feedback loop will always pay dividends. Here are a couple of tools I use to shorten mine.
紧密的反馈循环会改变游戏规则。缩短你的反馈周期总是会有好处的。这里有几个我用来缩短我的工具。
I highly recommend watching this talk from one of Test Double’s founders, Justin Searls — especially the section starting at 31:52 where he does the math on the importance of feedback loop. If it doesn’t make you obsessed with its importance, nothing will!
The classic autoloader has been extremely useful, but had a number of issues that made autoloading a bit tricky and confusing at times. Zeitwerk was developed to address this, among other motivations.