BytePower 技术周刊 - 033

2024/4/1

# 📘 封面


在每年春分、秋分时节可以在北京首钢大桥拍到的定都阁悬日。| 来自 Peng(小红书账号:2655690406)

# 🔥 热点

# Suno (opens new window)

相关新闻: AI 作曲家爆改周杰伦,华语乐坛一夜颠覆,Suno 秒生爆款神曲,人人都成音乐家 (opens new window)

# 📖 文章

# 知名压缩软件 xz 被发现有后门,影响有多大?如何应对? (opens new window)

xz-utils 的 5.6.0 和 5.6.1 版本被维护者 Jia Tan 注入了后门。在 2024 年 3 月 29 日,后门被发现并迅速引起了各大发行版的注意。

xz-utils 分为 liblzma 和 xz 两部分。xz 是一个单文件压缩软件,采用了压缩率高的 LZMA 算法,在 Linux 中被广泛使用。liblzma 是 LZMA 算法的实现,被应用于 systemd 等多个 Linux 系统和应用软件。

目前,Fedora,Arch Linux 和 openSUSE 等多个发行版向用户发出了警告,要求用户立即降级或升级到不存在后门或已经去除后门的 xz-utils 版本。

下图中是一处攻击者对代码的破坏,寻找一下恶意代码在哪里:

# 技术摘抄 (opens new window)

该网站收集了大量技术文章,内容较多,可按需阅读。

# 重新构想原子化 CSS (opens new window)

原子化 CSS 是一种 CSS 的架构方式,它倾向于小巧且用途单一的 class,并且会以视觉效果进行命名。

有些人可能会称其为函数式 CSS,或者 CSS 实用工具。本质上,你可以将原子化的 CSS 框架理解为这类 CSS 的统称:

.m-0 {
  margin: 0;
}
.text-red {
  color: red;
}
/* ... */

# 向你介绍 UnoCSS (opens new window)

UnoCSS - 具有高性能且极具灵活性的即时原子化 CSS 引擎。

# 大厂真实 Git 开发工作流程 (opens new window)

文中介绍了一种分支命名方式:分支责任-需求日期/需求号-开发人姓名,常见的有以下几种分支责任。

  • feat:新功能
  • fix:修补 bug
  • doc:文档
  • refactor:重构(即不是新增功能,也不是修改 bug 的代码变动)
  • test:测试
  • chore:构建过程或辅助工具的变动

# 解锁 JSON.stringify() 5 个鲜为人知的功能 (opens new window)

const obj = {
  name: 'San Shang You Ya',
  age: 18
};
console.log(JSON.stringify(obj, ['name']));
// Result: {"name": "San Shang You Ya"}

const obj = {
  name: 'San Shang You Ya',
  age: 18
};

console.log(JSON.stringify(obj, (key, value) => (key === 'age' ? value : undefined)));
// Result: {"age": 18}

const obj = {
  name: 'San Shang You Ya',
  age: 18
};
console.log(JSON.stringify(obj, null, 2));

const superhero = {
  firstName: 'San Shang',
  lastName: 'You Ya',
  age: 21,
  toJSON() {
    return {
      fullName: `${this.firstName} + ${this.lastName}`
    };
  }
};

console.log(JSON.stringify(superhero));
// Result: "{ "fullName" : "San Shang You Ya"}"

# Micro Frontends (opens new window)

Some of the key benefits that we've seen from micro frontends are:

  • smaller, more cohesive and maintainable codebases
  • more scalable organisations with decoupled, autonomous teams
  • the ability to upgrade, update, or even rewrite parts of the frontend in a more incremental fashion than was previously possible

It is no coincidence that these headlining advantages are some of the same ones that microservices can provide.

Of course, there are no free lunches when it comes to software architecture - everything comes with a cost. Some micro frontend implementations can lead to duplication of dependencies, increasing the number of bytes our users must download. In addition, the dramatic increase in team autonomy can cause fragmentation in the way your teams work. Nonetheless, we believe that these risks can be managed, and that the benefits of micro frontends often outweigh the costs.

# 🧰 工具

# Itsycal (opens new window)

Itsycal 是一款在 Mac 菜单栏显示迷你日历的小工具,免费、开源。近日新增了自定义整点报时音效功能。@Appinn

# BitDock (opens new window)

一款运行在 Windows 上的极简工具栏

让你的 Windows 桌面像 macOS 一样。

# 🐠 有趣的东西

# 让所有人都能上手体验小米 SU7! (opens new window)

一个使用 WebGL 技术实现的小米汽车 SU7 的展示网页。

https://www.bilibili.com/video/BV18x4y1m7Km/?vd_source=ce480b48f637d71ad704872dfb5751a2

上次更新: 2024/4/1 19:04:54