跳到主要内容

JS Lib Version

  • TanStack Query/react-query v5
  • react v18
  • trpc
  • MikroORM v6
    • v6 Released
    • Upgrading from v5 to v6
      • Node 18.12+, TS v5+
      • BaseEntity<E,'id'> -> BaseEntity 移除 类型参数
      • UseRequestContext -> CreateRequestContext, EnsureRequestContext
      • OptionalProps 可用 Opt 类型
        • fullName: string & Opt = '';
          • 也可以 Opt<string>
        • @Property({ hidden: true, nullable: true }) password?: string & Hidden;
          • 也可以 Hidden<string>
      • PrimaryKeyType,PrimaryKeyType -> PrimaryKeyProp
        • 修改后的 PrimaryKeyProp 只需要制定 key
      • RequestContext.createAsync -> RequestContext.create
      • onUpdateIntegrity -> updateRule
  • reflect-metadata v0.2

Patches

[email protected]

ts-node 兼容新版本 swc

diff --git a/dist/transpilers/swc.js b/dist/transpilers/swc.js
index c334bd3b18b292c3f865639dca4080ff3dfe53e8..26c37e4b45177554f4a79e311775dab3e9085a59 100644
--- a/dist/transpilers/swc.js
+++ b/dist/transpilers/swc.js
@@ -167,7 +167,7 @@ function createSwcOptions(compilerOptions, nodeModuleEmitKind, swcInstance, swcD
: {}),
}
: undefined,
- swcrc: false,
+ swcrc: true,
jsc: {
externalHelpers: importHelpers,
parser: {

FAQ

swc 升级后导致 build 多了一层目录

# dist/src -> dist
npx swc ./src -d dist --strip-leading-paths