Nâng cấp magic-string từ 0.x lên 1.x
So sánh API công khai của magic-string 0.30.21 và 1.4.2, được tính tự động từ kiểu TypeScript. Chữ ký thay đổi là thay đổi có thể không tương thích, không phải điều chắc chắn.
Tóm tắt
| Đường dẫn import bị xóa | 0 |
|---|---|
| Export bị xóa | 0 |
| Chữ ký thay đổi | 0 |
| Thành viên lớp hoặc interface bị xóa | 1 |
| Thành viên lớp hoặc interface thay đổi | 15 |
| Mới bị ngừng hỗ trợ | 0 |
| Thay đổi yêu cầu (engines, phụ thuộc peer) | 0 |
| Export mới | 5 |
Export bị xóa
Không phát hiện.
Chữ ký thay đổi
Không phát hiện.
Thành viên lớp hoặc interface bị xóa
| member | import | Trước |
|---|---|---|
default.indentExclusionRanges | magic-string | ExclusionRange | ExclusionRange[] |
Thành viên lớp hoặc interface thay đổi
| member | Trước | Sau |
|---|---|---|
Bundle.addSource | (source: MagicString | { filename?: string | undefined; content: MagicString; ignoreList?: boolean | undefined; }): Bundle | (source: MagicString | BundleSourceDescription): Bundle |
Bundle.generateMap | (options?: SourceMapOptions | undefined): Omit<SourceMap, "sourcesContent"> & { sourcesContent: (string | null)[]; } | (options?: BundleSourceMapOptions | undefined): Omit<SourceMap, "sourcesContent"> & { sourcesContent: (string | null)[]; } |
Bundle.generateDecodedMap | (options?: SourceMapOptions | undefined): Omit<DecodedSourceMap, "sourcesContent"> & { sourcesContent: (string | null)[]; } | (options?: BundleSourceMapOptions | undefined): DecodedSourceMapOrMissingContent |
Bundle.indentExclusionRanges | ExclusionRange | ExclusionRange[] | ExclusionRange | ExclusionRange[] | undefined |
default.move | (start: number, end: number, index: number): MagicString | (start: number, end: number, index: number, affinity?: "left" | "right" | undefined): MagicString |
default.slice | (start: number, end: number): string | (start?: number | undefined, end?: number | undefined): string |
default.replace | (regex: string | RegExp, replacement: string | ((substring: string, ...args: any[]) => string)): MagicString | (searchValue: string | RegExp, replacement: string | ReplacementFunction): MagicString |
default.replaceAll | (regex: string | RegExp, replacement: string | ((substring: string, ...args: any[]) => string)): MagicString | (searchValue: string | RegExp, replacement: string | ReplacementFunction): MagicString |
default.constructor | (str: string, options?: MagicStringOptions | undefined): MagicString | (string: string, options?: MagicStringOptions | undefined): MagicString |
SourceMap.file | string | string | undefined |
SourceMap.constructor | (properties: DecodedSourceMap): SourceMap | (properties: DecodedSourceMap | (Omit<DecodedSourceMap, "mappings"> & { mappings: string; })): SourceMap |
SourceMap.sourcesContent | string[] | undefined | (string | null)[] | undefined |
DecodedSourceMap.file | string | string | undefined |
DecodedSourceMap.sourcesContent | string[] | undefined | (string | null)[] | undefined |
SourceMapOptions.hires | boolean | "boundary" | undefined | boolean | "boundary" | "experimental-range" | undefined |
Mới bị ngừng hỗ trợ
Không phát hiện.
Thay đổi yêu cầu (engines, phụ thuộc peer)
Không phát hiện.
Export mới (5)
| import | export | kind |
|---|---|---|
magic-string | MagicString | class |
magic-string | MagicStringError | class |
magic-string | ReplacementFunction | type |
magic-string | BundleSourceMapOptions | interface |
magic-string | BundledSourceFileRecord | interface |
Câu hỏi thường gặp
Nâng cấp magic-string từ 0 lên 1 có những thay đổi không tương thích nào?
Giữa magic-string 0.30.21 và 1.4.2, Vigia tìm thấy 0 export bị xóa, 0 chữ ký thay đổi và 16 thành viên lớp hoặc interface bị xóa hay thay đổi.
Những gì bị ngừng hỗ trợ trong magic-string 1?
0 export hoặc thành viên mới bị đánh dấu ngừng hỗ trợ trong magic-string 1.4.2.
Dành cho tác tử
GET https://vigia.coredls.cloud/v1/packages/npm/magic-string/upgrade?from=0.30.21&to=1.4.2