Skip to content

Commit

Permalink
perf(compiler): use source-map-js
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Apr 9, 2023
1 parent 681ac7c commit 19e17a9
Show file tree
Hide file tree
Showing 14 changed files with 26 additions and 21 deletions.
2 changes: 1 addition & 1 deletion packages/compiler-core/__tests__/compile.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { baseCompile as compile } from '../src'
import { SourceMapConsumer, RawSourceMap } from 'source-map'
import { SourceMapConsumer, RawSourceMap } from 'source-map-js'

describe('compiler: integration tests', () => {
const source = `
Expand Down
2 changes: 1 addition & 1 deletion packages/compiler-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"@babel/parser": "^7.21.3",
"@vue/shared": "3.3.0-alpha.9",
"estree-walker": "^2.0.2",
"source-map": "^0.6.1"
"source-map-js": "^1.0.2"
},
"devDependencies": {
"@babel/types": "^7.21.3"
Expand Down
2 changes: 1 addition & 1 deletion packages/compiler-core/src/codegen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import {
getVNodeBlockHelper,
getVNodeHelper
} from './ast'
import { SourceMapGenerator, RawSourceMap } from 'source-map'
import { SourceMapGenerator, RawSourceMap } from 'source-map-js'
import {
advancePositionWithMutation,
assert,
Expand Down
2 changes: 1 addition & 1 deletion packages/compiler-sfc/__tests__/parse.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { parse } from '../src'
import { baseParse, baseCompile } from '@vue/compiler-core'
import { SourceMapConsumer } from 'source-map'
import { SourceMapConsumer } from 'source-map-js'

describe('compiler:sfc', () => {
describe('source map', () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/compiler-sfc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"estree-walker": "^2.0.2",
"magic-string": "^0.30.0",
"postcss": "^8.1.10",
"source-map": "^0.6.1"
"source-map-js": "^1.0.2"
},
"devDependencies": {
"@babel/types": "^7.21.3",
Expand Down
2 changes: 1 addition & 1 deletion packages/compiler-sfc/src/compileScript.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ import {
TSEnumDeclaration
} from '@babel/types'
import { walk } from 'estree-walker'
import { RawSourceMap } from 'source-map'
import { RawSourceMap } from 'source-map-js'
import {
CSS_VARS_HELPER,
genCssVarsCode,
Expand Down
2 changes: 1 addition & 1 deletion packages/compiler-sfc/src/compileStyle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
StylePreprocessorResults,
PreprocessLang
} from './style/preprocessors'
import { RawSourceMap } from 'source-map'
import { RawSourceMap } from 'source-map-js'
import { cssVarsPlugin } from './style/cssVars'
import postcssModules from 'postcss-modules'

Expand Down
6 changes: 5 additions & 1 deletion packages/compiler-sfc/src/compileTemplate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ import {
ParserOptions,
RootNode
} from '@vue/compiler-core'
import { SourceMapConsumer, SourceMapGenerator, RawSourceMap } from 'source-map'
import {
SourceMapConsumer,
SourceMapGenerator,
RawSourceMap
} from 'source-map-js'
import {
transformAssetUrl,
AssetURLOptions,
Expand Down
2 changes: 1 addition & 1 deletion packages/compiler-sfc/src/parse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
BindingMetadata
} from '@vue/compiler-core'
import * as CompilerDOM from '@vue/compiler-dom'
import { RawSourceMap, SourceMapGenerator } from 'source-map'
import { RawSourceMap, SourceMapGenerator } from 'source-map-js'
import { TemplateCompiler } from './compileTemplate'
import { parseCssVars } from './style/cssVars'
import { createCache } from './cache'
Expand Down
2 changes: 1 addition & 1 deletion packages/compiler-sfc/src/style/preprocessors.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import merge from 'merge-source-map'
import { RawSourceMap } from 'source-map'
import { RawSourceMap } from 'source-map-js'
import { SFCStyleCompileOptions } from '../compileStyle'
import { isFunction } from '@vue/shared'

Expand Down
2 changes: 1 addition & 1 deletion packages/template-explorer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@
},
"dependencies": {
"monaco-editor": "^0.20.0",
"source-map": "^0.6.1"
"source-map-js": "^1.0.2"
}
}
2 changes: 1 addition & 1 deletion packages/template-explorer/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
ssrMode
} from './options'
import { toRaw, watchEffect } from '@vue/runtime-dom'
import { SourceMapConsumer } from 'source-map'
import { SourceMapConsumer } from 'source-map-js'
import theme from './theme'

declare global {
Expand Down
2 changes: 1 addition & 1 deletion packages/vue-compat/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"dependencies": {
"@babel/parser": "^7.21.3",
"estree-walker": "^2.0.2",
"source-map": "^0.6.1"
"source-map-js": "^1.0.2"
},
"peerDependencies": {
"vue": "3.3.0-alpha.9"
Expand Down
17 changes: 9 additions & 8 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 19e17a9

Please sign in to comment.