# 第 58 期 - 治咖啡

> 照片摄于西安小巷子里面的「治咖啡」，咖啡师将做咖啡当做作品的方式来弄，这杯橘子海很不错。

- Issue: 58
- 发布日期: 2021/12/28
- HTML: https://weekly.tw93.fun/posts/58
- JSON: https://weekly.tw93.fun/api/posts/58.json
- English translation: https://weekly.tw93.fun/en/posts/58.md

---

<img src="https://gw.alipayobjects.com/zos/k/q7/4gBaEY.jpg" width="800" />

<small>照片摄于西安小巷子里面的「治咖啡」，咖啡师将做咖啡当做作品的方式来弄，这杯橘子海很不错。</small>

> **记录每周看到的接地气的前端潮流技术，筛选后发布于此，觉得不错可关注此专栏，方便获取更新通知**

## 前端技术

**React 18 新特性之 startTransition**  
<https://mp.weixin.qq.com/s/JAFdq0BBu4rVAoPAdKWe8A>  
React 18 作为 React 下一个大版本，为 React 添加了一个新的机制 Concurrent rendering，大幅提高了 React 的性能，推出了时间切片和任务优先级的概念。

**Web 性能优化：控制关键请求的优先级**  
<https://mp.weixin.qq.com/s/P63LEMaXLMyWGYVdLiWxZw>  
字节同学翻译的一篇文章，讲的东西有深度，原来可以这么精准控制。

**聊聊移动端安全加固**  
<https://mp.weixin.qq.com/s/yCB2R8QPWNp2lJrQD4l_hw>  
携程这边关于手机 APP 端安全加固的一些经验。

## 潮流开源

**promisio：Python 中 JS 风格异步编程**  
<https://github.com/miguelgrinberg/promisio>

```python
from promisio import promisify

@promisify
async def f():
    await asyncio.sleep(1)
    return 42

@promisify
def g(x):
    return x * 2

async def main():
    print(await f())  # prints 42
    print(await g(42))  # prints 84

    promise = f()  # runs function in the background without waiting
    # ... do other stuff here in parallel with f running
    await promise  # finally wait for f to complete

```

**cyberwhistle：特斯拉卖的哨子**  
<https://shop.tesla.com/product/cyberwhistle>  
官方的商品详情页面，还挺好看。  
<img src="https://cdn.tw93.fun/blog/upic/VC4VD8.jpg" width="800" />

**xLua：C#下 Lua 编程支持**  
<https://github.com/Tencent/xLua>  
腾讯开源的，xLua 为 Unity、 .Net、 Mono 等 C#环境增加 Lua 脚本编程的能力，借助 xLua，这些 Lua 代码可以方便的和 C#相互调用。

```c
using UnityEngine;
using XLua;

namespace XLuaTest
{
    public class Helloworld : MonoBehaviour
    {
        // Use this for initialization
        void Start()
        {
            LuaEnv luaenv = new LuaEnv();
            luaenv.DoString("CS.UnityEngine.Debug.Log('hello world')");
            luaenv.Dispose();
        }

        // Update is called once per frame
        void Update()
        {

        }
    }
}
```

**xtendui：tailwind 组件库**  
<https://xtendui.com/components/drop>  
设计比较舒服，可以看看。

## 随便看看

**2021 十大收缩行业**  
<https://mp.weixin.qq.com/s/nes6gfaatI0_YYDWLFzZfQ>  
收缩了 84%的旅游业并不是最难受的，才屈居第四。

**汽车芯片真的那么缺吗？**  
<https://mp.weixin.qq.com/s/2w7KvezFV136NkgZ_L9X8A>  
是一个谜。
