🗞 News

Taobao NPM mirror switch new domain name

Taobao NPM mirror site (Npm.taobao.org) officially started its external service in 2014. At the beginning, it just wanted to be a simple mirror site of NPM in China and feed back to the domestic front-end community. It has been running until now unconsciously. At that time, referring to the way of Ruby Gems Taobao mirror, I applied for the secondary domain name of Taobao.org with Ali Open Source organization, and the name of the mirror site was naturally named As Taobao NPM mirror station (hereinafter called CNPM).

CNPM is divided into Registry source site and CLI command line. Community users generally connect to the former through NPM/PNPM/YARN to accelerate the downloading of NPM packages.

With the booming development of the front end, the data volume and content complexity of NPM package are still accelerating, and the architecture of CNPM in those days can hardly meet the current situation. In order to provide a more stable, secure and compliant mirror service, we started the optimization of CNPM this year:

  • Start a new domain name.
  • Comprehensive Registry reconstruction improves stability and reduces synchronization failure rate.
  • Optimized CLI to improve installation speed and remove compatibility problems caused by soft connection.
  • Precipitated from the use of large-scale enterprise application manual.
  • &etc.

New Web site and Registry Endpoint:

  • Web site: npmmirror.com
  • Registry Endpoint:registry.npmmirror.com

【 know 】 Taobao NPM mirror station call you to switch to a new domain name – Zhihu (zhihu.com)

React Router V6 is released

The new React Router involves some API changes, refactoring with React Hooks, and is a core part of the Remix framework.

The original links: the React the Router v6 | Remix

📦 Open Source

cssdb

The CSSDB is a comprehensive list of CSS features and locations in the implementation of Web standards.

The Home Page: CSSDB

react-freeze

A very interesting library that effectively avoids React re-render and freezes the component tree and replaces it with a placeholder view without losing component and page state.

GitHub Repo: Software-mansion-labs/React-Freeze (github.com)

npm-dts

A CLI tool that automatically generates DTS files for your NPM package.

Local installation:

npm install --save-dev npm-dts
Copy the code

Global installation:

npm install -g npm-dts
Copy the code

It’s also very simple to use:

npm-dts [options] generate
Copy the code

Vytenisu/NPM-DTS Generates single DTS file for Bundling TypeScript NPM packages (github.com)

GitHub Repo: Vytenisu/NPM-DTS: Generates single DTS file for Bundling TypeScript NPM packages

install-with-typing

A CLI tool that can help you install NPM packages and their type declaration files simultaneously.

Usage:

pnpm i install-with-typing -g
# fs-extra as dep, @types/fs-extra as devDep
it fs-extra
# jest, @types/jest as devDep
it jest --no-save
# scoped package is also supported! @babel/traverse -> @types/babel__traverse
it @babel/traverse
# installation in monorepo may require additional args, like pnpm workspace
it typescript --args='--workspace-root --silent'
Copy the code

README: Install-with-typing-nPM (nPMjs.com)

rs-jest

A Jest Transformer for running Rust unit tests requires a simple configuration of jest.config.js after installation.

module.exports = {
  transform: {
    "^.+\\.rs$": "rs-jest"}};Copy the code

GitHub Repo: DrSensor/ RS-JEST: Jest Preprocessor/Transformer for Rust (github.com)

📑 Article

React Native has some little-known apis

This article is a React Native development treasure book. It contains a lot of less commonly used but very useful apis. It is worth collecting.

The original link: mp.weixin.qq.com/s/n0tF8o4ja…