Skip to content

Commit 124373d

Browse files
committed
wip: isolatedModules + use rollup-plugin-esbuild
1 parent 9381349 commit 124373d

File tree

13 files changed

+569
-113
lines changed

13 files changed

+569
-113
lines changed

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
"@babel/types": "^7.12.0",
5757
"@esbuild-plugins/node-modules-polyfill": "^0.1.4",
5858
"@microsoft/api-extractor": "~7.20.0",
59+
"@rollup/plugin-alias": "^4.0.3",
5960
"@rollup/plugin-commonjs": "^23.0.2",
6061
"@rollup/plugin-json": "^5.0.1",
6162
"@rollup/plugin-node-resolve": "^15.0.1",
@@ -88,6 +89,7 @@
8889
"pug": "^3.0.1",
8990
"puppeteer": "^19.2.2",
9091
"rollup": "~3.10.0",
92+
"rollup-plugin-esbuild": "^5.0.0",
9193
"rollup-plugin-node-builtins": "^2.1.2",
9294
"rollup-plugin-node-globals": "^1.4.0",
9395
"rollup-plugin-polyfill-node": "^0.11.0",

packages/compiler-core/src/index.ts

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,39 +2,39 @@ export { baseCompile } from './compile'
22

33
// Also expose lower level APIs & types
44
export {
5-
CompilerOptions,
6-
ParserOptions,
7-
TransformOptions,
8-
CodegenOptions,
9-
HoistTransform,
10-
BindingMetadata,
5+
type CompilerOptions,
6+
type ParserOptions,
7+
type TransformOptions,
8+
type CodegenOptions,
9+
type HoistTransform,
10+
type BindingMetadata,
1111
BindingTypes
1212
} from './options'
1313
export { baseParse, TextModes } from './parse'
1414
export {
1515
transform,
16-
TransformContext,
16+
type TransformContext,
1717
createTransformContext,
1818
traverseNode,
1919
createStructuralDirectiveTransform,
20-
NodeTransform,
21-
StructuralDirectiveTransform,
22-
DirectiveTransform
20+
type NodeTransform,
21+
type StructuralDirectiveTransform,
22+
type DirectiveTransform
2323
} from './transform'
24-
export { generate, CodegenContext, CodegenResult } from './codegen'
24+
export { generate, type CodegenContext, type CodegenResult } from './codegen'
2525
export {
2626
ErrorCodes,
27-
CoreCompilerError,
28-
CompilerError,
29-
createCompilerError
27+
createCompilerError,
28+
type CoreCompilerError,
29+
type CompilerError
3030
} from './errors'
3131

3232
export * from './ast'
3333
export * from './utils'
3434
export * from './babelUtils'
3535
export * from './runtimeHelpers'
3636

37-
export { getBaseTransformPreset, TransformPreset } from './compile'
37+
export { getBaseTransformPreset, type TransformPreset } from './compile'
3838
export { transformModel } from './transforms/vModel'
3939
export { transformOn } from './transforms/vOn'
4040
export { transformBind } from './transforms/vBind'
@@ -48,7 +48,7 @@ export {
4848
} from './transforms/transformExpression'
4949
export {
5050
buildSlots,
51-
SlotFnBuilder,
51+
type SlotFnBuilder,
5252
trackVForSlotScopes,
5353
trackSlotScopes
5454
} from './transforms/vSlot'
@@ -57,7 +57,7 @@ export {
5757
resolveComponentType,
5858
buildProps,
5959
buildDirectiveArgs,
60-
PropsExpression
60+
type PropsExpression
6161
} from './transforms/transformElement'
6262
export { processSlotOutlet } from './transforms/transformSlotOutlet'
6363
export { getConstantType } from './transforms/hoistStatic'

packages/compiler-sfc/src/index.ts

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export {
2727
} from '@vue/compiler-core'
2828

2929
// Types
30-
export {
30+
export type {
3131
SFCParseOptions,
3232
SFCParseResult,
3333
SFCDescriptor,
@@ -36,19 +36,22 @@ export {
3636
SFCScriptBlock,
3737
SFCStyleBlock
3838
} from './parse'
39-
export {
39+
export type {
4040
TemplateCompiler,
4141
SFCTemplateCompileOptions,
4242
SFCTemplateCompileResults
4343
} from './compileTemplate'
44-
export {
44+
export type {
4545
SFCStyleCompileOptions,
4646
SFCAsyncStyleCompileOptions,
4747
SFCStyleCompileResults
4848
} from './compileStyle'
49-
export { SFCScriptCompileOptions } from './compileScript'
50-
export { AssetURLOptions, AssetURLTagConfig } from './templateTransformAssetUrl'
51-
export {
49+
export type { SFCScriptCompileOptions } from './compileScript'
50+
export type {
51+
AssetURLOptions,
52+
AssetURLTagConfig
53+
} from './templateTransformAssetUrl'
54+
export type {
5255
CompilerOptions,
5356
CompilerError,
5457
BindingMetadata

packages/reactivity/src/index.ts

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@ export {
88
proxyRefs,
99
customRef,
1010
triggerRef,
11-
Ref,
12-
ToRef,
13-
ToRefs,
14-
UnwrapRef,
15-
ShallowRef,
16-
ShallowUnwrapRef,
17-
RefUnwrapBailTypes,
18-
CustomRefFactory
11+
type Ref,
12+
type ToRef,
13+
type ToRefs,
14+
type UnwrapRef,
15+
type ShallowRef,
16+
type ShallowUnwrapRef,
17+
type RefUnwrapBailTypes,
18+
type CustomRefFactory
1919
} from './ref'
2020
export {
2121
reactive,
@@ -28,19 +28,19 @@ export {
2828
shallowReadonly,
2929
markRaw,
3030
toRaw,
31-
Raw,
3231
ReactiveFlags,
33-
DeepReadonly,
34-
ShallowReactive,
35-
UnwrapNestedRefs
32+
type Raw,
33+
type DeepReadonly,
34+
type ShallowReactive,
35+
type UnwrapNestedRefs
3636
} from './reactive'
3737
export {
3838
computed,
39-
ComputedRef,
40-
WritableComputedRef,
41-
WritableComputedOptions,
42-
ComputedGetter,
43-
ComputedSetter
39+
type ComputedRef,
40+
type WritableComputedRef,
41+
type WritableComputedOptions,
42+
type ComputedGetter,
43+
type ComputedSetter
4444
} from './computed'
4545
export { deferredComputed } from './deferredComputed'
4646
export {
@@ -53,12 +53,12 @@ export {
5353
resetTracking,
5454
ITERATE_KEY,
5555
ReactiveEffect,
56-
ReactiveEffectRunner,
57-
ReactiveEffectOptions,
58-
EffectScheduler,
59-
DebuggerOptions,
60-
DebuggerEvent,
61-
DebuggerEventExtraInfo
56+
type ReactiveEffectRunner,
57+
type ReactiveEffectOptions,
58+
type EffectScheduler,
59+
type DebuggerOptions,
60+
type DebuggerEvent,
61+
type DebuggerEventExtraInfo
6262
} from './effect'
6363
export {
6464
effectScope,

packages/runtime-core/src/component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ export type Component<
162162
| ConcreteComponent<Props, RawBindings, D, C, M>
163163
| ComponentPublicInstanceConstructor<Props>
164164

165-
export { ComponentOptions }
165+
export type { ComponentOptions }
166166

167167
type LifecycleHook<TFn = Function> = TFn[] | null
168168

packages/runtime-core/src/index.ts

Lines changed: 29 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -86,11 +86,11 @@ export { h } from './h'
8686
// Advanced render function utilities
8787
export { createVNode, cloneVNode, mergeProps, isVNode } from './vnode'
8888
// VNode types
89-
export { Fragment, Text, Comment, Static, VNodeRef } from './vnode'
89+
export { Fragment, Text, Comment, Static, type VNodeRef } from './vnode'
9090
// Built-in components
91-
export { Teleport, TeleportProps } from './components/Teleport'
92-
export { Suspense, SuspenseProps } from './components/Suspense'
93-
export { KeepAlive, KeepAliveProps } from './components/KeepAlive'
91+
export { Teleport, type TeleportProps } from './components/Teleport'
92+
export { Suspense, type SuspenseProps } from './components/Suspense'
93+
export { KeepAlive, type KeepAliveProps } from './components/KeepAlive'
9494
export {
9595
BaseTransition,
9696
BaseTransitionPropsValidators,
@@ -148,8 +148,8 @@ declare module '@vue/reactivity' {
148148
}
149149
}
150150
}
151-
152-
export {
151+
export { TrackOpTypes, TriggerOpTypes } from '@vue/reactivity'
152+
export type {
153153
Ref,
154154
ToRef,
155155
ToRefs,
@@ -172,36 +172,34 @@ export {
172172
DebuggerOptions,
173173
DebuggerEvent,
174174
DebuggerEventExtraInfo,
175-
TrackOpTypes,
176-
TriggerOpTypes,
177175
Raw
178176
} from '@vue/reactivity'
179-
export {
177+
export type {
180178
WatchEffect,
181179
WatchOptions,
182180
WatchOptionsBase,
183181
WatchCallback,
184182
WatchSource,
185183
WatchStopHandle
186184
} from './apiWatch'
187-
export { InjectionKey } from './apiInject'
188-
export {
185+
export type { InjectionKey } from './apiInject'
186+
export type {
189187
App,
190188
AppConfig,
191189
AppContext,
192190
Plugin,
193191
CreateAppFunction,
194192
OptionMergeFunction
195193
} from './apiCreateApp'
196-
export {
194+
export type {
197195
VNode,
198196
VNodeChild,
199197
VNodeTypes,
200198
VNodeProps,
201199
VNodeArrayChildren,
202200
VNodeNormalizedChildren
203201
} from './vnode'
204-
export {
202+
export type {
205203
Component,
206204
ConcreteComponent,
207205
FunctionalComponent,
@@ -210,8 +208,8 @@ export {
210208
ComponentCustomProps,
211209
AllowedComponentProps
212210
} from './component'
213-
export { DefineComponent } from './apiDefineComponent'
214-
export {
211+
export type { DefineComponent } from './apiDefineComponent'
212+
export type {
215213
ComponentOptions,
216214
ComponentOptionsMixin,
217215
ComponentOptionsWithoutProps,
@@ -226,45 +224,48 @@ export {
226224
RuntimeCompilerOptions,
227225
ComponentInjectOptions
228226
} from './componentOptions'
229-
export { EmitsOptions, ObjectEmitsOptions } from './componentEmits'
230-
export {
227+
export type { EmitsOptions, ObjectEmitsOptions } from './componentEmits'
228+
export type {
231229
ComponentPublicInstance,
232230
ComponentCustomProperties,
233231
CreateComponentPublicInstance
234232
} from './componentPublicInstance'
235-
export {
233+
export type {
236234
Renderer,
237235
RendererNode,
238236
RendererElement,
239237
HydrationRenderer,
240238
RendererOptions,
241239
RootRenderFunction
242240
} from './renderer'
243-
export { RootHydrateFunction } from './hydration'
244-
export { Slot, Slots } from './componentSlots'
245-
export {
241+
export type { RootHydrateFunction } from './hydration'
242+
export type { Slot, Slots } from './componentSlots'
243+
export type {
246244
Prop,
247245
PropType,
248246
ComponentPropsOptions,
249247
ComponentObjectPropsOptions,
250248
ExtractPropTypes,
251249
ExtractDefaultPropTypes
252250
} from './componentProps'
253-
export {
251+
export type {
254252
Directive,
255253
DirectiveBinding,
256254
DirectiveHook,
257255
ObjectDirective,
258256
FunctionDirective,
259257
DirectiveArguments
260258
} from './directives'
261-
export { SuspenseBoundary } from './components/Suspense'
262-
export { TransitionState, TransitionHooks } from './components/BaseTransition'
263-
export {
259+
export type { SuspenseBoundary } from './components/Suspense'
260+
export type {
261+
TransitionState,
262+
TransitionHooks
263+
} from './components/BaseTransition'
264+
export type {
264265
AsyncComponentOptions,
265266
AsyncComponentLoader
266267
} from './apiAsyncComponent'
267-
export { HMRRuntime } from './hmr'
268+
export type { HMRRuntime } from './hmr'
268269

269270
// Internal API ----------------------------------------------------------------
270271

@@ -336,8 +337,8 @@ export const ssrUtils = (__SSR__ ? _ssrUtils : null) as typeof _ssrUtils
336337
// 2.x COMPAT ------------------------------------------------------------------
337338

338339
export { DeprecationTypes } from './compat/compatConfig'
339-
export { CompatVue } from './compat/global'
340-
export { LegacyConfig } from './compat/globalConfig'
340+
export type { CompatVue } from './compat/global'
341+
export type { LegacyConfig } from './compat/globalConfig'
341342

342343
import { warnDeprecation } from './compat/compatConfig'
343344
import { createCompatVue } from './compat/global'

packages/runtime-dom/src/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -207,18 +207,18 @@ export {
207207
defineCustomElement,
208208
defineSSRCustomElement,
209209
VueElement,
210-
VueElementConstructor
210+
type VueElementConstructor
211211
} from './apiCustomElement'
212212

213213
// SFC CSS utilities
214214
export { useCssModule } from './helpers/useCssModule'
215215
export { useCssVars } from './helpers/useCssVars'
216216

217217
// DOM-only components
218-
export { Transition, TransitionProps } from './components/Transition'
218+
export { Transition, type TransitionProps } from './components/Transition'
219219
export {
220220
TransitionGroup,
221-
TransitionGroupProps
221+
type TransitionGroupProps
222222
} from './components/TransitionGroup'
223223

224224
// **Internal** DOM-only runtime directive helpers

packages/runtime-dom/src/modules/events.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import { hyphenate, isArray } from '@vue/shared'
22
import {
3+
ErrorCodes,
34
ComponentInternalInstance,
45
callWithAsyncErrorHandling
56
} from '@vue/runtime-core'
6-
import { ErrorCodes } from 'packages/runtime-core/src/errorHandling'
77

88
interface Invoker extends EventListener {
99
value: EventValue

0 commit comments

Comments
 (0)