Coder Social home page Coder Social logo

weekly's People

Contributors

wjq990112 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

weekly's Issues

[Open Source] unbuild

一个统一的 JavaScript 构建系统,具有以下特性:

  1. 经过优化的 bundler:基于 Rollup 的 bundler,支持 TypeScript 并支持生成 commonjs 和 ES modules 两种格式 + 类型声明
  2. bundleless:集成 mkdist,用于单文件转译生成 bundleless 产物
  3. 通用类型生成器:集成 untyped
  4. &etc.

GitHub Repo:unjs/unbuild: An unified javascript build system.

[Article] TypeScript 之 Narrowing

文章通过 case by case 的方式讲解了 TypeScript 中的各种类型收窄,其中一段关于类型判断式的代码示例非常值得学习!

function isFish(pet: Fish | Bird): pet is Fish {
  return (pet as Fish).swim !== undefined;
}

通过类型判断式的方式,能够有效解决 TypeScript 类型推导错误的问题,在编码阶段即可发现代码问题。

例如:

interface Fish {
  swim: () => void;
}

interface Bird {
  fly: () => void;
}

function isFish(pet: Fish | Bird): pet is Fish {
  return Boolean((pet as Fish).swim);
}

function petFuncCall(pet: Fish | Bird) {
  if (isFish(pet)) {
    // pet: Fish
    pet.swim();
  } else {
    // pet: Bird
    pet.fly();
  }
}

如果 isFish 方法的返回值定义不为 pet is Fish,而是 boolean,则 TypeScript 就无法做出正确的类型推导:

Playground:TypeScript Playground

原文链接:TypeScript 系列之 Narrowing - 知乎

[News] Vercel 获 1.5 亿美元 D 轮融资

在为 Web 开发者提供服务的垂直领域上,Vercel 应该是 No. 1 了,回顾 Vercel 的发展历程,也见证了 Web 的蓬勃发展:

2016.04:发布 Now(CLI + 平台)
2016.10:Next.js 1.0
2017.03:Next.js 2.0
2017.08:Next.js 3.0
2017.10:Next.js 4.0
2018.02:Next.js 5.0
2018.05:Next.js 6.0,25000 stars
2018.11:Now 2.0
2019.04:支持本地模拟运行
2020.04(A 轮):估值不明,融资 2100 万美元,从 Zeit 改名 Vercel
2020.12(B 轮):4.5亿刀估值,融资 4000 万美元
2021.06(C 轮):11亿刀估值,融资 1.02 亿美元
2021.10:发布 Next.js 12
2021.11(D 轮):25亿刀估值,融资 1.5 亿美元

希望 Vercel 能够带着 Make The Web. Faster 的愿景,继续为开发者提供更多更优质的服务。

Twitter:Announcing our $150M Series D.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.