diff --git a/cli/help.md b/cli/help.md index 947a2bd1848..387505d86d5 100644 --- a/cli/help.md +++ b/cli/help.md @@ -38,16 +38,18 @@ Basic options: --failAfterWarnings Exit with an error if the build produced warnings --footer Code to insert at end of bundle (outside wrapper) --no-freeze Do not freeze namespace objects +--generatedCode Which code features to use (es5/es2015) --no-hoistTransitiveImports Do not hoist transitive imports into entry chunks --no-indent Don't indent result --no-interop Do not include interop block --inlineDynamicImports Create single bundle when using dynamic imports --intro Code to insert at top of bundle (inside wrapper) +--no-makeAbsoluteExternalsRelative Prevent normalization of external imports +--maxParallelFileReads How many files to read in parallel --minifyInternalExports Force or disable minification of internal exports ---namespaceToStringTag Create proper `.toString` methods for namespaces --noConflict Generate a noConflict method for UMD globals --outro Code to insert at end of bundle (inside wrapper) ---preferConst Use `const` instead of `var` for exports +--perf Display performance timings --no-preserveEntrySignatures Avoid facade chunks for entry points --preserveModules Preserve module structure --preserveModulesRoot Put preserved modules under this path at root level diff --git a/cli/run/waitForInput.ts b/cli/run/waitForInput.ts index 69fdd9254c2..fb43776a0df 100644 --- a/cli/run/waitForInput.ts +++ b/cli/run/waitForInput.ts @@ -1,5 +1,4 @@ -import type { PluginContext } from 'rollup'; -import type { NormalizedInputOptions, Plugin } from '../../src/rollup/types'; +import type { NormalizedInputOptions, Plugin, PluginContext } from '../../src/rollup/types'; import { bold } from '../../src/utils/colors'; import { stderr } from '../logging'; diff --git a/docs/01-command-line-reference.md b/docs/01-command-line-reference.md index 7bf701e6dc7..acec986e4a4 100755 --- a/docs/01-command-line-reference.md +++ b/docs/01-command-line-reference.md @@ -375,16 +375,18 @@ Many options have command line equivalents. In those cases, any arguments passed --failAfterWarnings Exit with an error if the build produced warnings --footer Code to insert at end of bundle (outside wrapper) --no-freeze Do not freeze namespace objects +--generatedCode Which code features to use (es5/es2015) --no-hoistTransitiveImports Do not hoist transitive imports into entry chunks --no-indent Don't indent result --no-interop Do not include interop block --inlineDynamicImports Create single bundle when using dynamic imports --intro Code to insert at top of bundle (inside wrapper) +--no-makeAbsoluteExternalsRelative Prevent normalization of external imports +--maxParallelFileReads How many files to read in parallel --minifyInternalExports Force or disable minification of internal exports ---namespaceToStringTag Create proper `.toString` methods for namespaces --noConflict Generate a noConflict method for UMD globals --outro Code to insert at end of bundle (inside wrapper) ---preferConst Use `const` instead of `var` for exports +--perf Display performance timings --no-preserveEntrySignatures Avoid facade chunks for entry points --preserveModules Preserve module structure --preserveModulesRoot Put preserved modules under this path at root level diff --git a/docs/05-plugin-development.md b/docs/05-plugin-development.md index e43b9d9df4d..a9c64065f8e 100644 --- a/docs/05-plugin-development.md +++ b/docs/05-plugin-development.md @@ -600,14 +600,6 @@ Note that since this hook has access to the filename of the current chunk, its r Called only at the end of `bundle.write()` once all files have been written. Similar to the [`generateBundle`](guide/en/#generatebundle) hook, `bundle` provides the full list of files being written along with their details. -### Deprecated Hooks - -☢️ These hooks have been deprecated and may be removed in a future Rollup version. - -- `resolveAssetUrl` - _**Use [`resolveFileUrl`](guide/en/#resolvefileurl)**_ - Function hook that allows to customize the generated code for asset URLs. - -More properties may be supported in the future, as and when they prove necessary. - ### Plugin Context A number of utility functions and informational bits can be accessed from within most [hooks](guide/en/#build-hooks) via `this`: @@ -991,24 +983,6 @@ The `position` argument is a character index where the warning was raised. If pr ☢️ These context utility functions have been deprecated and may be removed in a future Rollup version. -- `this.emitAsset(assetName: string, source: string) => string` - _**Use [`this.emitFile`](guide/en/#thisemitfile)**_ - Emits a custom file that is included in the build output, returning a `referenceId` that can be used to reference the emitted file. You can defer setting the source if you provide it later via [`this.setAssetSource(referenceId, source)`](guide/en/#thissetassetsource). A string or `Uint8Array`/`Buffer` source must be set for each asset through either method or an error will be thrown on generate completion. - - Emitted assets will follow the [`output.assetFileNames`](guide/en/#outputassetfilenames) naming scheme. You can reference the URL of the file in any code returned by a [`load`](guide/en/#load) or [`transform`](guide/en/#transform) plugin hook via `import.meta.ROLLUP_ASSET_URL_referenceId`. - - The generated code that replaces `import.meta.ROLLUP_ASSET_URL_referenceId` can be customized via the [`resolveFileUrl`](guide/en/#resolvefileurl) plugin hook. Once the asset has been finalized during `generate`, you can also use [`this.getFileName(referenceId)`](guide/en/#thisgetfilename) to determine the file name. - -- `this.emitChunk(moduleId: string, options?: {name?: string}) => string` - _**Use [`this.emitFile`](guide/en/#thisemitfile)**_ - Emits a new chunk with the given module as entry point. This will not result in duplicate modules in the graph, instead if necessary, existing chunks will be split. It returns a `referenceId` that can be used to later access the generated file name of the chunk. - - Emitted chunks will follow the [`output.chunkFileNames`](guide/en/#outputchunkfilenames), [`output.entryFileNames`](guide/en/#outputentryfilenames) naming scheme. If a `name` is provided, this will be used for the `[name]` file name placeholder, otherwise the name will be derived from the file name. If a `name` is provided, this name must not conflict with any other entry point names unless the entry points reference the same entry module. You can reference the URL of the emitted chunk in any code returned by a [`load`](guide/en/#load) or [`transform`](guide/en/#transform) plugin hook via `import.meta.ROLLUP_CHUNK_URL_referenceId`. - - The generated code that replaces `import.meta.ROLLUP_CHUNK_URL_referenceId` can be customized via the [`resolveFileUrl`](guide/en/#resolvefileurl) plugin hook. Once the chunk has been rendered during `generate`, you can also use [`this.getFileName(referenceId)`](guide/en/#thisgetfilename) to determine the file name. - -- `this.getAssetFileName(referenceId: string) => string` - _**Use [`this.getFileName`](guide/en/#thisgetfilename)**_ - Get the file name of an asset, according to the `assetFileNames` output option pattern. The file name will be relative to `outputOptions.dir`. - -- `this.getChunkFileName(referenceId: string) => string` - _**Use [`this.getFileName`](guide/en/#thisgetfilename)**_ - Get the file name of an emitted chunk. The file name will be relative to `outputOptions.dir`. - -- `this.isExternal(id: string, importer: string | undefined, isResolved: boolean) => boolean` - _**Use [`this.resolve`](guide/en/#thisresolve)**_ - Determine if a given module ID is external when imported by `importer`. When `isResolved` is false, Rollup will try to resolve the id before testing if it is external. - - `this.moduleIds: IterableIterator` - _**Use [`this.getModuleIds`](guide/en/#thisgetmoduleids)**_ - An `Iterator` that gives access to all module ids in the current graph. It can be iterated via ```js @@ -1019,8 +993,6 @@ The `position` argument is a character index where the warning was raised. If pr or converted into an Array via `Array.from(this.moduleIds)`. -- `this.resolveId(source: string, importer?: string) => Promise` - _**Use [`this.resolve`](guide/en/#thisresolve)**_ - Resolve imports to module ids (i.e. file names) using the same plugins that Rollup uses. Returns `null` if an id cannot be resolved. - ### File URLs To reference a file URL reference from within JS code, use the `import.meta.ROLLUP_FILE_URL_referenceId` replacement. This will generate code that depends on the output format and generates a URL that points to the emitted file in the target environment. Note that all formats except CommonJS and UMD assume that they run in a browser environment where `URL` and `document` are available. diff --git a/docs/999-big-list-of-options.md b/docs/999-big-list-of-options.md index da4aace22a4..a022d0bd2c5 100755 --- a/docs/999-big-list-of-options.md +++ b/docs/999-big-list-of-options.md @@ -1474,12 +1474,6 @@ Type: `boolean`
CLI: `--noConflict`/`--no-noConflict`
Default: `false` This will generate an additional `noConflict` export to UMD bundles. When called in an IIFE scenario, this method will return the bundle exports while restoring the corresponding global variable to its previous value. -#### output.preferConst - -Type: `boolean`
CLI: `--preferConst`/`--no-preferConst`
Default: `false` - -Generate `const` declarations for exports rather than `var` declarations. - #### output.sanitizeFileName Type: `boolean | (string) => string`
CLI: `--sanitizeFileName`/`no-sanitizeFileName` Default: `true` @@ -1904,33 +1898,6 @@ _Use the [`output.generatedCode.constBindings`](guide/en/#outputgeneratedcode) o Generate `const` declarations for exports rather than `var` declarations. -#### treeshake.pureExternalModules - -_Use [`treeshake.moduleSideEffects: 'no-external'`](guide/en/#treeshake) instead._
Type: `boolean | string[] | (id: string) => boolean | null`
CLI: `--treeshake.pureExternalModules`/`--no-treeshake.pureExternalModules`
Default: `false` - -If `true`, assume external dependencies from which nothing is imported do not have other side effects like mutating global variables or logging. - -```javascript -// input file -import { unused } from 'external-a'; -import 'external-b'; -console.log(42); -``` - -```javascript -// output with treeshake.pureExternalModules === false -import 'external-a'; -import 'external-b'; -console.log(42); -``` - -```javascript -// output with treeshake.pureExternalModules === true -console.log(42); -``` - -You can also supply a list of external ids to be considered pure or a function that is called whenever an external import could be removed. - #### output.namespaceToStringTag _Use [`output.generatedCode.symbols`](guide/en/#outputgeneratedcode) instead._
Type: `boolean`
CLI: `--namespaceToStringTag`/`--no-namespaceToStringTag`
Default: `false` diff --git a/src/Bundle.ts b/src/Bundle.ts index 271e84d7130..7e7c1b254a5 100644 --- a/src/Bundle.ts +++ b/src/Bundle.ts @@ -6,7 +6,6 @@ import type { GetManualChunk, NormalizedInputOptions, NormalizedOutputOptions, - OutputAsset, OutputBundle, OutputChunk, WarningHandler @@ -19,8 +18,7 @@ import { errCannotAssignModuleToChunk, errChunkInvalid, errInvalidOption, - error, - warnDeprecation + error } from './utils/error'; import { sortByExecutionOrder } from './utils/executionOrder'; import { type GenerateCodeSnippets, getGenerateCodeSnippets } from './utils/generateCodeSnippets'; @@ -185,14 +183,6 @@ export default class Bundle { private finaliseAssets(outputBundle: OutputBundleWithPlaceholders): void { for (const file of Object.values(outputBundle)) { - if (!file.type) { - warnDeprecation( - 'A plugin is directly adding properties to the bundle object in the "generateBundle" hook. This is deprecated and will be removed in a future Rollup version, please use "this.emitFile" instead.', - true, - this.inputOptions - ); - (file as OutputAsset).type = 'asset'; - } if (this.outputOptions.validate && 'code' in file) { try { this.graph.contextParse(file.code, { diff --git a/src/ExternalModule.ts b/src/ExternalModule.ts index a5292866bb2..8255da456af 100644 --- a/src/ExternalModule.ts +++ b/src/ExternalModule.ts @@ -51,7 +51,7 @@ export default class ExternalModule { get hasModuleSideEffects() { warnDeprecation( 'Accessing ModuleInfo.hasModuleSideEffects from plugins is deprecated. Please use ModuleInfo.moduleSideEffects instead.', - false, + true, options ); return info.moduleSideEffects; diff --git a/src/Module.ts b/src/Module.ts index 439f8dd6c24..5ca4f29dd66 100644 --- a/src/Module.ts +++ b/src/Module.ts @@ -297,7 +297,7 @@ export default class Module { get hasModuleSideEffects() { warnDeprecation( 'Accessing ModuleInfo.hasModuleSideEffects from plugins is deprecated. Please use ModuleInfo.moduleSideEffects instead.', - false, + true, options ); return this.moduleSideEffects; diff --git a/src/ast/nodes/MetaProperty.ts b/src/ast/nodes/MetaProperty.ts index 9b0c8a5f729..807d8e6f194 100644 --- a/src/ast/nodes/MetaProperty.ts +++ b/src/ast/nodes/MetaProperty.ts @@ -1,7 +1,6 @@ import type MagicString from 'magic-string'; import type { InternalModuleFormat } from '../../rollup/types'; import type { PluginDriver } from '../../utils/PluginDriver'; -import { warnDeprecation } from '../../utils/error'; import type { GenerateCodeSnippets } from '../../utils/generateCodeSnippets'; import { dirname, normalize, relative } from '../../utils/path'; import { INTERACTION_ACCESSED, NodeInteraction } from '../NodeInteractions'; @@ -12,8 +11,6 @@ import MemberExpression from './MemberExpression'; import type * as NodeType from './NodeType'; import { NodeBase } from './shared/Node'; -const ASSET_PREFIX = 'ROLLUP_ASSET_URL_'; -const CHUNK_PREFIX = 'ROLLUP_CHUNK_URL_'; const FILE_PREFIX = 'ROLLUP_FILE_URL_'; export default class MetaProperty extends NodeBase { @@ -29,10 +26,7 @@ export default class MetaProperty extends NodeBase { ): void { const metaProperty = this.metaProperty; const accessedGlobals = ( - metaProperty && - (metaProperty.startsWith(FILE_PREFIX) || - metaProperty.startsWith(ASSET_PREFIX) || - metaProperty.startsWith(CHUNK_PREFIX)) + metaProperty && metaProperty.startsWith(FILE_PREFIX) ? accessedFileUrlGlobals : accessedMetaUrlGlobals )[format]; @@ -81,64 +75,22 @@ export default class MetaProperty extends NodeBase { const parent = this.parent; const metaProperty = this.metaProperty as string | null; - if ( - metaProperty && - (metaProperty.startsWith(FILE_PREFIX) || - metaProperty.startsWith(ASSET_PREFIX) || - metaProperty.startsWith(CHUNK_PREFIX)) - ) { + if (metaProperty && metaProperty.startsWith(FILE_PREFIX)) { let referenceId: string | null = null; - let assetReferenceId: string | null = null; - let chunkReferenceId: string | null = null; - let fileName: string; - if (metaProperty.startsWith(FILE_PREFIX)) { - referenceId = metaProperty.substring(FILE_PREFIX.length); - fileName = outputPluginDriver.getFileName(referenceId); - } else if (metaProperty.startsWith(ASSET_PREFIX)) { - warnDeprecation( - `Using the "${ASSET_PREFIX}" prefix to reference files is deprecated. Use the "${FILE_PREFIX}" prefix instead.`, - true, - this.context.options - ); - assetReferenceId = metaProperty.substring(ASSET_PREFIX.length); - fileName = outputPluginDriver.getFileName(assetReferenceId); - } else { - warnDeprecation( - `Using the "${CHUNK_PREFIX}" prefix to reference files is deprecated. Use the "${FILE_PREFIX}" prefix instead.`, - true, - this.context.options - ); - chunkReferenceId = metaProperty.substring(CHUNK_PREFIX.length); - fileName = outputPluginDriver.getFileName(chunkReferenceId); - } + referenceId = metaProperty.substring(FILE_PREFIX.length); + const fileName = outputPluginDriver.getFileName(referenceId); const relativePath = normalize(relative(dirname(chunkId), fileName)); - let replacement; - if (assetReferenceId !== null) { - replacement = outputPluginDriver.hookFirstSync('resolveAssetUrl', [ + const replacement = + outputPluginDriver.hookFirstSync('resolveFileUrl', [ { - assetFileName: fileName, chunkId, + fileName, format, moduleId: this.context.module.id, - relativeAssetPath: relativePath + referenceId, + relativePath } - ]); - } - if (!replacement) { - replacement = - outputPluginDriver.hookFirstSync('resolveFileUrl', [ - { - assetReferenceId, - chunkId, - chunkReferenceId, - fileName, - format, - moduleId: this.context.module.id, - referenceId: referenceId || assetReferenceId || chunkReferenceId!, - relativePath - } - ]) || relativeUrlMechanisms[format](relativePath); - } + ]) || relativeUrlMechanisms[format](relativePath); code.overwrite( (parent as MemberExpression).start, diff --git a/src/rollup/types.d.ts b/src/rollup/types.d.ts index cfa9e973592..1e2e37f4f60 100644 --- a/src/rollup/types.d.ts +++ b/src/rollup/types.d.ts @@ -150,10 +150,6 @@ export interface EmittedChunk { export type EmittedFile = EmittedAsset | EmittedChunk; -export type EmitAsset = (name: string, source?: string | Uint8Array) => string; - -export type EmitChunk = (id: string, options?: { name?: string }) => string; - export type EmitFile = (emittedFile: EmittedFile) => string; interface ModuleInfo extends ModuleOptions { @@ -185,22 +181,12 @@ export interface CustomPluginOptions { export interface PluginContext extends MinimalPluginContext { addWatchFile: (id: string) => void; cache: PluginCache; - /** @deprecated Use `this.emitFile` instead */ - emitAsset: EmitAsset; - /** @deprecated Use `this.emitFile` instead */ - emitChunk: EmitChunk; emitFile: EmitFile; error: (err: RollupError | string, pos?: number | { column: number; line: number }) => never; - /** @deprecated Use `this.getFileName` instead */ - getAssetFileName: (assetReferenceId: string) => string; - /** @deprecated Use `this.getFileName` instead */ - getChunkFileName: (chunkReferenceId: string) => string; getFileName: (fileReferenceId: string) => string; getModuleIds: () => IterableIterator; getModuleInfo: GetModuleInfo; getWatchFiles: () => string[]; - /** @deprecated Use `this.resolve` instead */ - isExternal: IsExternal; load: ( options: { id: string; resolveDependencies?: boolean } & Partial> ) => Promise; @@ -212,8 +198,6 @@ export interface PluginContext extends MinimalPluginContext { importer?: string, options?: { custom?: CustomPluginOptions; isEntry?: boolean; skipSelf?: boolean } ) => Promise; - /** @deprecated Use `this.resolve` instead */ - resolveId: (source: string, importer?: string) => Promise; setAssetSource: (assetReferenceId: string, source: string | Uint8Array) => void; warn: (warning: RollupWarning | string, pos?: number | { column: number; line: number }) => void; } @@ -306,23 +290,10 @@ export type ResolveImportMetaHook = ( options: { chunkId: string; format: InternalModuleFormat; moduleId: string } ) => string | null | void; -export type ResolveAssetUrlHook = ( - this: PluginContext, - options: { - assetFileName: string; - chunkId: string; - format: InternalModuleFormat; - moduleId: string; - relativeAssetPath: string; - } -) => string | null | void; - export type ResolveFileUrlHook = ( this: PluginContext, options: { - assetReferenceId: string | null; chunkId: string; - chunkReferenceId: string | null; fileName: string; format: InternalModuleFormat; moduleId: string; @@ -390,8 +361,6 @@ export interface FunctionPluginHooks { outputOptions: NormalizedOutputOptions, inputOptions: NormalizedInputOptions ) => void; - /** @deprecated Use `resolveFileUrl` instead */ - resolveAssetUrl: ResolveAssetUrlHook; resolveDynamicImport: ResolveDynamicImportHook; resolveFileUrl: ResolveFileUrlHook; resolveId: ResolveIdHook; @@ -414,7 +383,6 @@ export type OutputPluginHooks = | 'renderDynamicImport' | 'renderError' | 'renderStart' - | 'resolveAssetUrl' | 'resolveFileUrl' | 'resolveImportMeta' | 'writeBundle'; @@ -425,7 +393,6 @@ export type SyncPluginHooks = | 'augmentChunkHash' | 'outputOptions' | 'renderDynamicImport' - | 'resolveAssetUrl' | 'resolveFileUrl' | 'resolveImportMeta'; @@ -434,7 +401,6 @@ export type AsyncPluginHooks = Exclude> { moduleSideEffects?: ModuleSideEffectsOption; preset?: TreeshakingPreset; - /** @deprecated Use `moduleSideEffects` instead */ - pureExternalModules?: PureModulesOption; } interface GetManualChunkApi { @@ -719,12 +683,13 @@ export interface NormalizedOutputOptions { manualChunks: ManualChunksOption; minifyInternalExports: boolean; name: string | undefined; + /** @deprecated Use "generatedCode.symbols" instead. */ namespaceToStringTag: boolean; noConflict: boolean; outro: () => string | Promise; paths: OptionsPaths; plugins: OutputPlugin[]; - /** @deprecated Use the "renderDynamicImport" plugin hook instead. */ + /** @deprecated Use "generatedCode.constBindings" instead. */ preferConst: boolean; preserveModules: boolean; preserveModulesRoot: string | undefined; @@ -757,8 +722,6 @@ export interface PreRenderedAsset { export interface OutputAsset extends PreRenderedAsset { fileName: string; - /** @deprecated Accessing "isAsset" on files in the bundle is deprecated, please use "type === \'asset\'" instead */ - isAsset: true; } export interface RenderedModule { diff --git a/src/utils/FileEmitter.ts b/src/utils/FileEmitter.ts index 81c3e222234..448f44505e3 100644 --- a/src/utils/FileEmitter.ts +++ b/src/utils/FileEmitter.ts @@ -19,8 +19,7 @@ import { errFileReferenceIdNotFoundForFilename, errInvalidRollupPhaseForChunkEmission, errNoAssetSourceSet, - error, - warnDeprecation + error } from './error'; import { FILE_PLACEHOLDER, @@ -330,18 +329,8 @@ export class FileEmitter { // We must not modify the original assets to avoid interaction between outputs const assetWithFileName = { ...consumedFile, fileName, source }; this.filesByReferenceId.set(referenceId, assetWithFileName); - const { options } = this; bundle[fileName] = { fileName, - get isAsset(): true { - warnDeprecation( - 'Accessing "isAsset" on files in the bundle is deprecated, please use "type === \'asset\'" instead', - true, - options - ); - - return true; - }, name: consumedFile.name, source, type: 'asset' diff --git a/src/utils/PluginContext.ts b/src/utils/PluginContext.ts index 88d06332889..11b1073ecbe 100644 --- a/src/utils/PluginContext.ts +++ b/src/utils/PluginContext.ts @@ -18,35 +18,6 @@ import { throwPluginError } from './pluginUtils'; -function getDeprecatedContextHandler< - THandler extends (...args: TParams) => TResult, - TParams extends readonly any[], - TResult ->( - handler: THandler, - handlerName: string, - newHandlerName: string, - pluginName: string, - activeDeprecation: boolean, - options: NormalizedInputOptions -): THandler { - let deprecationWarningShown = false; - return ((...args: TParams): TResult => { - if (!deprecationWarningShown) { - deprecationWarningShown = true; - warnDeprecation( - { - message: `The "this.${handlerName}" plugin context function used by plugin ${pluginName} is deprecated. The "this.${newHandlerName}" plugin context function should be used instead.`, - plugin: pluginName - }, - activeDeprecation, - options - ); - } - return handler(...args); - }) as THandler; -} - export function getPluginContext( plugin: Plugin, pluginCache: Record | void, @@ -88,57 +59,14 @@ export function getPluginContext( graph.watchFiles[id] = true; }, cache: cacheInstance, - emitAsset: getDeprecatedContextHandler( - (name: string, source?: string | Uint8Array) => - fileEmitter.emitFile({ name, source, type: 'asset' }), - 'emitAsset', - 'emitFile', - plugin.name, - true, - options - ), - emitChunk: getDeprecatedContextHandler( - (id: string, options?: { name?: string }) => - fileEmitter.emitFile({ id, name: options && options.name, type: 'chunk' }), - 'emitChunk', - 'emitFile', - plugin.name, - true, - options - ), emitFile: fileEmitter.emitFile.bind(fileEmitter), error(err): never { return throwPluginError(err, plugin.name); }, - getAssetFileName: getDeprecatedContextHandler( - fileEmitter.getFileName, - 'getAssetFileName', - 'getFileName', - plugin.name, - true, - options - ), - getChunkFileName: getDeprecatedContextHandler( - fileEmitter.getFileName, - 'getChunkFileName', - 'getFileName', - plugin.name, - true, - options - ), getFileName: fileEmitter.getFileName, getModuleIds: () => graph.modulesById.keys(), getModuleInfo: graph.getModuleInfo, getWatchFiles: () => Object.keys(graph.watchFiles), - isExternal: getDeprecatedContextHandler( - (id: string, parentId: string | undefined, isResolved = false) => - options.external(id, parentId, isResolved), - 'isExternal', - 'resolve', - plugin.name, - true, - options - ), load(resolvedId) { return graph.moduleLoader.preloadModule(resolvedId); }, @@ -154,7 +82,7 @@ export function getPluginContext( message: `Accessing "this.moduleIds" on the plugin context by plugin ${plugin.name} is deprecated. The "this.getModuleIds" plugin context function should be used instead.`, plugin: plugin.name }, - false, + true, options ); yield* moduleIds; @@ -173,17 +101,6 @@ export function getPluginContext( skipSelf ? [{ importer, plugin, source }] : null ); }, - resolveId: getDeprecatedContextHandler( - (source: string, importer: string | undefined) => - graph.moduleLoader - .resolveId(source, importer, BLANK, undefined) - .then(resolveId => resolveId && resolveId.id), - 'resolveId', - 'resolve', - plugin.name, - true, - options - ), setAssetSource: fileEmitter.setAssetSource, warn(warning) { if (typeof warning === 'string') warning = { message: warning }; diff --git a/src/utils/PluginDriver.ts b/src/utils/PluginDriver.ts index 6eca7bdc214..5171bc19668 100644 --- a/src/utils/PluginDriver.ts +++ b/src/utils/PluginDriver.ts @@ -28,7 +28,7 @@ import { } from './error'; import { getOrCreate } from './getOrCreate'; import { OutputBundleWithPlaceholders } from './outputBundle'; -import { throwPluginError, warnDeprecatedHooks } from './pluginUtils'; +import { throwPluginError } from './pluginUtils'; /** * Coerce a promise union to always be a promise. @@ -87,7 +87,6 @@ export class PluginDriver { private readonly pluginCache: Record | undefined, basePluginDriver?: PluginDriver ) { - warnDeprecatedHooks(userPlugins, options); this.fileEmitter = new FileEmitter( graph, options, diff --git a/src/utils/options/normalizeInputOptions.ts b/src/utils/options/normalizeInputOptions.ts index 11c88251878..5353f2ed7ed 100644 --- a/src/utils/options/normalizeInputOptions.ts +++ b/src/utils/options/normalizeInputOptions.ts @@ -5,7 +5,6 @@ import type { ModuleSideEffectsOption, NormalizedInputOptions, PreserveEntrySignaturesOption, - PureModulesOption, RollupBuild, WarningHandler } from '../../rollup/types'; @@ -61,7 +60,7 @@ export function normalizeInputOptions(config: InputOptions): { preserveSymlinks: config.preserveSymlinks || false, shimMissingExports: config.shimMissingExports || false, strictDeprecations, - treeshake: getTreeshake(config, onwarn, strictDeprecations) + treeshake: getTreeshake(config) }; warnUnknownOptions( @@ -147,7 +146,7 @@ const getInlineDynamicImports = ( if (configInlineDynamicImports) { warnDeprecationWithOptions( 'The "inlineDynamicImports" option is deprecated. Use the "output.inlineDynamicImports" option instead.', - false, + true, warn, strictDeprecations ); @@ -169,7 +168,7 @@ const getManualChunks = ( if (configManualChunks) { warnDeprecationWithOptions( 'The "manualChunks" option is deprecated. Use the "output.manualChunks" option instead.', - false, + true, warn, strictDeprecations ); @@ -242,7 +241,7 @@ const getPreserveModules = ( if (configPreserveModules) { warnDeprecationWithOptions( 'The "preserveModules" option is deprecated. Use the "output.preserveModules" option instead.', - false, + true, warn, strictDeprecations ); @@ -250,11 +249,7 @@ const getPreserveModules = ( return configPreserveModules; }; -const getTreeshake = ( - config: InputOptions, - warn: WarningHandler, - strictDeprecations: boolean -): NormalizedInputOptions['treeshake'] => { +const getTreeshake = (config: InputOptions): NormalizedInputOptions['treeshake'] => { const configTreeshake = config.treeshake; if (configTreeshake === false) { return false; @@ -265,27 +260,12 @@ const getTreeshake = ( 'treeshake', 'false, true, ' ); - if (typeof configWithPreset.pureExternalModules !== 'undefined') { - warnDeprecationWithOptions( - `The "treeshake.pureExternalModules" option is deprecated. The "treeshake.moduleSideEffects" option should be used instead. "treeshake.pureExternalModules: true" is equivalent to "treeshake.moduleSideEffects: 'no-external'"`, - true, - warn, - strictDeprecations - ); - } return { annotations: configWithPreset.annotations !== false, correctVarValueBeforeDeclaration: configWithPreset.correctVarValueBeforeDeclaration === true, - moduleSideEffects: - typeof configTreeshake === 'object' && configTreeshake.pureExternalModules - ? getHasModuleSideEffects( - configTreeshake.moduleSideEffects, - configTreeshake.pureExternalModules - ) - : getHasModuleSideEffects( - configWithPreset.moduleSideEffects as ModuleSideEffectsOption | undefined, - undefined - ), + moduleSideEffects: getHasModuleSideEffects( + configWithPreset.moduleSideEffects as ModuleSideEffectsOption | undefined + ), propertyReadSideEffects: configWithPreset.propertyReadSideEffects === 'always' ? 'always' @@ -296,8 +276,7 @@ const getTreeshake = ( }; const getHasModuleSideEffects = ( - moduleSideEffectsOption: ModuleSideEffectsOption | undefined, - pureExternalModules: PureModulesOption | undefined + moduleSideEffectsOption: ModuleSideEffectsOption | undefined ): HasModuleSideEffects => { if (typeof moduleSideEffectsOption === 'boolean') { return () => moduleSideEffectsOption; @@ -322,6 +301,5 @@ const getHasModuleSideEffects = ( ) ); } - const isPureExternalModule = getIdMatcher(pureExternalModules); - return (id, external) => !(external && isPureExternalModule(id)); + return () => true; }; diff --git a/src/utils/options/normalizeOutputOptions.ts b/src/utils/options/normalizeOutputOptions.ts index 4fdf9143dec..3ccb72d8bce 100644 --- a/src/utils/options/normalizeOutputOptions.ts +++ b/src/utils/options/normalizeOutputOptions.ts @@ -207,7 +207,7 @@ const getPreferConst = ( if (configPreferConst != null) { warnDeprecation( `The "output.preferConst" option is deprecated. Use the "output.generatedCode.constBindings" option instead.`, - false, + true, inputOptions ); } @@ -312,7 +312,7 @@ const getDynamicImportFunction = ( if (configDynamicImportFunction) { warnDeprecation( `The "output.dynamicImportFunction" option is deprecated. Use the "renderDynamicImport" plugin hook instead.`, - false, + true, inputOptions ); } @@ -408,7 +408,7 @@ const getInterop = ( } instead.`, url: 'https://rollupjs.org/guide/en/#outputinterop' }, - false, + true, inputOptions ); } @@ -475,7 +475,7 @@ const getNamespaceToStringTag = ( if (configNamespaceToStringTag != null) { warnDeprecation( `The "output.namespaceToStringTag" option is deprecated. Use the "output.generatedCode.symbols" option instead.`, - false, + true, inputOptions ); return configNamespaceToStringTag; diff --git a/src/utils/pluginUtils.ts b/src/utils/pluginUtils.ts index 05cc8ba25b3..ab55417731c 100644 --- a/src/utils/pluginUtils.ts +++ b/src/utils/pluginUtils.ts @@ -1,5 +1,5 @@ -import type { NormalizedInputOptions, Plugin, RollupError } from '../rollup/types'; -import { error, Errors, warnDeprecation } from './error'; +import type { RollupError } from '../rollup/types'; +import { error, Errors } from './error'; export const ANONYMOUS_PLUGIN_PREFIX = 'at position '; export const ANONYMOUS_OUTPUT_PLUGIN_PREFIX = 'at output position '; @@ -23,27 +23,3 @@ export function throwPluginError( } return error(err); } - -const deprecatedHooks = [ - { active: true, deprecated: 'resolveAssetUrl', replacement: 'resolveFileUrl' } -] as const; - -export function warnDeprecatedHooks( - plugins: readonly Plugin[], - options: NormalizedInputOptions -): void { - for (const { active, deprecated, replacement } of deprecatedHooks) { - for (const plugin of plugins) { - if (deprecated in plugin) { - warnDeprecation( - { - message: `The "${deprecated}" hook used by plugin ${plugin.name} is deprecated. The "${replacement}" hook should be used instead.`, - plugin: plugin.name - }, - active, - options - ); - } - } - } -} diff --git a/src/utils/transform.ts b/src/utils/transform.ts index a4607242320..6b7d3aad0d6 100644 --- a/src/utils/transform.ts +++ b/src/utils/transform.ts @@ -95,14 +95,6 @@ export default async function transform( cache: customTransformCache ? pluginContext.cache : getTrackedPluginCache(pluginContext.cache, useCustomTransformCache), - emitAsset(name: string, source?: string | Uint8Array) { - emittedFiles.push({ name, source, type: 'asset' as const }); - return pluginContext.emitAsset(name, source); - }, - emitChunk(id, options) { - emittedFiles.push({ id, name: options && options.name, type: 'chunk' as const }); - return pluginContext.emitChunk(id, options); - }, emitFile(emittedFile: EmittedFile) { emittedFiles.push(emittedFile); return pluginDriver.emitFile(emittedFile); diff --git a/test/chunking-form/samples/deprecated/avoid-imports-preserve-modules/_config.js b/test/chunking-form/samples/deprecated/avoid-imports-preserve-modules/_config.js index f1ceddc826f..4f170640cfb 100644 --- a/test/chunking-form/samples/deprecated/avoid-imports-preserve-modules/_config.js +++ b/test/chunking-form/samples/deprecated/avoid-imports-preserve-modules/_config.js @@ -4,5 +4,6 @@ module.exports = { options: { strictDeprecations: false, preserveModules: true - } + }, + expectedWarnings: ['DEPRECATED_FEATURE'] }; diff --git a/test/chunking-form/samples/deprecated/circular-manual-chunks/_config.js b/test/chunking-form/samples/deprecated/circular-manual-chunks/_config.js index 1a256a1d458..c52339e8003 100644 --- a/test/chunking-form/samples/deprecated/circular-manual-chunks/_config.js +++ b/test/chunking-form/samples/deprecated/circular-manual-chunks/_config.js @@ -1,6 +1,6 @@ module.exports = { description: 'handles manual chunks with circular dependencies', - expectedWarnings: ['CIRCULAR_DEPENDENCY'], + expectedWarnings: ['CIRCULAR_DEPENDENCY', 'DEPRECATED_FEATURE'], options: { strictDeprecations: false, input: 'main', diff --git a/test/chunking-form/samples/deprecated/configure-asset-url/_config.js b/test/chunking-form/samples/deprecated/configure-asset-url/_config.js deleted file mode 100644 index c867fee7ed1..00000000000 --- a/test/chunking-form/samples/deprecated/configure-asset-url/_config.js +++ /dev/null @@ -1,43 +0,0 @@ -module.exports = { - description: 'allows to configure asset urls', - expectedWarnings: ['DEPRECATED_FEATURE'], - options: { - strictDeprecations: false, - output: { - chunkFileNames: 'nested/chunk.js' - }, - plugins: [ - { - resolveId(id) { - if (id.endsWith('solved')) { - return id; - } - }, - load(id) { - if (id.endsWith('solved')) { - const assetId = this.emitAsset(`asset-${id}.txt`, `Asset for: ${id}`); - return `export default import.meta.ROLLUP_ASSET_URL_${assetId};`; - } - }, - resolveAssetUrl({ chunkId, moduleId, assetFileName, relativeAssetPath }) { - if (!moduleId.endsWith('resolved')) { - return `'${chunkId}:${moduleId - .replace(/\\/g, '/') - .split('/') - .slice(-2) - .join('/')}:${assetFileName}:${relativeAssetPath}'`; - } - return null; - } - }, - { - resolveAssetUrl({ moduleId }) { - if (moduleId === 'resolved') { - return `'resolved'`; - } - return null; - } - } - ] - } -}; diff --git a/test/chunking-form/samples/deprecated/configure-asset-url/_expected/amd/assets/asset-resolved-8bd22e6e.txt b/test/chunking-form/samples/deprecated/configure-asset-url/_expected/amd/assets/asset-resolved-8bd22e6e.txt deleted file mode 100644 index 31fb300f988..00000000000 --- a/test/chunking-form/samples/deprecated/configure-asset-url/_expected/amd/assets/asset-resolved-8bd22e6e.txt +++ /dev/null @@ -1 +0,0 @@ -Asset for: resolved \ No newline at end of file diff --git a/test/chunking-form/samples/deprecated/configure-asset-url/_expected/amd/assets/asset-solved-28a7ac89.txt b/test/chunking-form/samples/deprecated/configure-asset-url/_expected/amd/assets/asset-solved-28a7ac89.txt deleted file mode 100644 index 07c7a096c7e..00000000000 --- a/test/chunking-form/samples/deprecated/configure-asset-url/_expected/amd/assets/asset-solved-28a7ac89.txt +++ /dev/null @@ -1 +0,0 @@ -Asset for: solved \ No newline at end of file diff --git a/test/chunking-form/samples/deprecated/configure-asset-url/_expected/amd/assets/asset-unresolved-8dcd7fca.txt b/test/chunking-form/samples/deprecated/configure-asset-url/_expected/amd/assets/asset-unresolved-8dcd7fca.txt deleted file mode 100644 index fd3ad6261cc..00000000000 --- a/test/chunking-form/samples/deprecated/configure-asset-url/_expected/amd/assets/asset-unresolved-8dcd7fca.txt +++ /dev/null @@ -1 +0,0 @@ -Asset for: unresolved \ No newline at end of file diff --git a/test/chunking-form/samples/deprecated/configure-asset-url/_expected/amd/main.js b/test/chunking-form/samples/deprecated/configure-asset-url/_expected/amd/main.js deleted file mode 100644 index f085ba371bd..00000000000 --- a/test/chunking-form/samples/deprecated/configure-asset-url/_expected/amd/main.js +++ /dev/null @@ -1,9 +0,0 @@ -define(['require'], (function (require) { 'use strict'; - - var asset2 = 'resolved'; - - var asset3 = new URL(require.toUrl('./assets/asset-unresolved-8dcd7fca.txt'), document.baseURI).href; - - new Promise(function (resolve, reject) { require(['./nested/chunk'], resolve, reject); }).then(result => console.log(result, asset2, asset3)); - -})); diff --git a/test/chunking-form/samples/deprecated/configure-asset-url/_expected/amd/nested/chunk.js b/test/chunking-form/samples/deprecated/configure-asset-url/_expected/amd/nested/chunk.js deleted file mode 100644 index f0aa76e1c74..00000000000 --- a/test/chunking-form/samples/deprecated/configure-asset-url/_expected/amd/nested/chunk.js +++ /dev/null @@ -1,7 +0,0 @@ -define(['require', 'exports'], (function (require, exports) { 'use strict'; - - var solved = 'nested/chunk.js:solved:assets/asset-solved-28a7ac89.txt:../assets/asset-solved-28a7ac89.txt'; - - exports["default"] = solved; - -})); diff --git a/test/chunking-form/samples/deprecated/configure-asset-url/_expected/cjs/assets/asset-resolved-8bd22e6e.txt b/test/chunking-form/samples/deprecated/configure-asset-url/_expected/cjs/assets/asset-resolved-8bd22e6e.txt deleted file mode 100644 index 31fb300f988..00000000000 --- a/test/chunking-form/samples/deprecated/configure-asset-url/_expected/cjs/assets/asset-resolved-8bd22e6e.txt +++ /dev/null @@ -1 +0,0 @@ -Asset for: resolved \ No newline at end of file diff --git a/test/chunking-form/samples/deprecated/configure-asset-url/_expected/cjs/assets/asset-solved-28a7ac89.txt b/test/chunking-form/samples/deprecated/configure-asset-url/_expected/cjs/assets/asset-solved-28a7ac89.txt deleted file mode 100644 index 07c7a096c7e..00000000000 --- a/test/chunking-form/samples/deprecated/configure-asset-url/_expected/cjs/assets/asset-solved-28a7ac89.txt +++ /dev/null @@ -1 +0,0 @@ -Asset for: solved \ No newline at end of file diff --git a/test/chunking-form/samples/deprecated/configure-asset-url/_expected/cjs/assets/asset-unresolved-8dcd7fca.txt b/test/chunking-form/samples/deprecated/configure-asset-url/_expected/cjs/assets/asset-unresolved-8dcd7fca.txt deleted file mode 100644 index fd3ad6261cc..00000000000 --- a/test/chunking-form/samples/deprecated/configure-asset-url/_expected/cjs/assets/asset-unresolved-8dcd7fca.txt +++ /dev/null @@ -1 +0,0 @@ -Asset for: unresolved \ No newline at end of file diff --git a/test/chunking-form/samples/deprecated/configure-asset-url/_expected/cjs/main.js b/test/chunking-form/samples/deprecated/configure-asset-url/_expected/cjs/main.js deleted file mode 100644 index ca36e16ba1d..00000000000 --- a/test/chunking-form/samples/deprecated/configure-asset-url/_expected/cjs/main.js +++ /dev/null @@ -1,7 +0,0 @@ -'use strict'; - -var asset2 = 'resolved'; - -var asset3 = (typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __dirname + '/assets/asset-unresolved-8dcd7fca.txt').href : new URL('assets/asset-unresolved-8dcd7fca.txt', document.currentScript && document.currentScript.src || document.baseURI).href); - -Promise.resolve().then(function () { return require('./nested/chunk.js'); }).then(result => console.log(result, asset2, asset3)); diff --git a/test/chunking-form/samples/deprecated/configure-asset-url/_expected/cjs/nested/chunk.js b/test/chunking-form/samples/deprecated/configure-asset-url/_expected/cjs/nested/chunk.js deleted file mode 100644 index c5ee0aff40e..00000000000 --- a/test/chunking-form/samples/deprecated/configure-asset-url/_expected/cjs/nested/chunk.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -var solved = 'nested/chunk.js:solved:assets/asset-solved-28a7ac89.txt:../assets/asset-solved-28a7ac89.txt'; - -exports["default"] = solved; diff --git a/test/chunking-form/samples/deprecated/configure-asset-url/_expected/es/assets/asset-resolved-8bd22e6e.txt b/test/chunking-form/samples/deprecated/configure-asset-url/_expected/es/assets/asset-resolved-8bd22e6e.txt deleted file mode 100644 index 31fb300f988..00000000000 --- a/test/chunking-form/samples/deprecated/configure-asset-url/_expected/es/assets/asset-resolved-8bd22e6e.txt +++ /dev/null @@ -1 +0,0 @@ -Asset for: resolved \ No newline at end of file diff --git a/test/chunking-form/samples/deprecated/configure-asset-url/_expected/es/assets/asset-solved-28a7ac89.txt b/test/chunking-form/samples/deprecated/configure-asset-url/_expected/es/assets/asset-solved-28a7ac89.txt deleted file mode 100644 index 07c7a096c7e..00000000000 --- a/test/chunking-form/samples/deprecated/configure-asset-url/_expected/es/assets/asset-solved-28a7ac89.txt +++ /dev/null @@ -1 +0,0 @@ -Asset for: solved \ No newline at end of file diff --git a/test/chunking-form/samples/deprecated/configure-asset-url/_expected/es/assets/asset-unresolved-8dcd7fca.txt b/test/chunking-form/samples/deprecated/configure-asset-url/_expected/es/assets/asset-unresolved-8dcd7fca.txt deleted file mode 100644 index fd3ad6261cc..00000000000 --- a/test/chunking-form/samples/deprecated/configure-asset-url/_expected/es/assets/asset-unresolved-8dcd7fca.txt +++ /dev/null @@ -1 +0,0 @@ -Asset for: unresolved \ No newline at end of file diff --git a/test/chunking-form/samples/deprecated/configure-asset-url/_expected/es/main.js b/test/chunking-form/samples/deprecated/configure-asset-url/_expected/es/main.js deleted file mode 100644 index c78af2b3768..00000000000 --- a/test/chunking-form/samples/deprecated/configure-asset-url/_expected/es/main.js +++ /dev/null @@ -1,5 +0,0 @@ -var asset2 = 'resolved'; - -var asset3 = new URL('assets/asset-unresolved-8dcd7fca.txt', import.meta.url).href; - -import('./nested/chunk.js').then(result => console.log(result, asset2, asset3)); diff --git a/test/chunking-form/samples/deprecated/configure-asset-url/_expected/es/nested/chunk.js b/test/chunking-form/samples/deprecated/configure-asset-url/_expected/es/nested/chunk.js deleted file mode 100644 index 407e86ebd52..00000000000 --- a/test/chunking-form/samples/deprecated/configure-asset-url/_expected/es/nested/chunk.js +++ /dev/null @@ -1,3 +0,0 @@ -var solved = 'nested/chunk.js:solved:assets/asset-solved-28a7ac89.txt:../assets/asset-solved-28a7ac89.txt'; - -export { solved as default }; diff --git a/test/chunking-form/samples/deprecated/configure-asset-url/_expected/system/assets/asset-resolved-8bd22e6e.txt b/test/chunking-form/samples/deprecated/configure-asset-url/_expected/system/assets/asset-resolved-8bd22e6e.txt deleted file mode 100644 index 31fb300f988..00000000000 --- a/test/chunking-form/samples/deprecated/configure-asset-url/_expected/system/assets/asset-resolved-8bd22e6e.txt +++ /dev/null @@ -1 +0,0 @@ -Asset for: resolved \ No newline at end of file diff --git a/test/chunking-form/samples/deprecated/configure-asset-url/_expected/system/assets/asset-solved-28a7ac89.txt b/test/chunking-form/samples/deprecated/configure-asset-url/_expected/system/assets/asset-solved-28a7ac89.txt deleted file mode 100644 index 07c7a096c7e..00000000000 --- a/test/chunking-form/samples/deprecated/configure-asset-url/_expected/system/assets/asset-solved-28a7ac89.txt +++ /dev/null @@ -1 +0,0 @@ -Asset for: solved \ No newline at end of file diff --git a/test/chunking-form/samples/deprecated/configure-asset-url/_expected/system/assets/asset-unresolved-8dcd7fca.txt b/test/chunking-form/samples/deprecated/configure-asset-url/_expected/system/assets/asset-unresolved-8dcd7fca.txt deleted file mode 100644 index fd3ad6261cc..00000000000 --- a/test/chunking-form/samples/deprecated/configure-asset-url/_expected/system/assets/asset-unresolved-8dcd7fca.txt +++ /dev/null @@ -1 +0,0 @@ -Asset for: unresolved \ No newline at end of file diff --git a/test/chunking-form/samples/deprecated/configure-asset-url/_expected/system/main.js b/test/chunking-form/samples/deprecated/configure-asset-url/_expected/system/main.js deleted file mode 100644 index b9d944501dd..00000000000 --- a/test/chunking-form/samples/deprecated/configure-asset-url/_expected/system/main.js +++ /dev/null @@ -1,14 +0,0 @@ -System.register([], (function (exports, module) { - 'use strict'; - return { - execute: (function () { - - var asset2 = 'resolved'; - - var asset3 = new URL('assets/asset-unresolved-8dcd7fca.txt', module.meta.url).href; - - module.import('./nested/chunk.js').then(result => console.log(result, asset2, asset3)); - - }) - }; -})); diff --git a/test/chunking-form/samples/deprecated/configure-asset-url/_expected/system/nested/chunk.js b/test/chunking-form/samples/deprecated/configure-asset-url/_expected/system/nested/chunk.js deleted file mode 100644 index c1b5bddba2d..00000000000 --- a/test/chunking-form/samples/deprecated/configure-asset-url/_expected/system/nested/chunk.js +++ /dev/null @@ -1,10 +0,0 @@ -System.register([], (function (exports, module) { - 'use strict'; - return { - execute: (function () { - - var solved = exports('default', 'nested/chunk.js:solved:assets/asset-solved-28a7ac89.txt:../assets/asset-solved-28a7ac89.txt'); - - }) - }; -})); diff --git a/test/chunking-form/samples/deprecated/configure-asset-url/main.js b/test/chunking-form/samples/deprecated/configure-asset-url/main.js deleted file mode 100644 index b3f01707026..00000000000 --- a/test/chunking-form/samples/deprecated/configure-asset-url/main.js +++ /dev/null @@ -1,4 +0,0 @@ -import asset2 from 'resolved'; -import asset3 from 'unresolved'; - -import('solved').then(result => console.log(result, asset2, asset3)); diff --git a/test/chunking-form/samples/deprecated/configure-file-url-for-assets-and-chunks/_config.js b/test/chunking-form/samples/deprecated/configure-file-url-for-assets-and-chunks/_config.js deleted file mode 100644 index 187178aed06..00000000000 --- a/test/chunking-form/samples/deprecated/configure-file-url-for-assets-and-chunks/_config.js +++ /dev/null @@ -1,57 +0,0 @@ -module.exports = { - description: 'allows to configure file urls', - expectedWarnings: ['DEPRECATED_FEATURE'], - options: { - strictDeprecations: false, - output: { - chunkFileNames: 'nested/chunk.js' - }, - plugins: [ - { - resolveId(id) { - if (id.endsWith('solved')) { - return id; - } - }, - load(id) { - if (id.endsWith('solved')) { - const assetId = this.emitAsset(`asset-${id}.txt`, `Asset for: ${id}`); - const chunkId = this.emitChunk('chunk.js'); - return ( - `export const asset = import.meta.ROLLUP_ASSET_URL_${assetId};\n` + - `export const chunk = import.meta.ROLLUP_CHUNK_URL_${chunkId};` - ); - } - }, - resolveFileUrl({ - assetReferenceId, - chunkId, - chunkReferenceId, - fileName, - format, - moduleId, - relativePath - }) { - if (!moduleId.endsWith('resolved')) { - return `'chunkId=${chunkId}:moduleId=${moduleId - .replace(/\\/g, '/') - .split('/') - .slice(-2) - .join( - '/' - )}:fileName=${fileName}:format=${format}:relativePath=${relativePath}:assetReferenceId=${assetReferenceId}:chunkReferenceId=${chunkReferenceId}'`; - } - return null; - } - }, - { - resolveFileUrl({ moduleId }) { - if (moduleId === 'resolved') { - return `'resolved'`; - } - return null; - } - } - ] - } -}; diff --git a/test/chunking-form/samples/deprecated/configure-file-url-for-assets-and-chunks/_expected/amd/assets/asset-resolved-8bd22e6e.txt b/test/chunking-form/samples/deprecated/configure-file-url-for-assets-and-chunks/_expected/amd/assets/asset-resolved-8bd22e6e.txt deleted file mode 100644 index 31fb300f988..00000000000 --- a/test/chunking-form/samples/deprecated/configure-file-url-for-assets-and-chunks/_expected/amd/assets/asset-resolved-8bd22e6e.txt +++ /dev/null @@ -1 +0,0 @@ -Asset for: resolved \ No newline at end of file diff --git a/test/chunking-form/samples/deprecated/configure-file-url-for-assets-and-chunks/_expected/amd/assets/asset-solved-28a7ac89.txt b/test/chunking-form/samples/deprecated/configure-file-url-for-assets-and-chunks/_expected/amd/assets/asset-solved-28a7ac89.txt deleted file mode 100644 index 07c7a096c7e..00000000000 --- a/test/chunking-form/samples/deprecated/configure-file-url-for-assets-and-chunks/_expected/amd/assets/asset-solved-28a7ac89.txt +++ /dev/null @@ -1 +0,0 @@ -Asset for: solved \ No newline at end of file diff --git a/test/chunking-form/samples/deprecated/configure-file-url-for-assets-and-chunks/_expected/amd/assets/asset-unresolved-8dcd7fca.txt b/test/chunking-form/samples/deprecated/configure-file-url-for-assets-and-chunks/_expected/amd/assets/asset-unresolved-8dcd7fca.txt deleted file mode 100644 index fd3ad6261cc..00000000000 --- a/test/chunking-form/samples/deprecated/configure-file-url-for-assets-and-chunks/_expected/amd/assets/asset-unresolved-8dcd7fca.txt +++ /dev/null @@ -1 +0,0 @@ -Asset for: unresolved \ No newline at end of file diff --git a/test/chunking-form/samples/deprecated/configure-file-url-for-assets-and-chunks/_expected/amd/main.js b/test/chunking-form/samples/deprecated/configure-file-url-for-assets-and-chunks/_expected/amd/main.js deleted file mode 100644 index cf5bdfec043..00000000000 --- a/test/chunking-form/samples/deprecated/configure-file-url-for-assets-and-chunks/_expected/amd/main.js +++ /dev/null @@ -1,11 +0,0 @@ -define(['require'], (function (require) { 'use strict'; - - const asset$1 = 'resolved'; - const chunk$1 = 'resolved'; - - const asset = new URL(require.toUrl('./assets/asset-unresolved-8dcd7fca.txt'), document.baseURI).href; - const chunk = new URL(require.toUrl('./nested/chunk.js'), document.baseURI).href; - - new Promise(function (resolve, reject) { require(['./nested/chunk2'], resolve, reject); }).then(result => console.log(result, chunk$1, chunk, asset$1, asset)); - -})); diff --git a/test/chunking-form/samples/deprecated/configure-file-url-for-assets-and-chunks/_expected/amd/nested/chunk.js b/test/chunking-form/samples/deprecated/configure-file-url-for-assets-and-chunks/_expected/amd/nested/chunk.js deleted file mode 100644 index f29221faf6c..00000000000 --- a/test/chunking-form/samples/deprecated/configure-file-url-for-assets-and-chunks/_expected/amd/nested/chunk.js +++ /dev/null @@ -1,5 +0,0 @@ -define((function () { 'use strict'; - - console.log('chunk'); - -})); diff --git a/test/chunking-form/samples/deprecated/configure-file-url-for-assets-and-chunks/_expected/amd/nested/chunk2.js b/test/chunking-form/samples/deprecated/configure-file-url-for-assets-and-chunks/_expected/amd/nested/chunk2.js deleted file mode 100644 index f6ce7c068d4..00000000000 --- a/test/chunking-form/samples/deprecated/configure-file-url-for-assets-and-chunks/_expected/amd/nested/chunk2.js +++ /dev/null @@ -1,9 +0,0 @@ -define(['require', 'exports'], (function (require, exports) { 'use strict'; - - const asset = 'chunkId=nested/chunk2.js:moduleId=solved:fileName=assets/asset-solved-28a7ac89.txt:format=amd:relativePath=../assets/asset-solved-28a7ac89.txt:assetReferenceId=6296c678:chunkReferenceId=null'; - const chunk = 'chunkId=nested/chunk2.js:moduleId=solved:fileName=nested/chunk.js:format=amd:relativePath=chunk.js:assetReferenceId=null:chunkReferenceId=f6c25ae7'; - - exports.asset = asset; - exports.chunk = chunk; - -})); diff --git a/test/chunking-form/samples/deprecated/configure-file-url-for-assets-and-chunks/_expected/cjs/assets/asset-resolved-8bd22e6e.txt b/test/chunking-form/samples/deprecated/configure-file-url-for-assets-and-chunks/_expected/cjs/assets/asset-resolved-8bd22e6e.txt deleted file mode 100644 index 31fb300f988..00000000000 --- a/test/chunking-form/samples/deprecated/configure-file-url-for-assets-and-chunks/_expected/cjs/assets/asset-resolved-8bd22e6e.txt +++ /dev/null @@ -1 +0,0 @@ -Asset for: resolved \ No newline at end of file diff --git a/test/chunking-form/samples/deprecated/configure-file-url-for-assets-and-chunks/_expected/cjs/assets/asset-solved-28a7ac89.txt b/test/chunking-form/samples/deprecated/configure-file-url-for-assets-and-chunks/_expected/cjs/assets/asset-solved-28a7ac89.txt deleted file mode 100644 index 07c7a096c7e..00000000000 --- a/test/chunking-form/samples/deprecated/configure-file-url-for-assets-and-chunks/_expected/cjs/assets/asset-solved-28a7ac89.txt +++ /dev/null @@ -1 +0,0 @@ -Asset for: solved \ No newline at end of file diff --git a/test/chunking-form/samples/deprecated/configure-file-url-for-assets-and-chunks/_expected/cjs/assets/asset-unresolved-8dcd7fca.txt b/test/chunking-form/samples/deprecated/configure-file-url-for-assets-and-chunks/_expected/cjs/assets/asset-unresolved-8dcd7fca.txt deleted file mode 100644 index fd3ad6261cc..00000000000 --- a/test/chunking-form/samples/deprecated/configure-file-url-for-assets-and-chunks/_expected/cjs/assets/asset-unresolved-8dcd7fca.txt +++ /dev/null @@ -1 +0,0 @@ -Asset for: unresolved \ No newline at end of file diff --git a/test/chunking-form/samples/deprecated/configure-file-url-for-assets-and-chunks/_expected/cjs/main.js b/test/chunking-form/samples/deprecated/configure-file-url-for-assets-and-chunks/_expected/cjs/main.js deleted file mode 100644 index feea03def6e..00000000000 --- a/test/chunking-form/samples/deprecated/configure-file-url-for-assets-and-chunks/_expected/cjs/main.js +++ /dev/null @@ -1,9 +0,0 @@ -'use strict'; - -const asset$1 = 'resolved'; -const chunk$1 = 'resolved'; - -const asset = (typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __dirname + '/assets/asset-unresolved-8dcd7fca.txt').href : new URL('assets/asset-unresolved-8dcd7fca.txt', document.currentScript && document.currentScript.src || document.baseURI).href); -const chunk = (typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __dirname + '/nested/chunk.js').href : new URL('nested/chunk.js', document.currentScript && document.currentScript.src || document.baseURI).href); - -Promise.resolve().then(function () { return require('./nested/chunk2.js'); }).then(result => console.log(result, chunk$1, chunk, asset$1, asset)); diff --git a/test/chunking-form/samples/deprecated/configure-file-url-for-assets-and-chunks/_expected/cjs/nested/chunk.js b/test/chunking-form/samples/deprecated/configure-file-url-for-assets-and-chunks/_expected/cjs/nested/chunk.js deleted file mode 100644 index 9bd6f06e964..00000000000 --- a/test/chunking-form/samples/deprecated/configure-file-url-for-assets-and-chunks/_expected/cjs/nested/chunk.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -console.log('chunk'); diff --git a/test/chunking-form/samples/deprecated/configure-file-url-for-assets-and-chunks/_expected/cjs/nested/chunk2.js b/test/chunking-form/samples/deprecated/configure-file-url-for-assets-and-chunks/_expected/cjs/nested/chunk2.js deleted file mode 100644 index 2ea0d2caf6f..00000000000 --- a/test/chunking-form/samples/deprecated/configure-file-url-for-assets-and-chunks/_expected/cjs/nested/chunk2.js +++ /dev/null @@ -1,7 +0,0 @@ -'use strict'; - -const asset = 'chunkId=nested/chunk2.js:moduleId=solved:fileName=assets/asset-solved-28a7ac89.txt:format=cjs:relativePath=../assets/asset-solved-28a7ac89.txt:assetReferenceId=6296c678:chunkReferenceId=null'; -const chunk = 'chunkId=nested/chunk2.js:moduleId=solved:fileName=nested/chunk.js:format=cjs:relativePath=chunk.js:assetReferenceId=null:chunkReferenceId=f6c25ae7'; - -exports.asset = asset; -exports.chunk = chunk; diff --git a/test/chunking-form/samples/deprecated/configure-file-url-for-assets-and-chunks/_expected/es/assets/asset-resolved-8bd22e6e.txt b/test/chunking-form/samples/deprecated/configure-file-url-for-assets-and-chunks/_expected/es/assets/asset-resolved-8bd22e6e.txt deleted file mode 100644 index 31fb300f988..00000000000 --- a/test/chunking-form/samples/deprecated/configure-file-url-for-assets-and-chunks/_expected/es/assets/asset-resolved-8bd22e6e.txt +++ /dev/null @@ -1 +0,0 @@ -Asset for: resolved \ No newline at end of file diff --git a/test/chunking-form/samples/deprecated/configure-file-url-for-assets-and-chunks/_expected/es/assets/asset-solved-28a7ac89.txt b/test/chunking-form/samples/deprecated/configure-file-url-for-assets-and-chunks/_expected/es/assets/asset-solved-28a7ac89.txt deleted file mode 100644 index 07c7a096c7e..00000000000 --- a/test/chunking-form/samples/deprecated/configure-file-url-for-assets-and-chunks/_expected/es/assets/asset-solved-28a7ac89.txt +++ /dev/null @@ -1 +0,0 @@ -Asset for: solved \ No newline at end of file diff --git a/test/chunking-form/samples/deprecated/configure-file-url-for-assets-and-chunks/_expected/es/assets/asset-unresolved-8dcd7fca.txt b/test/chunking-form/samples/deprecated/configure-file-url-for-assets-and-chunks/_expected/es/assets/asset-unresolved-8dcd7fca.txt deleted file mode 100644 index fd3ad6261cc..00000000000 --- a/test/chunking-form/samples/deprecated/configure-file-url-for-assets-and-chunks/_expected/es/assets/asset-unresolved-8dcd7fca.txt +++ /dev/null @@ -1 +0,0 @@ -Asset for: unresolved \ No newline at end of file diff --git a/test/chunking-form/samples/deprecated/configure-file-url-for-assets-and-chunks/_expected/es/main.js b/test/chunking-form/samples/deprecated/configure-file-url-for-assets-and-chunks/_expected/es/main.js deleted file mode 100644 index 1f84c485bd4..00000000000 --- a/test/chunking-form/samples/deprecated/configure-file-url-for-assets-and-chunks/_expected/es/main.js +++ /dev/null @@ -1,7 +0,0 @@ -const asset$1 = 'resolved'; -const chunk$1 = 'resolved'; - -const asset = new URL('assets/asset-unresolved-8dcd7fca.txt', import.meta.url).href; -const chunk = new URL('nested/chunk.js', import.meta.url).href; - -import('./nested/chunk2.js').then(result => console.log(result, chunk$1, chunk, asset$1, asset)); diff --git a/test/chunking-form/samples/deprecated/configure-file-url-for-assets-and-chunks/_expected/es/nested/chunk.js b/test/chunking-form/samples/deprecated/configure-file-url-for-assets-and-chunks/_expected/es/nested/chunk.js deleted file mode 100644 index 36b1d61dd25..00000000000 --- a/test/chunking-form/samples/deprecated/configure-file-url-for-assets-and-chunks/_expected/es/nested/chunk.js +++ /dev/null @@ -1 +0,0 @@ -console.log('chunk'); diff --git a/test/chunking-form/samples/deprecated/configure-file-url-for-assets-and-chunks/_expected/es/nested/chunk2.js b/test/chunking-form/samples/deprecated/configure-file-url-for-assets-and-chunks/_expected/es/nested/chunk2.js deleted file mode 100644 index 736b09b62c1..00000000000 --- a/test/chunking-form/samples/deprecated/configure-file-url-for-assets-and-chunks/_expected/es/nested/chunk2.js +++ /dev/null @@ -1,4 +0,0 @@ -const asset = 'chunkId=nested/chunk2.js:moduleId=solved:fileName=assets/asset-solved-28a7ac89.txt:format=es:relativePath=../assets/asset-solved-28a7ac89.txt:assetReferenceId=6296c678:chunkReferenceId=null'; -const chunk = 'chunkId=nested/chunk2.js:moduleId=solved:fileName=nested/chunk.js:format=es:relativePath=chunk.js:assetReferenceId=null:chunkReferenceId=f6c25ae7'; - -export { asset, chunk }; diff --git a/test/chunking-form/samples/deprecated/configure-file-url-for-assets-and-chunks/_expected/system/assets/asset-resolved-8bd22e6e.txt b/test/chunking-form/samples/deprecated/configure-file-url-for-assets-and-chunks/_expected/system/assets/asset-resolved-8bd22e6e.txt deleted file mode 100644 index 31fb300f988..00000000000 --- a/test/chunking-form/samples/deprecated/configure-file-url-for-assets-and-chunks/_expected/system/assets/asset-resolved-8bd22e6e.txt +++ /dev/null @@ -1 +0,0 @@ -Asset for: resolved \ No newline at end of file diff --git a/test/chunking-form/samples/deprecated/configure-file-url-for-assets-and-chunks/_expected/system/assets/asset-solved-28a7ac89.txt b/test/chunking-form/samples/deprecated/configure-file-url-for-assets-and-chunks/_expected/system/assets/asset-solved-28a7ac89.txt deleted file mode 100644 index 07c7a096c7e..00000000000 --- a/test/chunking-form/samples/deprecated/configure-file-url-for-assets-and-chunks/_expected/system/assets/asset-solved-28a7ac89.txt +++ /dev/null @@ -1 +0,0 @@ -Asset for: solved \ No newline at end of file diff --git a/test/chunking-form/samples/deprecated/configure-file-url-for-assets-and-chunks/_expected/system/assets/asset-unresolved-8dcd7fca.txt b/test/chunking-form/samples/deprecated/configure-file-url-for-assets-and-chunks/_expected/system/assets/asset-unresolved-8dcd7fca.txt deleted file mode 100644 index fd3ad6261cc..00000000000 --- a/test/chunking-form/samples/deprecated/configure-file-url-for-assets-and-chunks/_expected/system/assets/asset-unresolved-8dcd7fca.txt +++ /dev/null @@ -1 +0,0 @@ -Asset for: unresolved \ No newline at end of file diff --git a/test/chunking-form/samples/deprecated/configure-file-url-for-assets-and-chunks/_expected/system/main.js b/test/chunking-form/samples/deprecated/configure-file-url-for-assets-and-chunks/_expected/system/main.js deleted file mode 100644 index f837123459d..00000000000 --- a/test/chunking-form/samples/deprecated/configure-file-url-for-assets-and-chunks/_expected/system/main.js +++ /dev/null @@ -1,16 +0,0 @@ -System.register([], (function (exports, module) { - 'use strict'; - return { - execute: (function () { - - const asset$1 = 'resolved'; - const chunk$1 = 'resolved'; - - const asset = new URL('assets/asset-unresolved-8dcd7fca.txt', module.meta.url).href; - const chunk = new URL('nested/chunk.js', module.meta.url).href; - - module.import('./nested/chunk2.js').then(result => console.log(result, chunk$1, chunk, asset$1, asset)); - - }) - }; -})); diff --git a/test/chunking-form/samples/deprecated/configure-file-url-for-assets-and-chunks/_expected/system/nested/chunk.js b/test/chunking-form/samples/deprecated/configure-file-url-for-assets-and-chunks/_expected/system/nested/chunk.js deleted file mode 100644 index 1443cae1e05..00000000000 --- a/test/chunking-form/samples/deprecated/configure-file-url-for-assets-and-chunks/_expected/system/nested/chunk.js +++ /dev/null @@ -1,10 +0,0 @@ -System.register([], (function () { - 'use strict'; - return { - execute: (function () { - - console.log('chunk'); - - }) - }; -})); diff --git a/test/chunking-form/samples/deprecated/configure-file-url-for-assets-and-chunks/_expected/system/nested/chunk2.js b/test/chunking-form/samples/deprecated/configure-file-url-for-assets-and-chunks/_expected/system/nested/chunk2.js deleted file mode 100644 index 46ffd9138a6..00000000000 --- a/test/chunking-form/samples/deprecated/configure-file-url-for-assets-and-chunks/_expected/system/nested/chunk2.js +++ /dev/null @@ -1,11 +0,0 @@ -System.register([], (function (exports, module) { - 'use strict'; - return { - execute: (function () { - - const asset = exports('asset', 'chunkId=nested/chunk2.js:moduleId=solved:fileName=assets/asset-solved-28a7ac89.txt:format=system:relativePath=../assets/asset-solved-28a7ac89.txt:assetReferenceId=6296c678:chunkReferenceId=null'); - const chunk = exports('chunk', 'chunkId=nested/chunk2.js:moduleId=solved:fileName=nested/chunk.js:format=system:relativePath=chunk.js:assetReferenceId=null:chunkReferenceId=f6c25ae7'); - - }) - }; -})); diff --git a/test/chunking-form/samples/deprecated/configure-file-url-for-assets-and-chunks/chunk.js b/test/chunking-form/samples/deprecated/configure-file-url-for-assets-and-chunks/chunk.js deleted file mode 100644 index 36b1d61dd25..00000000000 --- a/test/chunking-form/samples/deprecated/configure-file-url-for-assets-and-chunks/chunk.js +++ /dev/null @@ -1 +0,0 @@ -console.log('chunk'); diff --git a/test/chunking-form/samples/deprecated/configure-file-url-for-assets-and-chunks/main.js b/test/chunking-form/samples/deprecated/configure-file-url-for-assets-and-chunks/main.js deleted file mode 100644 index c7b101dfc5b..00000000000 --- a/test/chunking-form/samples/deprecated/configure-file-url-for-assets-and-chunks/main.js +++ /dev/null @@ -1,5 +0,0 @@ -import { asset as asset1, chunk as chunk1 } from 'resolved'; -import { asset as asset2, chunk as chunk2 } from 'unresolved'; - -import('solved').then(result => console.log(result, chunk1, chunk2, asset1, asset2)); - diff --git a/test/chunking-form/samples/deprecated/dynamic-import-comments/_config.js b/test/chunking-form/samples/deprecated/dynamic-import-comments/_config.js index 2bc7c8df417..29065eec4a7 100644 --- a/test/chunking-form/samples/deprecated/dynamic-import-comments/_config.js +++ b/test/chunking-form/samples/deprecated/dynamic-import-comments/_config.js @@ -12,5 +12,6 @@ module.exports = { output: { dynamicImportFunction: 'foobar' } - } + }, + expectedWarnings: ['DEPRECATED_FEATURE'] }; diff --git a/test/chunking-form/samples/deprecated/dynamic-import-inlining-object/_config.js b/test/chunking-form/samples/deprecated/dynamic-import-inlining-object/_config.js index 4ffc9d0f905..a40ae4c75ed 100644 --- a/test/chunking-form/samples/deprecated/dynamic-import-inlining-object/_config.js +++ b/test/chunking-form/samples/deprecated/dynamic-import-inlining-object/_config.js @@ -4,5 +4,6 @@ module.exports = { strictDeprecations: false, inlineDynamicImports: true, input: { entry: 'main' } - } + }, + expectedWarnings: ['DEPRECATED_FEATURE'] }; diff --git a/test/chunking-form/samples/deprecated/dynamic-import-name/_config.js b/test/chunking-form/samples/deprecated/dynamic-import-name/_config.js index 601e3b9d0d7..cd7d733c719 100644 --- a/test/chunking-form/samples/deprecated/dynamic-import-name/_config.js +++ b/test/chunking-form/samples/deprecated/dynamic-import-name/_config.js @@ -12,5 +12,6 @@ module.exports = { output: { dynamicImportFunction: 'foobar' } - } + }, + expectedWarnings: ['DEPRECATED_FEATURE'] }; diff --git a/test/chunking-form/samples/deprecated/emit-asset/_config.js b/test/chunking-form/samples/deprecated/emit-asset/_config.js deleted file mode 100644 index f9625ac7974..00000000000 --- a/test/chunking-form/samples/deprecated/emit-asset/_config.js +++ /dev/null @@ -1,30 +0,0 @@ -const { readFileSync } = require('fs'); -const path = require('path'); - -module.exports = { - description: 'supports emitting assets from plugin hooks', - expectedWarnings: ['DEPRECATED_FEATURE'], - options: { - strictDeprecations: false, - input: ['main.js'], - preserveEntrySignatures: false, - output: { - chunkFileNames: 'nested/chunk.js' - }, - plugins: { - resolveId(id, importee) { - if (id.endsWith('.svg')) { - return path.resolve(path.dirname(importee), id); - } - }, - load(id) { - if (id.endsWith('.svg')) { - return `export default import.meta.ROLLUP_ASSET_URL_${this.emitAsset( - path.basename(id), - readFileSync(id) - )};`; - } - } - } - } -}; diff --git a/test/chunking-form/samples/deprecated/emit-asset/_expected/amd/assets/logo1-a5ec488b.svg b/test/chunking-form/samples/deprecated/emit-asset/_expected/amd/assets/logo1-a5ec488b.svg deleted file mode 100644 index cb7e52c5130..00000000000 --- a/test/chunking-form/samples/deprecated/emit-asset/_expected/amd/assets/logo1-a5ec488b.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/test/chunking-form/samples/deprecated/emit-asset/_expected/amd/assets/logo2-6d5979e4.svg b/test/chunking-form/samples/deprecated/emit-asset/_expected/amd/assets/logo2-6d5979e4.svg deleted file mode 100644 index b446284a4cd..00000000000 --- a/test/chunking-form/samples/deprecated/emit-asset/_expected/amd/assets/logo2-6d5979e4.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/test/chunking-form/samples/deprecated/emit-asset/_expected/amd/main.js b/test/chunking-form/samples/deprecated/emit-asset/_expected/amd/main.js deleted file mode 100644 index 1dd5b4aaaa7..00000000000 --- a/test/chunking-form/samples/deprecated/emit-asset/_expected/amd/main.js +++ /dev/null @@ -1,21 +0,0 @@ -define(['require', 'exports'], (function (require, exports) { 'use strict'; - - var logo = new URL(require.toUrl('./assets/logo1-a5ec488b.svg'), document.baseURI).href; - - function showImage(url) { - console.log(url); - if (typeof document !== 'undefined') { - const image = document.createElement('img'); - image.src = url; - document.body.appendChild(image); - } - } - - showImage(logo); - new Promise(function (resolve, reject) { require(['./nested/chunk'], resolve, reject); }); - - exports.showImage = showImage; - - Object.defineProperty(exports, '__esModule', { value: true }); - -})); diff --git a/test/chunking-form/samples/deprecated/emit-asset/_expected/amd/nested/chunk.js b/test/chunking-form/samples/deprecated/emit-asset/_expected/amd/nested/chunk.js deleted file mode 100644 index 6a888ad7ed2..00000000000 --- a/test/chunking-form/samples/deprecated/emit-asset/_expected/amd/nested/chunk.js +++ /dev/null @@ -1,7 +0,0 @@ -define(['require', '../main'], (function (require, main) { 'use strict'; - - var logo = new URL(require.toUrl('../assets/logo2-6d5979e4.svg'), document.baseURI).href; - - main.showImage(logo); - -})); diff --git a/test/chunking-form/samples/deprecated/emit-asset/_expected/cjs/assets/logo1-a5ec488b.svg b/test/chunking-form/samples/deprecated/emit-asset/_expected/cjs/assets/logo1-a5ec488b.svg deleted file mode 100644 index cb7e52c5130..00000000000 --- a/test/chunking-form/samples/deprecated/emit-asset/_expected/cjs/assets/logo1-a5ec488b.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/test/chunking-form/samples/deprecated/emit-asset/_expected/cjs/assets/logo2-6d5979e4.svg b/test/chunking-form/samples/deprecated/emit-asset/_expected/cjs/assets/logo2-6d5979e4.svg deleted file mode 100644 index b446284a4cd..00000000000 --- a/test/chunking-form/samples/deprecated/emit-asset/_expected/cjs/assets/logo2-6d5979e4.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/test/chunking-form/samples/deprecated/emit-asset/_expected/cjs/main.js b/test/chunking-form/samples/deprecated/emit-asset/_expected/cjs/main.js deleted file mode 100644 index 5c22a31491d..00000000000 --- a/test/chunking-form/samples/deprecated/emit-asset/_expected/cjs/main.js +++ /dev/null @@ -1,19 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, '__esModule', { value: true }); - -var logo = (typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __dirname + '/assets/logo1-a5ec488b.svg').href : new URL('assets/logo1-a5ec488b.svg', document.currentScript && document.currentScript.src || document.baseURI).href); - -function showImage(url) { - console.log(url); - if (typeof document !== 'undefined') { - const image = document.createElement('img'); - image.src = url; - document.body.appendChild(image); - } -} - -showImage(logo); -Promise.resolve().then(function () { return require('./nested/chunk.js'); }); - -exports.showImage = showImage; diff --git a/test/chunking-form/samples/deprecated/emit-asset/_expected/cjs/nested/chunk.js b/test/chunking-form/samples/deprecated/emit-asset/_expected/cjs/nested/chunk.js deleted file mode 100644 index 8d9f9558b6d..00000000000 --- a/test/chunking-form/samples/deprecated/emit-asset/_expected/cjs/nested/chunk.js +++ /dev/null @@ -1,7 +0,0 @@ -'use strict'; - -var main = require('../main.js'); - -var logo = (typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __dirname + '/../assets/logo2-6d5979e4.svg').href : new URL('../assets/logo2-6d5979e4.svg', document.currentScript && document.currentScript.src || document.baseURI).href); - -main.showImage(logo); diff --git a/test/chunking-form/samples/deprecated/emit-asset/_expected/es/assets/logo1-a5ec488b.svg b/test/chunking-form/samples/deprecated/emit-asset/_expected/es/assets/logo1-a5ec488b.svg deleted file mode 100644 index cb7e52c5130..00000000000 --- a/test/chunking-form/samples/deprecated/emit-asset/_expected/es/assets/logo1-a5ec488b.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/test/chunking-form/samples/deprecated/emit-asset/_expected/es/assets/logo2-6d5979e4.svg b/test/chunking-form/samples/deprecated/emit-asset/_expected/es/assets/logo2-6d5979e4.svg deleted file mode 100644 index b446284a4cd..00000000000 --- a/test/chunking-form/samples/deprecated/emit-asset/_expected/es/assets/logo2-6d5979e4.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/test/chunking-form/samples/deprecated/emit-asset/_expected/es/main.js b/test/chunking-form/samples/deprecated/emit-asset/_expected/es/main.js deleted file mode 100644 index 4d8fd5dd758..00000000000 --- a/test/chunking-form/samples/deprecated/emit-asset/_expected/es/main.js +++ /dev/null @@ -1,15 +0,0 @@ -var logo = new URL('assets/logo1-a5ec488b.svg', import.meta.url).href; - -function showImage(url) { - console.log(url); - if (typeof document !== 'undefined') { - const image = document.createElement('img'); - image.src = url; - document.body.appendChild(image); - } -} - -showImage(logo); -import('./nested/chunk.js'); - -export { showImage as s }; diff --git a/test/chunking-form/samples/deprecated/emit-asset/_expected/es/nested/chunk.js b/test/chunking-form/samples/deprecated/emit-asset/_expected/es/nested/chunk.js deleted file mode 100644 index 4491f94fb7e..00000000000 --- a/test/chunking-form/samples/deprecated/emit-asset/_expected/es/nested/chunk.js +++ /dev/null @@ -1,5 +0,0 @@ -import { s as showImage } from '../main.js'; - -var logo = new URL('../assets/logo2-6d5979e4.svg', import.meta.url).href; - -showImage(logo); diff --git a/test/chunking-form/samples/deprecated/emit-asset/_expected/system/assets/logo1-a5ec488b.svg b/test/chunking-form/samples/deprecated/emit-asset/_expected/system/assets/logo1-a5ec488b.svg deleted file mode 100644 index cb7e52c5130..00000000000 --- a/test/chunking-form/samples/deprecated/emit-asset/_expected/system/assets/logo1-a5ec488b.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/test/chunking-form/samples/deprecated/emit-asset/_expected/system/assets/logo2-6d5979e4.svg b/test/chunking-form/samples/deprecated/emit-asset/_expected/system/assets/logo2-6d5979e4.svg deleted file mode 100644 index b446284a4cd..00000000000 --- a/test/chunking-form/samples/deprecated/emit-asset/_expected/system/assets/logo2-6d5979e4.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/test/chunking-form/samples/deprecated/emit-asset/_expected/system/main.js b/test/chunking-form/samples/deprecated/emit-asset/_expected/system/main.js deleted file mode 100644 index 01ef84effb6..00000000000 --- a/test/chunking-form/samples/deprecated/emit-asset/_expected/system/main.js +++ /dev/null @@ -1,24 +0,0 @@ -System.register([], (function (exports, module) { - 'use strict'; - return { - execute: (function () { - - exports('s', showImage); - - var logo = new URL('assets/logo1-a5ec488b.svg', module.meta.url).href; - - function showImage(url) { - console.log(url); - if (typeof document !== 'undefined') { - const image = document.createElement('img'); - image.src = url; - document.body.appendChild(image); - } - } - - showImage(logo); - module.import('./nested/chunk.js'); - - }) - }; -})); diff --git a/test/chunking-form/samples/deprecated/emit-asset/_expected/system/nested/chunk.js b/test/chunking-form/samples/deprecated/emit-asset/_expected/system/nested/chunk.js deleted file mode 100644 index f678780b7ba..00000000000 --- a/test/chunking-form/samples/deprecated/emit-asset/_expected/system/nested/chunk.js +++ /dev/null @@ -1,16 +0,0 @@ -System.register(['../main.js'], (function (exports, module) { - 'use strict'; - var showImage; - return { - setters: [function (module) { - showImage = module.s; - }], - execute: (function () { - - var logo = new URL('../assets/logo2-6d5979e4.svg', module.meta.url).href; - - showImage(logo); - - }) - }; -})); diff --git a/test/chunking-form/samples/deprecated/emit-asset/index-amd.html b/test/chunking-form/samples/deprecated/emit-asset/index-amd.html deleted file mode 100644 index cd17b62967d..00000000000 --- a/test/chunking-form/samples/deprecated/emit-asset/index-amd.html +++ /dev/null @@ -1,10 +0,0 @@ - - - - - AMD - - - - - diff --git a/test/chunking-form/samples/deprecated/emit-asset/index-es.html b/test/chunking-form/samples/deprecated/emit-asset/index-es.html deleted file mode 100644 index 58ae4a61527..00000000000 --- a/test/chunking-form/samples/deprecated/emit-asset/index-es.html +++ /dev/null @@ -1,10 +0,0 @@ - - - - - Title - - - - - diff --git a/test/chunking-form/samples/deprecated/emit-asset/index-system.html b/test/chunking-form/samples/deprecated/emit-asset/index-system.html deleted file mode 100644 index d4b3890b337..00000000000 --- a/test/chunking-form/samples/deprecated/emit-asset/index-system.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - SystemJS - - - - - - diff --git a/test/chunking-form/samples/deprecated/emit-asset/logo1.svg b/test/chunking-form/samples/deprecated/emit-asset/logo1.svg deleted file mode 100644 index cb7e52c5130..00000000000 --- a/test/chunking-form/samples/deprecated/emit-asset/logo1.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/test/chunking-form/samples/deprecated/emit-asset/logo2.svg b/test/chunking-form/samples/deprecated/emit-asset/logo2.svg deleted file mode 100644 index b446284a4cd..00000000000 --- a/test/chunking-form/samples/deprecated/emit-asset/logo2.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/test/chunking-form/samples/deprecated/emit-asset/main.js b/test/chunking-form/samples/deprecated/emit-asset/main.js deleted file mode 100644 index 5c1787b77b4..00000000000 --- a/test/chunking-form/samples/deprecated/emit-asset/main.js +++ /dev/null @@ -1,5 +0,0 @@ -import logo from './logo1.svg'; -import { showImage } from './show-image'; - -showImage(logo); -import('./nested.js'); diff --git a/test/chunking-form/samples/deprecated/emit-asset/nested.js b/test/chunking-form/samples/deprecated/emit-asset/nested.js deleted file mode 100644 index ceb0a68e6e1..00000000000 --- a/test/chunking-form/samples/deprecated/emit-asset/nested.js +++ /dev/null @@ -1,4 +0,0 @@ -import logo from './logo2.svg'; -import { showImage } from './show-image'; - -showImage(logo); diff --git a/test/chunking-form/samples/deprecated/emit-asset/show-image.js b/test/chunking-form/samples/deprecated/emit-asset/show-image.js deleted file mode 100644 index 28c706ab24b..00000000000 --- a/test/chunking-form/samples/deprecated/emit-asset/show-image.js +++ /dev/null @@ -1,8 +0,0 @@ -export function showImage(url) { - console.log(url); - if (typeof document !== 'undefined') { - const image = document.createElement('img'); - image.src = url; - document.body.appendChild(image); - } -} diff --git a/test/chunking-form/samples/deprecated/emit-chunk-existing/_config.js b/test/chunking-form/samples/deprecated/emit-chunk-existing/_config.js deleted file mode 100644 index a472740a55a..00000000000 --- a/test/chunking-form/samples/deprecated/emit-chunk-existing/_config.js +++ /dev/null @@ -1,21 +0,0 @@ -module.exports = { - description: 'allows adding modules already in the graph as entry points', - expectedWarnings: ['DEPRECATED_FEATURE'], - options: { - strictDeprecations: false, - input: { - 'first-main': 'main1', - 'second-main': 'main2' - }, - plugins: { - buildStart() { - // it should be possible to add existing entry points while not overriding their alias - this.emitChunk('main1'); - - // if an existing dependency is added, all references should use the new name - this.emitChunk('dep.js'); - this.emitChunk('dep'); - } - } - } -}; diff --git a/test/chunking-form/samples/deprecated/emit-chunk-existing/_expected/amd/first-main.js b/test/chunking-form/samples/deprecated/emit-chunk-existing/_expected/amd/first-main.js deleted file mode 100644 index 05e4663fb8f..00000000000 --- a/test/chunking-form/samples/deprecated/emit-chunk-existing/_expected/amd/first-main.js +++ /dev/null @@ -1,5 +0,0 @@ -define(['./generated-dep'], (function (dep) { 'use strict'; - - console.log('main1', dep); - -})); diff --git a/test/chunking-form/samples/deprecated/emit-chunk-existing/_expected/amd/generated-dep.js b/test/chunking-form/samples/deprecated/emit-chunk-existing/_expected/amd/generated-dep.js deleted file mode 100644 index 918ffcbca16..00000000000 --- a/test/chunking-form/samples/deprecated/emit-chunk-existing/_expected/amd/generated-dep.js +++ /dev/null @@ -1,7 +0,0 @@ -define((function () { 'use strict'; - - var value = 42; - - return value; - -})); diff --git a/test/chunking-form/samples/deprecated/emit-chunk-existing/_expected/amd/second-main.js b/test/chunking-form/samples/deprecated/emit-chunk-existing/_expected/amd/second-main.js deleted file mode 100644 index 05e4663fb8f..00000000000 --- a/test/chunking-form/samples/deprecated/emit-chunk-existing/_expected/amd/second-main.js +++ /dev/null @@ -1,5 +0,0 @@ -define(['./generated-dep'], (function (dep) { 'use strict'; - - console.log('main1', dep); - -})); diff --git a/test/chunking-form/samples/deprecated/emit-chunk-existing/_expected/cjs/first-main.js b/test/chunking-form/samples/deprecated/emit-chunk-existing/_expected/cjs/first-main.js deleted file mode 100644 index 54bee5af979..00000000000 --- a/test/chunking-form/samples/deprecated/emit-chunk-existing/_expected/cjs/first-main.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -var dep = require('./generated-dep.js'); - -console.log('main1', dep); diff --git a/test/chunking-form/samples/deprecated/emit-chunk-existing/_expected/cjs/generated-dep.js b/test/chunking-form/samples/deprecated/emit-chunk-existing/_expected/cjs/generated-dep.js deleted file mode 100644 index 07d7bfe2962..00000000000 --- a/test/chunking-form/samples/deprecated/emit-chunk-existing/_expected/cjs/generated-dep.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -var value = 42; - -module.exports = value; diff --git a/test/chunking-form/samples/deprecated/emit-chunk-existing/_expected/cjs/second-main.js b/test/chunking-form/samples/deprecated/emit-chunk-existing/_expected/cjs/second-main.js deleted file mode 100644 index 54bee5af979..00000000000 --- a/test/chunking-form/samples/deprecated/emit-chunk-existing/_expected/cjs/second-main.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -var dep = require('./generated-dep.js'); - -console.log('main1', dep); diff --git a/test/chunking-form/samples/deprecated/emit-chunk-existing/_expected/es/first-main.js b/test/chunking-form/samples/deprecated/emit-chunk-existing/_expected/es/first-main.js deleted file mode 100644 index d77500b5810..00000000000 --- a/test/chunking-form/samples/deprecated/emit-chunk-existing/_expected/es/first-main.js +++ /dev/null @@ -1,3 +0,0 @@ -import value from './generated-dep.js'; - -console.log('main1', value); diff --git a/test/chunking-form/samples/deprecated/emit-chunk-existing/_expected/es/generated-dep.js b/test/chunking-form/samples/deprecated/emit-chunk-existing/_expected/es/generated-dep.js deleted file mode 100644 index 47d1cc6ec49..00000000000 --- a/test/chunking-form/samples/deprecated/emit-chunk-existing/_expected/es/generated-dep.js +++ /dev/null @@ -1,3 +0,0 @@ -var value = 42; - -export { value as default }; diff --git a/test/chunking-form/samples/deprecated/emit-chunk-existing/_expected/es/second-main.js b/test/chunking-form/samples/deprecated/emit-chunk-existing/_expected/es/second-main.js deleted file mode 100644 index d77500b5810..00000000000 --- a/test/chunking-form/samples/deprecated/emit-chunk-existing/_expected/es/second-main.js +++ /dev/null @@ -1,3 +0,0 @@ -import value from './generated-dep.js'; - -console.log('main1', value); diff --git a/test/chunking-form/samples/deprecated/emit-chunk-existing/_expected/system/first-main.js b/test/chunking-form/samples/deprecated/emit-chunk-existing/_expected/system/first-main.js deleted file mode 100644 index 1901ed04d73..00000000000 --- a/test/chunking-form/samples/deprecated/emit-chunk-existing/_expected/system/first-main.js +++ /dev/null @@ -1,14 +0,0 @@ -System.register(['./generated-dep.js'], (function () { - 'use strict'; - var value; - return { - setters: [function (module) { - value = module["default"]; - }], - execute: (function () { - - console.log('main1', value); - - }) - }; -})); diff --git a/test/chunking-form/samples/deprecated/emit-chunk-existing/_expected/system/generated-dep.js b/test/chunking-form/samples/deprecated/emit-chunk-existing/_expected/system/generated-dep.js deleted file mode 100644 index 1c71e7612ba..00000000000 --- a/test/chunking-form/samples/deprecated/emit-chunk-existing/_expected/system/generated-dep.js +++ /dev/null @@ -1,10 +0,0 @@ -System.register([], (function (exports) { - 'use strict'; - return { - execute: (function () { - - var value = exports('default', 42); - - }) - }; -})); diff --git a/test/chunking-form/samples/deprecated/emit-chunk-existing/_expected/system/second-main.js b/test/chunking-form/samples/deprecated/emit-chunk-existing/_expected/system/second-main.js deleted file mode 100644 index 1901ed04d73..00000000000 --- a/test/chunking-form/samples/deprecated/emit-chunk-existing/_expected/system/second-main.js +++ /dev/null @@ -1,14 +0,0 @@ -System.register(['./generated-dep.js'], (function () { - 'use strict'; - var value; - return { - setters: [function (module) { - value = module["default"]; - }], - execute: (function () { - - console.log('main1', value); - - }) - }; -})); diff --git a/test/chunking-form/samples/deprecated/emit-chunk-existing/dep.js b/test/chunking-form/samples/deprecated/emit-chunk-existing/dep.js deleted file mode 100644 index 7a4e8a723a4..00000000000 --- a/test/chunking-form/samples/deprecated/emit-chunk-existing/dep.js +++ /dev/null @@ -1 +0,0 @@ -export default 42; diff --git a/test/chunking-form/samples/deprecated/emit-chunk-existing/main1.js b/test/chunking-form/samples/deprecated/emit-chunk-existing/main1.js deleted file mode 100644 index e384824c6f2..00000000000 --- a/test/chunking-form/samples/deprecated/emit-chunk-existing/main1.js +++ /dev/null @@ -1,3 +0,0 @@ -import value from './dep.js'; - -console.log('main1', value); diff --git a/test/chunking-form/samples/deprecated/emit-chunk-existing/main2.js b/test/chunking-form/samples/deprecated/emit-chunk-existing/main2.js deleted file mode 100644 index e384824c6f2..00000000000 --- a/test/chunking-form/samples/deprecated/emit-chunk-existing/main2.js +++ /dev/null @@ -1,3 +0,0 @@ -import value from './dep.js'; - -console.log('main1', value); diff --git a/test/chunking-form/samples/deprecated/emit-chunk-facade/_config.js b/test/chunking-form/samples/deprecated/emit-chunk-facade/_config.js deleted file mode 100644 index 780dd15d602..00000000000 --- a/test/chunking-form/samples/deprecated/emit-chunk-facade/_config.js +++ /dev/null @@ -1,22 +0,0 @@ -const assert = require('assert'); -let referenceId; - -module.exports = { - description: 'retrieves the correct name of an emitted chunk in case a facade is created', - expectedWarnings: ['DEPRECATED_FEATURE'], - options: { - strictDeprecations: false, - input: 'main', - manualChunks: { - 'build-starter': ['buildStart'] - }, - plugins: { - buildStart() { - referenceId = this.emitChunk('buildStart'); - }, - renderChunk() { - assert.strictEqual(this.getChunkFileName(referenceId), 'generated-buildStart.js'); - } - } - } -}; diff --git a/test/chunking-form/samples/deprecated/emit-chunk-facade/_expected/amd/generated-build-starter.js b/test/chunking-form/samples/deprecated/emit-chunk-facade/_expected/amd/generated-build-starter.js deleted file mode 100644 index 8efead70ddb..00000000000 --- a/test/chunking-form/samples/deprecated/emit-chunk-facade/_expected/amd/generated-build-starter.js +++ /dev/null @@ -1,11 +0,0 @@ -define(['exports'], (function (exports) { 'use strict'; - - const value = 42; - const otherValue = 43; - - console.log('startBuild', value); - - exports.otherValue = otherValue; - exports.value = value; - -})); diff --git a/test/chunking-form/samples/deprecated/emit-chunk-facade/_expected/amd/generated-buildStart.js b/test/chunking-form/samples/deprecated/emit-chunk-facade/_expected/amd/generated-buildStart.js deleted file mode 100644 index 61abbcd2ed9..00000000000 --- a/test/chunking-form/samples/deprecated/emit-chunk-facade/_expected/amd/generated-buildStart.js +++ /dev/null @@ -1,9 +0,0 @@ -define(['exports', './generated-build-starter'], (function (exports, buildStarter) { 'use strict'; - - - - exports.buildStartValue = buildStarter.value; - - Object.defineProperty(exports, '__esModule', { value: true }); - -})); diff --git a/test/chunking-form/samples/deprecated/emit-chunk-facade/_expected/amd/main.js b/test/chunking-form/samples/deprecated/emit-chunk-facade/_expected/amd/main.js deleted file mode 100644 index 830d2184836..00000000000 --- a/test/chunking-form/samples/deprecated/emit-chunk-facade/_expected/amd/main.js +++ /dev/null @@ -1,5 +0,0 @@ -define(['./generated-build-starter'], (function (buildStarter) { 'use strict'; - - console.log('main', buildStarter.value, buildStarter.otherValue); - -})); diff --git a/test/chunking-form/samples/deprecated/emit-chunk-facade/_expected/cjs/generated-build-starter.js b/test/chunking-form/samples/deprecated/emit-chunk-facade/_expected/cjs/generated-build-starter.js deleted file mode 100644 index fecf7a3cd4c..00000000000 --- a/test/chunking-form/samples/deprecated/emit-chunk-facade/_expected/cjs/generated-build-starter.js +++ /dev/null @@ -1,9 +0,0 @@ -'use strict'; - -const value = 42; -const otherValue = 43; - -console.log('startBuild', value); - -exports.otherValue = otherValue; -exports.value = value; diff --git a/test/chunking-form/samples/deprecated/emit-chunk-facade/_expected/cjs/generated-buildStart.js b/test/chunking-form/samples/deprecated/emit-chunk-facade/_expected/cjs/generated-buildStart.js deleted file mode 100644 index 66c05cca4ba..00000000000 --- a/test/chunking-form/samples/deprecated/emit-chunk-facade/_expected/cjs/generated-buildStart.js +++ /dev/null @@ -1,9 +0,0 @@ -'use strict'; - -Object.defineProperty(exports, '__esModule', { value: true }); - -var buildStarter = require('./generated-build-starter.js'); - - - -exports.buildStartValue = buildStarter.value; diff --git a/test/chunking-form/samples/deprecated/emit-chunk-facade/_expected/cjs/main.js b/test/chunking-form/samples/deprecated/emit-chunk-facade/_expected/cjs/main.js deleted file mode 100644 index 666c396846a..00000000000 --- a/test/chunking-form/samples/deprecated/emit-chunk-facade/_expected/cjs/main.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -var buildStarter = require('./generated-build-starter.js'); - -console.log('main', buildStarter.value, buildStarter.otherValue); diff --git a/test/chunking-form/samples/deprecated/emit-chunk-facade/_expected/es/generated-build-starter.js b/test/chunking-form/samples/deprecated/emit-chunk-facade/_expected/es/generated-build-starter.js deleted file mode 100644 index 43deafdd0be..00000000000 --- a/test/chunking-form/samples/deprecated/emit-chunk-facade/_expected/es/generated-build-starter.js +++ /dev/null @@ -1,6 +0,0 @@ -const value = 42; -const otherValue = 43; - -console.log('startBuild', value); - -export { otherValue as o, value as v }; diff --git a/test/chunking-form/samples/deprecated/emit-chunk-facade/_expected/es/generated-buildStart.js b/test/chunking-form/samples/deprecated/emit-chunk-facade/_expected/es/generated-buildStart.js deleted file mode 100644 index ffb305eac54..00000000000 --- a/test/chunking-form/samples/deprecated/emit-chunk-facade/_expected/es/generated-buildStart.js +++ /dev/null @@ -1 +0,0 @@ -export { v as buildStartValue } from './generated-build-starter.js'; diff --git a/test/chunking-form/samples/deprecated/emit-chunk-facade/_expected/es/main.js b/test/chunking-form/samples/deprecated/emit-chunk-facade/_expected/es/main.js deleted file mode 100644 index 28caef9429d..00000000000 --- a/test/chunking-form/samples/deprecated/emit-chunk-facade/_expected/es/main.js +++ /dev/null @@ -1,3 +0,0 @@ -import { v as value, o as otherValue } from './generated-build-starter.js'; - -console.log('main', value, otherValue); diff --git a/test/chunking-form/samples/deprecated/emit-chunk-facade/_expected/system/generated-build-starter.js b/test/chunking-form/samples/deprecated/emit-chunk-facade/_expected/system/generated-build-starter.js deleted file mode 100644 index 745c94783ba..00000000000 --- a/test/chunking-form/samples/deprecated/emit-chunk-facade/_expected/system/generated-build-starter.js +++ /dev/null @@ -1,13 +0,0 @@ -System.register([], (function (exports) { - 'use strict'; - return { - execute: (function () { - - const value = exports('v', 42); - const otherValue = exports('o', 43); - - console.log('startBuild', value); - - }) - }; -})); diff --git a/test/chunking-form/samples/deprecated/emit-chunk-facade/_expected/system/generated-buildStart.js b/test/chunking-form/samples/deprecated/emit-chunk-facade/_expected/system/generated-buildStart.js deleted file mode 100644 index c21eed54dae..00000000000 --- a/test/chunking-form/samples/deprecated/emit-chunk-facade/_expected/system/generated-buildStart.js +++ /dev/null @@ -1,13 +0,0 @@ -System.register(['./generated-build-starter.js'], (function (exports) { - 'use strict'; - return { - setters: [function (module) { - exports('buildStartValue', module.v); - }], - execute: (function () { - - - - }) - }; -})); diff --git a/test/chunking-form/samples/deprecated/emit-chunk-facade/_expected/system/main.js b/test/chunking-form/samples/deprecated/emit-chunk-facade/_expected/system/main.js deleted file mode 100644 index 55b718e43e0..00000000000 --- a/test/chunking-form/samples/deprecated/emit-chunk-facade/_expected/system/main.js +++ /dev/null @@ -1,15 +0,0 @@ -System.register(['./generated-build-starter.js'], (function () { - 'use strict'; - var value, otherValue; - return { - setters: [function (module) { - value = module.v; - otherValue = module.o; - }], - execute: (function () { - - console.log('main', value, otherValue); - - }) - }; -})); diff --git a/test/chunking-form/samples/deprecated/emit-chunk-facade/buildStart.js b/test/chunking-form/samples/deprecated/emit-chunk-facade/buildStart.js deleted file mode 100644 index 49baee4964e..00000000000 --- a/test/chunking-form/samples/deprecated/emit-chunk-facade/buildStart.js +++ /dev/null @@ -1,5 +0,0 @@ -import {value} from './dep.js'; - -console.log('startBuild', value); - -export { value as buildStartValue }; diff --git a/test/chunking-form/samples/deprecated/emit-chunk-facade/dep.js b/test/chunking-form/samples/deprecated/emit-chunk-facade/dep.js deleted file mode 100644 index a2db6341120..00000000000 --- a/test/chunking-form/samples/deprecated/emit-chunk-facade/dep.js +++ /dev/null @@ -1,2 +0,0 @@ -export const value = 42; -export const otherValue = 43; diff --git a/test/chunking-form/samples/deprecated/emit-chunk-facade/main.js b/test/chunking-form/samples/deprecated/emit-chunk-facade/main.js deleted file mode 100644 index df41d56376c..00000000000 --- a/test/chunking-form/samples/deprecated/emit-chunk-facade/main.js +++ /dev/null @@ -1,3 +0,0 @@ -import { value, otherValue } from './dep'; - -console.log('main', value, otherValue); diff --git a/test/chunking-form/samples/deprecated/emit-chunk-named/_config.js b/test/chunking-form/samples/deprecated/emit-chunk-named/_config.js deleted file mode 100644 index ac8a7dbf46c..00000000000 --- a/test/chunking-form/samples/deprecated/emit-chunk-named/_config.js +++ /dev/null @@ -1,32 +0,0 @@ -const assert = require('assert'); -let referenceIdBuildStart; -let referenceIdTransform; - -module.exports = { - description: 'allows naming emitted chunks', - expectedWarnings: ['DEPRECATED_FEATURE'], - options: { - strictDeprecations: false, - input: 'main', - plugins: { - buildStart() { - referenceIdBuildStart = this.emitChunk('buildStart', { name: 'nested/build-start' }); - }, - transform(code, id) { - if (id.endsWith('main.js')) { - referenceIdTransform = this.emitChunk('transform', { name: 'nested/transform' }); - } - }, - renderChunk() { - assert.strictEqual( - this.getChunkFileName(referenceIdBuildStart), - 'generated-nested/build-start.js' - ); - assert.strictEqual( - this.getChunkFileName(referenceIdTransform), - 'generated-nested/transform.js' - ); - } - } - } -}; diff --git a/test/chunking-form/samples/deprecated/emit-chunk-named/_expected/amd/generated-dep.js b/test/chunking-form/samples/deprecated/emit-chunk-named/_expected/amd/generated-dep.js deleted file mode 100644 index d041b1d05f7..00000000000 --- a/test/chunking-form/samples/deprecated/emit-chunk-named/_expected/amd/generated-dep.js +++ /dev/null @@ -1,7 +0,0 @@ -define(['exports'], (function (exports) { 'use strict'; - - var value = 42; - - exports.value = value; - -})); diff --git a/test/chunking-form/samples/deprecated/emit-chunk-named/_expected/amd/generated-nested/build-start.js b/test/chunking-form/samples/deprecated/emit-chunk-named/_expected/amd/generated-nested/build-start.js deleted file mode 100644 index b4158d6ac5d..00000000000 --- a/test/chunking-form/samples/deprecated/emit-chunk-named/_expected/amd/generated-nested/build-start.js +++ /dev/null @@ -1,5 +0,0 @@ -define(['../generated-dep'], (function (dep) { 'use strict'; - - console.log('buildStart', dep.value); - -})); diff --git a/test/chunking-form/samples/deprecated/emit-chunk-named/_expected/amd/generated-nested/transform.js b/test/chunking-form/samples/deprecated/emit-chunk-named/_expected/amd/generated-nested/transform.js deleted file mode 100644 index f8b3205df21..00000000000 --- a/test/chunking-form/samples/deprecated/emit-chunk-named/_expected/amd/generated-nested/transform.js +++ /dev/null @@ -1,5 +0,0 @@ -define(['../generated-dep'], (function (dep) { 'use strict'; - - console.log('transform', dep.value); - -})); diff --git a/test/chunking-form/samples/deprecated/emit-chunk-named/_expected/amd/main.js b/test/chunking-form/samples/deprecated/emit-chunk-named/_expected/amd/main.js deleted file mode 100644 index 9e566362545..00000000000 --- a/test/chunking-form/samples/deprecated/emit-chunk-named/_expected/amd/main.js +++ /dev/null @@ -1,5 +0,0 @@ -define(['./generated-dep'], (function (dep) { 'use strict'; - - console.log('main', dep.value); - -})); diff --git a/test/chunking-form/samples/deprecated/emit-chunk-named/_expected/cjs/generated-dep.js b/test/chunking-form/samples/deprecated/emit-chunk-named/_expected/cjs/generated-dep.js deleted file mode 100644 index 6cec42c9a07..00000000000 --- a/test/chunking-form/samples/deprecated/emit-chunk-named/_expected/cjs/generated-dep.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -var value = 42; - -exports.value = value; diff --git a/test/chunking-form/samples/deprecated/emit-chunk-named/_expected/cjs/generated-nested/build-start.js b/test/chunking-form/samples/deprecated/emit-chunk-named/_expected/cjs/generated-nested/build-start.js deleted file mode 100644 index 734070e78c9..00000000000 --- a/test/chunking-form/samples/deprecated/emit-chunk-named/_expected/cjs/generated-nested/build-start.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -var dep = require('../generated-dep.js'); - -console.log('buildStart', dep.value); diff --git a/test/chunking-form/samples/deprecated/emit-chunk-named/_expected/cjs/generated-nested/transform.js b/test/chunking-form/samples/deprecated/emit-chunk-named/_expected/cjs/generated-nested/transform.js deleted file mode 100644 index 4b0f9999aa4..00000000000 --- a/test/chunking-form/samples/deprecated/emit-chunk-named/_expected/cjs/generated-nested/transform.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -var dep = require('../generated-dep.js'); - -console.log('transform', dep.value); diff --git a/test/chunking-form/samples/deprecated/emit-chunk-named/_expected/cjs/main.js b/test/chunking-form/samples/deprecated/emit-chunk-named/_expected/cjs/main.js deleted file mode 100644 index 4c79b32a701..00000000000 --- a/test/chunking-form/samples/deprecated/emit-chunk-named/_expected/cjs/main.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -var dep = require('./generated-dep.js'); - -console.log('main', dep.value); diff --git a/test/chunking-form/samples/deprecated/emit-chunk-named/_expected/es/generated-dep.js b/test/chunking-form/samples/deprecated/emit-chunk-named/_expected/es/generated-dep.js deleted file mode 100644 index b7cbe038a73..00000000000 --- a/test/chunking-form/samples/deprecated/emit-chunk-named/_expected/es/generated-dep.js +++ /dev/null @@ -1,3 +0,0 @@ -var value = 42; - -export { value as v }; diff --git a/test/chunking-form/samples/deprecated/emit-chunk-named/_expected/es/generated-nested/build-start.js b/test/chunking-form/samples/deprecated/emit-chunk-named/_expected/es/generated-nested/build-start.js deleted file mode 100644 index 8b7f3766098..00000000000 --- a/test/chunking-form/samples/deprecated/emit-chunk-named/_expected/es/generated-nested/build-start.js +++ /dev/null @@ -1,3 +0,0 @@ -import { v as value } from '../generated-dep.js'; - -console.log('buildStart', value); diff --git a/test/chunking-form/samples/deprecated/emit-chunk-named/_expected/es/generated-nested/transform.js b/test/chunking-form/samples/deprecated/emit-chunk-named/_expected/es/generated-nested/transform.js deleted file mode 100644 index 61ce66361c3..00000000000 --- a/test/chunking-form/samples/deprecated/emit-chunk-named/_expected/es/generated-nested/transform.js +++ /dev/null @@ -1,3 +0,0 @@ -import { v as value } from '../generated-dep.js'; - -console.log('transform', value); diff --git a/test/chunking-form/samples/deprecated/emit-chunk-named/_expected/es/main.js b/test/chunking-form/samples/deprecated/emit-chunk-named/_expected/es/main.js deleted file mode 100644 index da4e855f39a..00000000000 --- a/test/chunking-form/samples/deprecated/emit-chunk-named/_expected/es/main.js +++ /dev/null @@ -1,3 +0,0 @@ -import { v as value } from './generated-dep.js'; - -console.log('main', value); diff --git a/test/chunking-form/samples/deprecated/emit-chunk-named/_expected/system/generated-dep.js b/test/chunking-form/samples/deprecated/emit-chunk-named/_expected/system/generated-dep.js deleted file mode 100644 index eb5993a958a..00000000000 --- a/test/chunking-form/samples/deprecated/emit-chunk-named/_expected/system/generated-dep.js +++ /dev/null @@ -1,10 +0,0 @@ -System.register([], (function (exports) { - 'use strict'; - return { - execute: (function () { - - var value = exports('v', 42); - - }) - }; -})); diff --git a/test/chunking-form/samples/deprecated/emit-chunk-named/_expected/system/generated-nested/build-start.js b/test/chunking-form/samples/deprecated/emit-chunk-named/_expected/system/generated-nested/build-start.js deleted file mode 100644 index 7db3b7616b1..00000000000 --- a/test/chunking-form/samples/deprecated/emit-chunk-named/_expected/system/generated-nested/build-start.js +++ /dev/null @@ -1,14 +0,0 @@ -System.register(['../generated-dep.js'], (function () { - 'use strict'; - var value; - return { - setters: [function (module) { - value = module.v; - }], - execute: (function () { - - console.log('buildStart', value); - - }) - }; -})); diff --git a/test/chunking-form/samples/deprecated/emit-chunk-named/_expected/system/generated-nested/transform.js b/test/chunking-form/samples/deprecated/emit-chunk-named/_expected/system/generated-nested/transform.js deleted file mode 100644 index fd90ea1c2e9..00000000000 --- a/test/chunking-form/samples/deprecated/emit-chunk-named/_expected/system/generated-nested/transform.js +++ /dev/null @@ -1,14 +0,0 @@ -System.register(['../generated-dep.js'], (function () { - 'use strict'; - var value; - return { - setters: [function (module) { - value = module.v; - }], - execute: (function () { - - console.log('transform', value); - - }) - }; -})); diff --git a/test/chunking-form/samples/deprecated/emit-chunk-named/_expected/system/main.js b/test/chunking-form/samples/deprecated/emit-chunk-named/_expected/system/main.js deleted file mode 100644 index 39150aad0de..00000000000 --- a/test/chunking-form/samples/deprecated/emit-chunk-named/_expected/system/main.js +++ /dev/null @@ -1,14 +0,0 @@ -System.register(['./generated-dep.js'], (function () { - 'use strict'; - var value; - return { - setters: [function (module) { - value = module.v; - }], - execute: (function () { - - console.log('main', value); - - }) - }; -})); diff --git a/test/chunking-form/samples/deprecated/emit-chunk-named/buildStart.js b/test/chunking-form/samples/deprecated/emit-chunk-named/buildStart.js deleted file mode 100644 index 373c51ace53..00000000000 --- a/test/chunking-form/samples/deprecated/emit-chunk-named/buildStart.js +++ /dev/null @@ -1,3 +0,0 @@ -import value from './dep.js'; - -console.log('buildStart', value); diff --git a/test/chunking-form/samples/deprecated/emit-chunk-named/dep.js b/test/chunking-form/samples/deprecated/emit-chunk-named/dep.js deleted file mode 100644 index 7a4e8a723a4..00000000000 --- a/test/chunking-form/samples/deprecated/emit-chunk-named/dep.js +++ /dev/null @@ -1 +0,0 @@ -export default 42; diff --git a/test/chunking-form/samples/deprecated/emit-chunk-named/main.js b/test/chunking-form/samples/deprecated/emit-chunk-named/main.js deleted file mode 100644 index 4a9b3a3f405..00000000000 --- a/test/chunking-form/samples/deprecated/emit-chunk-named/main.js +++ /dev/null @@ -1,3 +0,0 @@ -import value from './dep.js'; - -console.log('main', value); diff --git a/test/chunking-form/samples/deprecated/emit-chunk-named/transform.js b/test/chunking-form/samples/deprecated/emit-chunk-named/transform.js deleted file mode 100644 index 6eed294c62c..00000000000 --- a/test/chunking-form/samples/deprecated/emit-chunk-named/transform.js +++ /dev/null @@ -1,3 +0,0 @@ -import value from './dep.js'; - -console.log('transform', value); diff --git a/test/chunking-form/samples/deprecated/emit-chunk-worker/_config.js b/test/chunking-form/samples/deprecated/emit-chunk-worker/_config.js deleted file mode 100644 index 5e1a2ba5b27..00000000000 --- a/test/chunking-form/samples/deprecated/emit-chunk-worker/_config.js +++ /dev/null @@ -1,56 +0,0 @@ -const path = require('path'); - -let workerId; -let proxyId; - -module.exports = { - description: 'allows adding additional chunks to be used in workers', - expectedWarnings: ['DEPRECATED_FEATURE'], - options: { - strictDeprecations: false, - input: 'main', - output: { - chunkFileNames: 'chunks/[name].js' - }, - plugins: { - load(id) { - if (id === 'merged' || id === 'nested') { - if (!workerId) { - workerId = this.emitChunk('worker'); - proxyId = this.emitChunk('worker-proxy'); - } - return ` -export const getWorkerMessage = () => new Promise(resolve => { - const worker = new Worker(import.meta.ROLLUP_CHUNK_URL_${proxyId}); - worker.onmessage = resolve; -});`; - } - if (id === 'worker-proxy') { - return `PLACEHOLDER(import.meta.ROLLUP_CHUNK_URL_${workerId})`; - } - }, - renderChunk(code, chunk, options) { - if (chunk.facadeModuleId === 'worker-proxy') { - const chunkFileName = `./${path.relative( - path.dirname(chunk.fileName), - this.getChunkFileName(workerId) - )}`; - if (options.format === 'system') { - return `importScripts('../../../../../../../node_modules/systemjs/dist/system.js'); -System.import('${chunkFileName}');`; - } - if (options.format === 'amd') { - return `importScripts('../../../../../../../node_modules/requirejs/require.js'); -requirejs(['${chunkFileName}']);`; - } - } - }, - resolveId(id) { - if (id === 'merged' || id === 'nested' || id === 'worker-proxy') { - return id; - } - return null; - } - } - } -}; diff --git a/test/chunking-form/samples/deprecated/emit-chunk-worker/_expected/amd/chunks/nested.js b/test/chunking-form/samples/deprecated/emit-chunk-worker/_expected/amd/chunks/nested.js deleted file mode 100644 index 206aefd79b4..00000000000 --- a/test/chunking-form/samples/deprecated/emit-chunk-worker/_expected/amd/chunks/nested.js +++ /dev/null @@ -1,10 +0,0 @@ -define(['require', 'exports'], (function (require, exports) { 'use strict'; - - const getWorkerMessage = () => new Promise(resolve => { - const worker = new Worker(new URL(require.toUrl('./worker-proxy.js'), document.baseURI).href); - worker.onmessage = resolve; - }); - - exports.getWorkerMessage = getWorkerMessage; - -})); diff --git a/test/chunking-form/samples/deprecated/emit-chunk-worker/_expected/amd/chunks/shared.js b/test/chunking-form/samples/deprecated/emit-chunk-worker/_expected/amd/chunks/shared.js deleted file mode 100644 index 3f801df74ed..00000000000 --- a/test/chunking-form/samples/deprecated/emit-chunk-worker/_expected/amd/chunks/shared.js +++ /dev/null @@ -1,7 +0,0 @@ -define(['exports'], (function (exports) { 'use strict'; - - const shared = 'shared'; - - exports.shared = shared; - -})); diff --git a/test/chunking-form/samples/deprecated/emit-chunk-worker/_expected/amd/chunks/worker-proxy.js b/test/chunking-form/samples/deprecated/emit-chunk-worker/_expected/amd/chunks/worker-proxy.js deleted file mode 100644 index 4f2962c005b..00000000000 --- a/test/chunking-form/samples/deprecated/emit-chunk-worker/_expected/amd/chunks/worker-proxy.js +++ /dev/null @@ -1,2 +0,0 @@ -importScripts('../../../../../../../node_modules/requirejs/require.js'); -requirejs(['./worker.js']); diff --git a/test/chunking-form/samples/deprecated/emit-chunk-worker/_expected/amd/chunks/worker.js b/test/chunking-form/samples/deprecated/emit-chunk-worker/_expected/amd/chunks/worker.js deleted file mode 100644 index 56158bba992..00000000000 --- a/test/chunking-form/samples/deprecated/emit-chunk-worker/_expected/amd/chunks/worker.js +++ /dev/null @@ -1,5 +0,0 @@ -define(['./shared'], (function (shared) { 'use strict'; - - postMessage(`from worker: ${shared.shared}`); - -})); diff --git a/test/chunking-form/samples/deprecated/emit-chunk-worker/_expected/amd/main.js b/test/chunking-form/samples/deprecated/emit-chunk-worker/_expected/amd/main.js deleted file mode 100644 index 8a68fe8635f..00000000000 --- a/test/chunking-form/samples/deprecated/emit-chunk-worker/_expected/amd/main.js +++ /dev/null @@ -1,15 +0,0 @@ -define(['require', './chunks/shared'], (function (require, shared) { 'use strict'; - - const getWorkerMessage = () => new Promise(resolve => { - const worker = new Worker(new URL(require.toUrl('./chunks/worker-proxy.js'), document.baseURI).href); - worker.onmessage = resolve; - }); - - document.body.innerHTML += `

main: ${shared.shared}

`; - getWorkerMessage().then(message => (document.body.innerHTML += `

1: ${message.data}

`)); - - new Promise(function (resolve, reject) { require(['./chunks/nested'], resolve, reject); }) - .then(result => result.getWorkerMessage()) - .then(message => (document.body.innerHTML += `

2: ${message.data}

`)); - -})); diff --git a/test/chunking-form/samples/deprecated/emit-chunk-worker/_expected/cjs/chunks/nested.js b/test/chunking-form/samples/deprecated/emit-chunk-worker/_expected/cjs/chunks/nested.js deleted file mode 100644 index b1544deca5e..00000000000 --- a/test/chunking-form/samples/deprecated/emit-chunk-worker/_expected/cjs/chunks/nested.js +++ /dev/null @@ -1,8 +0,0 @@ -'use strict'; - -const getWorkerMessage = () => new Promise(resolve => { - const worker = new Worker((typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __dirname + '/worker-proxy.js').href : new URL('worker-proxy.js', document.currentScript && document.currentScript.src || document.baseURI).href)); - worker.onmessage = resolve; -}); - -exports.getWorkerMessage = getWorkerMessage; diff --git a/test/chunking-form/samples/deprecated/emit-chunk-worker/_expected/cjs/chunks/shared.js b/test/chunking-form/samples/deprecated/emit-chunk-worker/_expected/cjs/chunks/shared.js deleted file mode 100644 index e2dc6ecb8ef..00000000000 --- a/test/chunking-form/samples/deprecated/emit-chunk-worker/_expected/cjs/chunks/shared.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -const shared = 'shared'; - -exports.shared = shared; diff --git a/test/chunking-form/samples/deprecated/emit-chunk-worker/_expected/cjs/chunks/worker-proxy.js b/test/chunking-form/samples/deprecated/emit-chunk-worker/_expected/cjs/chunks/worker-proxy.js deleted file mode 100644 index 0171ef8895e..00000000000 --- a/test/chunking-form/samples/deprecated/emit-chunk-worker/_expected/cjs/chunks/worker-proxy.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -PLACEHOLDER((typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __dirname + '/worker.js').href : new URL('worker.js', document.currentScript && document.currentScript.src || document.baseURI).href)); diff --git a/test/chunking-form/samples/deprecated/emit-chunk-worker/_expected/cjs/chunks/worker.js b/test/chunking-form/samples/deprecated/emit-chunk-worker/_expected/cjs/chunks/worker.js deleted file mode 100644 index c12a25e95f5..00000000000 --- a/test/chunking-form/samples/deprecated/emit-chunk-worker/_expected/cjs/chunks/worker.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -var shared = require('./shared.js'); - -postMessage(`from worker: ${shared.shared}`); diff --git a/test/chunking-form/samples/deprecated/emit-chunk-worker/_expected/cjs/main.js b/test/chunking-form/samples/deprecated/emit-chunk-worker/_expected/cjs/main.js deleted file mode 100644 index 1d9811d9f8b..00000000000 --- a/test/chunking-form/samples/deprecated/emit-chunk-worker/_expected/cjs/main.js +++ /dev/null @@ -1,15 +0,0 @@ -'use strict'; - -var shared = require('./chunks/shared.js'); - -const getWorkerMessage = () => new Promise(resolve => { - const worker = new Worker((typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __dirname + '/chunks/worker-proxy.js').href : new URL('chunks/worker-proxy.js', document.currentScript && document.currentScript.src || document.baseURI).href)); - worker.onmessage = resolve; -}); - -document.body.innerHTML += `

main: ${shared.shared}

`; -getWorkerMessage().then(message => (document.body.innerHTML += `

1: ${message.data}

`)); - -Promise.resolve().then(function () { return require('./chunks/nested.js'); }) - .then(result => result.getWorkerMessage()) - .then(message => (document.body.innerHTML += `

2: ${message.data}

`)); diff --git a/test/chunking-form/samples/deprecated/emit-chunk-worker/_expected/es/chunks/nested.js b/test/chunking-form/samples/deprecated/emit-chunk-worker/_expected/es/chunks/nested.js deleted file mode 100644 index 13c379e9742..00000000000 --- a/test/chunking-form/samples/deprecated/emit-chunk-worker/_expected/es/chunks/nested.js +++ /dev/null @@ -1,6 +0,0 @@ -const getWorkerMessage = () => new Promise(resolve => { - const worker = new Worker(new URL('worker-proxy.js', import.meta.url).href); - worker.onmessage = resolve; -}); - -export { getWorkerMessage }; diff --git a/test/chunking-form/samples/deprecated/emit-chunk-worker/_expected/es/chunks/shared.js b/test/chunking-form/samples/deprecated/emit-chunk-worker/_expected/es/chunks/shared.js deleted file mode 100644 index 464379ccc95..00000000000 --- a/test/chunking-form/samples/deprecated/emit-chunk-worker/_expected/es/chunks/shared.js +++ /dev/null @@ -1,3 +0,0 @@ -const shared = 'shared'; - -export { shared as s }; diff --git a/test/chunking-form/samples/deprecated/emit-chunk-worker/_expected/es/chunks/worker-proxy.js b/test/chunking-form/samples/deprecated/emit-chunk-worker/_expected/es/chunks/worker-proxy.js deleted file mode 100644 index 88e9531a22e..00000000000 --- a/test/chunking-form/samples/deprecated/emit-chunk-worker/_expected/es/chunks/worker-proxy.js +++ /dev/null @@ -1 +0,0 @@ -PLACEHOLDER(new URL('worker.js', import.meta.url).href); diff --git a/test/chunking-form/samples/deprecated/emit-chunk-worker/_expected/es/chunks/worker.js b/test/chunking-form/samples/deprecated/emit-chunk-worker/_expected/es/chunks/worker.js deleted file mode 100644 index 376c9cd1a99..00000000000 --- a/test/chunking-form/samples/deprecated/emit-chunk-worker/_expected/es/chunks/worker.js +++ /dev/null @@ -1,3 +0,0 @@ -import { s as shared } from './shared.js'; - -postMessage(`from worker: ${shared}`); diff --git a/test/chunking-form/samples/deprecated/emit-chunk-worker/_expected/es/main.js b/test/chunking-form/samples/deprecated/emit-chunk-worker/_expected/es/main.js deleted file mode 100644 index 19521653160..00000000000 --- a/test/chunking-form/samples/deprecated/emit-chunk-worker/_expected/es/main.js +++ /dev/null @@ -1,13 +0,0 @@ -import { s as shared } from './chunks/shared.js'; - -const getWorkerMessage = () => new Promise(resolve => { - const worker = new Worker(new URL('chunks/worker-proxy.js', import.meta.url).href); - worker.onmessage = resolve; -}); - -document.body.innerHTML += `

main: ${shared}

`; -getWorkerMessage().then(message => (document.body.innerHTML += `

1: ${message.data}

`)); - -import('./chunks/nested.js') - .then(result => result.getWorkerMessage()) - .then(message => (document.body.innerHTML += `

2: ${message.data}

`)); diff --git a/test/chunking-form/samples/deprecated/emit-chunk-worker/_expected/system/chunks/nested.js b/test/chunking-form/samples/deprecated/emit-chunk-worker/_expected/system/chunks/nested.js deleted file mode 100644 index ac5b45772ce..00000000000 --- a/test/chunking-form/samples/deprecated/emit-chunk-worker/_expected/system/chunks/nested.js +++ /dev/null @@ -1,13 +0,0 @@ -System.register([], (function (exports, module) { - 'use strict'; - return { - execute: (function () { - - const getWorkerMessage = exports('getWorkerMessage', () => new Promise(resolve => { - const worker = new Worker(new URL('worker-proxy.js', module.meta.url).href); - worker.onmessage = resolve; - })); - - }) - }; -})); diff --git a/test/chunking-form/samples/deprecated/emit-chunk-worker/_expected/system/chunks/shared.js b/test/chunking-form/samples/deprecated/emit-chunk-worker/_expected/system/chunks/shared.js deleted file mode 100644 index 854bb712242..00000000000 --- a/test/chunking-form/samples/deprecated/emit-chunk-worker/_expected/system/chunks/shared.js +++ /dev/null @@ -1,10 +0,0 @@ -System.register([], (function (exports) { - 'use strict'; - return { - execute: (function () { - - const shared = exports('s', 'shared'); - - }) - }; -})); diff --git a/test/chunking-form/samples/deprecated/emit-chunk-worker/_expected/system/chunks/worker-proxy.js b/test/chunking-form/samples/deprecated/emit-chunk-worker/_expected/system/chunks/worker-proxy.js deleted file mode 100644 index 44eb3bb9210..00000000000 --- a/test/chunking-form/samples/deprecated/emit-chunk-worker/_expected/system/chunks/worker-proxy.js +++ /dev/null @@ -1,2 +0,0 @@ -importScripts('../../../../../../../node_modules/systemjs/dist/system.js'); -System.import('./worker.js'); diff --git a/test/chunking-form/samples/deprecated/emit-chunk-worker/_expected/system/chunks/worker.js b/test/chunking-form/samples/deprecated/emit-chunk-worker/_expected/system/chunks/worker.js deleted file mode 100644 index c73a318e3e4..00000000000 --- a/test/chunking-form/samples/deprecated/emit-chunk-worker/_expected/system/chunks/worker.js +++ /dev/null @@ -1,14 +0,0 @@ -System.register(['./shared.js'], (function () { - 'use strict'; - var shared; - return { - setters: [function (module) { - shared = module.s; - }], - execute: (function () { - - postMessage(`from worker: ${shared}`); - - }) - }; -})); diff --git a/test/chunking-form/samples/deprecated/emit-chunk-worker/_expected/system/main.js b/test/chunking-form/samples/deprecated/emit-chunk-worker/_expected/system/main.js deleted file mode 100644 index cd37abb081f..00000000000 --- a/test/chunking-form/samples/deprecated/emit-chunk-worker/_expected/system/main.js +++ /dev/null @@ -1,24 +0,0 @@ -System.register(['./chunks/shared.js'], (function (exports, module) { - 'use strict'; - var shared; - return { - setters: [function (module) { - shared = module.s; - }], - execute: (function () { - - const getWorkerMessage = () => new Promise(resolve => { - const worker = new Worker(new URL('chunks/worker-proxy.js', module.meta.url).href); - worker.onmessage = resolve; - }); - - document.body.innerHTML += `

main: ${shared}

`; - getWorkerMessage().then(message => (document.body.innerHTML += `

1: ${message.data}

`)); - - module.import('./chunks/nested.js') - .then(result => result.getWorkerMessage()) - .then(message => (document.body.innerHTML += `

2: ${message.data}

`)); - - }) - }; -})); diff --git a/test/chunking-form/samples/deprecated/emit-chunk-worker/index-amd.html b/test/chunking-form/samples/deprecated/emit-chunk-worker/index-amd.html deleted file mode 100644 index 476b9ce3df1..00000000000 --- a/test/chunking-form/samples/deprecated/emit-chunk-worker/index-amd.html +++ /dev/null @@ -1,10 +0,0 @@ - - - - - AMD - - - - - diff --git a/test/chunking-form/samples/deprecated/emit-chunk-worker/index-system.html b/test/chunking-form/samples/deprecated/emit-chunk-worker/index-system.html deleted file mode 100644 index 96c687c1eb7..00000000000 --- a/test/chunking-form/samples/deprecated/emit-chunk-worker/index-system.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - SystemJS - - - - - - diff --git a/test/chunking-form/samples/deprecated/emit-chunk-worker/main.js b/test/chunking-form/samples/deprecated/emit-chunk-worker/main.js deleted file mode 100644 index 4c03186f74e..00000000000 --- a/test/chunking-form/samples/deprecated/emit-chunk-worker/main.js +++ /dev/null @@ -1,9 +0,0 @@ -import { getWorkerMessage } from 'merged'; -import { shared } from './shared'; - -document.body.innerHTML += `

main: ${shared}

`; -getWorkerMessage().then(message => (document.body.innerHTML += `

1: ${message.data}

`)); - -import('nested') - .then(result => result.getWorkerMessage()) - .then(message => (document.body.innerHTML += `

2: ${message.data}

`)); diff --git a/test/chunking-form/samples/deprecated/emit-chunk-worker/shared.js b/test/chunking-form/samples/deprecated/emit-chunk-worker/shared.js deleted file mode 100644 index cd35843de7a..00000000000 --- a/test/chunking-form/samples/deprecated/emit-chunk-worker/shared.js +++ /dev/null @@ -1 +0,0 @@ -export const shared = 'shared'; diff --git a/test/chunking-form/samples/deprecated/emit-chunk-worker/worker.js b/test/chunking-form/samples/deprecated/emit-chunk-worker/worker.js deleted file mode 100644 index 824aa26d2e0..00000000000 --- a/test/chunking-form/samples/deprecated/emit-chunk-worker/worker.js +++ /dev/null @@ -1,3 +0,0 @@ -import {shared} from './shared'; - -postMessage(`from worker: ${shared}`); diff --git a/test/chunking-form/samples/deprecated/emit-chunk-worklet/_config.js b/test/chunking-form/samples/deprecated/emit-chunk-worklet/_config.js deleted file mode 100644 index 5c77d304c82..00000000000 --- a/test/chunking-form/samples/deprecated/emit-chunk-worklet/_config.js +++ /dev/null @@ -1,30 +0,0 @@ -const REGISTER_WORKLET = 'register-paint-worklet:'; - -module.exports = { - description: 'allows adding additional chunks to be used in worklets', - expectedWarnings: ['DEPRECATED_FEATURE'], - options: { - strictDeprecations: false, - input: 'main', - output: { - chunkFileNames: 'chunks/[name].js' - }, - plugins: { - load(id) { - if (id.startsWith(REGISTER_WORKLET)) { - return `CSS.paintWorklet.addModule(import.meta.ROLLUP_CHUNK_URL_${this.emitChunk( - id.slice(REGISTER_WORKLET.length) - )});`; - } - }, - resolveId(id, importee) { - if (id.startsWith(REGISTER_WORKLET)) { - return this.resolve(id.slice(REGISTER_WORKLET.length), importee).then( - resolvedId => REGISTER_WORKLET + resolvedId.id - ); - } - return null; - } - } - } -}; diff --git a/test/chunking-form/samples/deprecated/emit-chunk-worklet/_expected/amd/chunks/shared.js b/test/chunking-form/samples/deprecated/emit-chunk-worklet/_expected/amd/chunks/shared.js deleted file mode 100644 index e5f35a000cb..00000000000 --- a/test/chunking-form/samples/deprecated/emit-chunk-worklet/_expected/amd/chunks/shared.js +++ /dev/null @@ -1,9 +0,0 @@ -define(['exports'], (function (exports) { 'use strict'; - - const color = 'greenyellow'; - const size = 6; - - exports.color = color; - exports.size = size; - -})); diff --git a/test/chunking-form/samples/deprecated/emit-chunk-worklet/_expected/amd/chunks/worklet.js b/test/chunking-form/samples/deprecated/emit-chunk-worklet/_expected/amd/chunks/worklet.js deleted file mode 100644 index ea01ac8fb6b..00000000000 --- a/test/chunking-form/samples/deprecated/emit-chunk-worklet/_expected/amd/chunks/worklet.js +++ /dev/null @@ -1,17 +0,0 @@ -define(['./shared'], (function (shared) { 'use strict'; - - registerPaint( - 'vertical-lines', - class { - paint(ctx, geom) { - for (let x = 0; x < geom.width / shared.size; x++) { - ctx.beginPath(); - ctx.fillStyle = shared.color; - ctx.rect(x * shared.size, 0, 2, geom.height); - ctx.fill(); - } - } - } - ); - -})); diff --git a/test/chunking-form/samples/deprecated/emit-chunk-worklet/_expected/amd/main.js b/test/chunking-form/samples/deprecated/emit-chunk-worklet/_expected/amd/main.js deleted file mode 100644 index d10bf642861..00000000000 --- a/test/chunking-form/samples/deprecated/emit-chunk-worklet/_expected/amd/main.js +++ /dev/null @@ -1,7 +0,0 @@ -define(['require', './chunks/shared'], (function (require, shared) { 'use strict'; - - CSS.paintWorklet.addModule(new URL(require.toUrl('./chunks/worklet.js'), document.baseURI).href); - - document.body.innerHTML += `

color: ${shared.color}, size: ${shared.size}

`; - -})); diff --git a/test/chunking-form/samples/deprecated/emit-chunk-worklet/_expected/cjs/chunks/shared.js b/test/chunking-form/samples/deprecated/emit-chunk-worklet/_expected/cjs/chunks/shared.js deleted file mode 100644 index baee02947f7..00000000000 --- a/test/chunking-form/samples/deprecated/emit-chunk-worklet/_expected/cjs/chunks/shared.js +++ /dev/null @@ -1,7 +0,0 @@ -'use strict'; - -const color = 'greenyellow'; -const size = 6; - -exports.color = color; -exports.size = size; diff --git a/test/chunking-form/samples/deprecated/emit-chunk-worklet/_expected/cjs/chunks/worklet.js b/test/chunking-form/samples/deprecated/emit-chunk-worklet/_expected/cjs/chunks/worklet.js deleted file mode 100644 index 55c46f65372..00000000000 --- a/test/chunking-form/samples/deprecated/emit-chunk-worklet/_expected/cjs/chunks/worklet.js +++ /dev/null @@ -1,17 +0,0 @@ -'use strict'; - -var shared = require('./shared.js'); - -registerPaint( - 'vertical-lines', - class { - paint(ctx, geom) { - for (let x = 0; x < geom.width / shared.size; x++) { - ctx.beginPath(); - ctx.fillStyle = shared.color; - ctx.rect(x * shared.size, 0, 2, geom.height); - ctx.fill(); - } - } - } -); diff --git a/test/chunking-form/samples/deprecated/emit-chunk-worklet/_expected/cjs/main.js b/test/chunking-form/samples/deprecated/emit-chunk-worklet/_expected/cjs/main.js deleted file mode 100644 index 6ba79bfb0e6..00000000000 --- a/test/chunking-form/samples/deprecated/emit-chunk-worklet/_expected/cjs/main.js +++ /dev/null @@ -1,7 +0,0 @@ -'use strict'; - -var shared = require('./chunks/shared.js'); - -CSS.paintWorklet.addModule((typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __dirname + '/chunks/worklet.js').href : new URL('chunks/worklet.js', document.currentScript && document.currentScript.src || document.baseURI).href)); - -document.body.innerHTML += `

color: ${shared.color}, size: ${shared.size}

`; diff --git a/test/chunking-form/samples/deprecated/emit-chunk-worklet/_expected/es/chunks/shared.js b/test/chunking-form/samples/deprecated/emit-chunk-worklet/_expected/es/chunks/shared.js deleted file mode 100644 index cce16151201..00000000000 --- a/test/chunking-form/samples/deprecated/emit-chunk-worklet/_expected/es/chunks/shared.js +++ /dev/null @@ -1,4 +0,0 @@ -const color = 'greenyellow'; -const size = 6; - -export { color as c, size as s }; diff --git a/test/chunking-form/samples/deprecated/emit-chunk-worklet/_expected/es/chunks/worklet.js b/test/chunking-form/samples/deprecated/emit-chunk-worklet/_expected/es/chunks/worklet.js deleted file mode 100644 index 7ae737842e0..00000000000 --- a/test/chunking-form/samples/deprecated/emit-chunk-worklet/_expected/es/chunks/worklet.js +++ /dev/null @@ -1,15 +0,0 @@ -import { s as size, c as color } from './shared.js'; - -registerPaint( - 'vertical-lines', - class { - paint(ctx, geom) { - for (let x = 0; x < geom.width / size; x++) { - ctx.beginPath(); - ctx.fillStyle = color; - ctx.rect(x * size, 0, 2, geom.height); - ctx.fill(); - } - } - } -); diff --git a/test/chunking-form/samples/deprecated/emit-chunk-worklet/_expected/es/main.js b/test/chunking-form/samples/deprecated/emit-chunk-worklet/_expected/es/main.js deleted file mode 100644 index fc0e00f5183..00000000000 --- a/test/chunking-form/samples/deprecated/emit-chunk-worklet/_expected/es/main.js +++ /dev/null @@ -1,5 +0,0 @@ -import { c as color, s as size } from './chunks/shared.js'; - -CSS.paintWorklet.addModule(new URL('chunks/worklet.js', import.meta.url).href); - -document.body.innerHTML += `

color: ${color}, size: ${size}

`; diff --git a/test/chunking-form/samples/deprecated/emit-chunk-worklet/_expected/system/chunks/shared.js b/test/chunking-form/samples/deprecated/emit-chunk-worklet/_expected/system/chunks/shared.js deleted file mode 100644 index fa667a1eaec..00000000000 --- a/test/chunking-form/samples/deprecated/emit-chunk-worklet/_expected/system/chunks/shared.js +++ /dev/null @@ -1,11 +0,0 @@ -System.register([], (function (exports) { - 'use strict'; - return { - execute: (function () { - - const color = exports('c', 'greenyellow'); - const size = exports('s', 6); - - }) - }; -})); diff --git a/test/chunking-form/samples/deprecated/emit-chunk-worklet/_expected/system/chunks/worklet.js b/test/chunking-form/samples/deprecated/emit-chunk-worklet/_expected/system/chunks/worklet.js deleted file mode 100644 index 88e721d4520..00000000000 --- a/test/chunking-form/samples/deprecated/emit-chunk-worklet/_expected/system/chunks/worklet.js +++ /dev/null @@ -1,27 +0,0 @@ -System.register(['./shared.js'], (function () { - 'use strict'; - var size, color; - return { - setters: [function (module) { - size = module.s; - color = module.c; - }], - execute: (function () { - - registerPaint( - 'vertical-lines', - class { - paint(ctx, geom) { - for (let x = 0; x < geom.width / size; x++) { - ctx.beginPath(); - ctx.fillStyle = color; - ctx.rect(x * size, 0, 2, geom.height); - ctx.fill(); - } - } - } - ); - - }) - }; -})); diff --git a/test/chunking-form/samples/deprecated/emit-chunk-worklet/_expected/system/main.js b/test/chunking-form/samples/deprecated/emit-chunk-worklet/_expected/system/main.js deleted file mode 100644 index 69c57ed6000..00000000000 --- a/test/chunking-form/samples/deprecated/emit-chunk-worklet/_expected/system/main.js +++ /dev/null @@ -1,17 +0,0 @@ -System.register(['./chunks/shared.js'], (function (exports, module) { - 'use strict'; - var color, size; - return { - setters: [function (module) { - color = module.c; - size = module.s; - }], - execute: (function () { - - CSS.paintWorklet.addModule(new URL('chunks/worklet.js', module.meta.url).href); - - document.body.innerHTML += `

color: ${color}, size: ${size}

`; - - }) - }; -})); diff --git a/test/chunking-form/samples/deprecated/emit-chunk-worklet/index-es.html b/test/chunking-form/samples/deprecated/emit-chunk-worklet/index-es.html deleted file mode 100644 index d458b71c059..00000000000 --- a/test/chunking-form/samples/deprecated/emit-chunk-worklet/index-es.html +++ /dev/null @@ -1,10 +0,0 @@ - - - - - ES - - - - - diff --git a/test/chunking-form/samples/deprecated/emit-chunk-worklet/main.js b/test/chunking-form/samples/deprecated/emit-chunk-worklet/main.js deleted file mode 100644 index 60bad6751e8..00000000000 --- a/test/chunking-form/samples/deprecated/emit-chunk-worklet/main.js +++ /dev/null @@ -1,4 +0,0 @@ -import 'register-paint-worklet:./worklet.js'; -import { color, size } from './shared'; - -document.body.innerHTML += `

color: ${color}, size: ${size}

`; diff --git a/test/chunking-form/samples/deprecated/emit-chunk-worklet/shared.js b/test/chunking-form/samples/deprecated/emit-chunk-worklet/shared.js deleted file mode 100644 index 5a94b80cdd8..00000000000 --- a/test/chunking-form/samples/deprecated/emit-chunk-worklet/shared.js +++ /dev/null @@ -1,2 +0,0 @@ -export const color = 'greenyellow'; -export const size = 6; diff --git a/test/chunking-form/samples/deprecated/emit-chunk-worklet/worklet.js b/test/chunking-form/samples/deprecated/emit-chunk-worklet/worklet.js deleted file mode 100644 index 2274b010e02..00000000000 --- a/test/chunking-form/samples/deprecated/emit-chunk-worklet/worklet.js +++ /dev/null @@ -1,15 +0,0 @@ -import { color, size } from './shared'; - -registerPaint( - 'vertical-lines', - class { - paint(ctx, geom) { - for (let x = 0; x < geom.width / size; x++) { - ctx.beginPath(); - ctx.fillStyle = color; - ctx.rect(x * size, 0, 2, geom.height); - ctx.fill(); - } - } - } -); diff --git a/test/chunking-form/samples/deprecated/emit-chunk/_config.js b/test/chunking-form/samples/deprecated/emit-chunk/_config.js deleted file mode 100644 index f99cdb68e91..00000000000 --- a/test/chunking-form/samples/deprecated/emit-chunk/_config.js +++ /dev/null @@ -1,19 +0,0 @@ -const assert = require('assert'); -let referenceId; - -module.exports = { - description: 'allows adding additional chunks and retrieving their file name', - expectedWarnings: ['DEPRECATED_FEATURE'], - options: { - strictDeprecations: false, - input: 'main', - plugins: { - buildStart() { - referenceId = this.emitChunk('buildStart'); - }, - renderChunk() { - assert.strictEqual(this.getChunkFileName(referenceId), 'generated-buildStart.js'); - } - } - } -}; diff --git a/test/chunking-form/samples/deprecated/emit-chunk/_expected/amd/generated-buildStart.js b/test/chunking-form/samples/deprecated/emit-chunk/_expected/amd/generated-buildStart.js deleted file mode 100644 index 041249b1410..00000000000 --- a/test/chunking-form/samples/deprecated/emit-chunk/_expected/amd/generated-buildStart.js +++ /dev/null @@ -1,5 +0,0 @@ -define(['./generated-dep'], (function (dep) { 'use strict'; - - console.log('startBuild', dep.value); - -})); diff --git a/test/chunking-form/samples/deprecated/emit-chunk/_expected/amd/generated-dep.js b/test/chunking-form/samples/deprecated/emit-chunk/_expected/amd/generated-dep.js deleted file mode 100644 index d041b1d05f7..00000000000 --- a/test/chunking-form/samples/deprecated/emit-chunk/_expected/amd/generated-dep.js +++ /dev/null @@ -1,7 +0,0 @@ -define(['exports'], (function (exports) { 'use strict'; - - var value = 42; - - exports.value = value; - -})); diff --git a/test/chunking-form/samples/deprecated/emit-chunk/_expected/amd/main.js b/test/chunking-form/samples/deprecated/emit-chunk/_expected/amd/main.js deleted file mode 100644 index 9e566362545..00000000000 --- a/test/chunking-form/samples/deprecated/emit-chunk/_expected/amd/main.js +++ /dev/null @@ -1,5 +0,0 @@ -define(['./generated-dep'], (function (dep) { 'use strict'; - - console.log('main', dep.value); - -})); diff --git a/test/chunking-form/samples/deprecated/emit-chunk/_expected/cjs/generated-buildStart.js b/test/chunking-form/samples/deprecated/emit-chunk/_expected/cjs/generated-buildStart.js deleted file mode 100644 index cfa8c788f1d..00000000000 --- a/test/chunking-form/samples/deprecated/emit-chunk/_expected/cjs/generated-buildStart.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -var dep = require('./generated-dep.js'); - -console.log('startBuild', dep.value); diff --git a/test/chunking-form/samples/deprecated/emit-chunk/_expected/cjs/generated-dep.js b/test/chunking-form/samples/deprecated/emit-chunk/_expected/cjs/generated-dep.js deleted file mode 100644 index 6cec42c9a07..00000000000 --- a/test/chunking-form/samples/deprecated/emit-chunk/_expected/cjs/generated-dep.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -var value = 42; - -exports.value = value; diff --git a/test/chunking-form/samples/deprecated/emit-chunk/_expected/cjs/main.js b/test/chunking-form/samples/deprecated/emit-chunk/_expected/cjs/main.js deleted file mode 100644 index 4c79b32a701..00000000000 --- a/test/chunking-form/samples/deprecated/emit-chunk/_expected/cjs/main.js +++ /dev/null @@ -1,5 +0,0 @@ -'use strict'; - -var dep = require('./generated-dep.js'); - -console.log('main', dep.value); diff --git a/test/chunking-form/samples/deprecated/emit-chunk/_expected/es/generated-buildStart.js b/test/chunking-form/samples/deprecated/emit-chunk/_expected/es/generated-buildStart.js deleted file mode 100644 index fbe237d2ce7..00000000000 --- a/test/chunking-form/samples/deprecated/emit-chunk/_expected/es/generated-buildStart.js +++ /dev/null @@ -1,3 +0,0 @@ -import { v as value } from './generated-dep.js'; - -console.log('startBuild', value); diff --git a/test/chunking-form/samples/deprecated/emit-chunk/_expected/es/generated-dep.js b/test/chunking-form/samples/deprecated/emit-chunk/_expected/es/generated-dep.js deleted file mode 100644 index b7cbe038a73..00000000000 --- a/test/chunking-form/samples/deprecated/emit-chunk/_expected/es/generated-dep.js +++ /dev/null @@ -1,3 +0,0 @@ -var value = 42; - -export { value as v }; diff --git a/test/chunking-form/samples/deprecated/emit-chunk/_expected/es/main.js b/test/chunking-form/samples/deprecated/emit-chunk/_expected/es/main.js deleted file mode 100644 index da4e855f39a..00000000000 --- a/test/chunking-form/samples/deprecated/emit-chunk/_expected/es/main.js +++ /dev/null @@ -1,3 +0,0 @@ -import { v as value } from './generated-dep.js'; - -console.log('main', value); diff --git a/test/chunking-form/samples/deprecated/emit-chunk/_expected/system/generated-buildStart.js b/test/chunking-form/samples/deprecated/emit-chunk/_expected/system/generated-buildStart.js deleted file mode 100644 index 12a2c642f50..00000000000 --- a/test/chunking-form/samples/deprecated/emit-chunk/_expected/system/generated-buildStart.js +++ /dev/null @@ -1,14 +0,0 @@ -System.register(['./generated-dep.js'], (function () { - 'use strict'; - var value; - return { - setters: [function (module) { - value = module.v; - }], - execute: (function () { - - console.log('startBuild', value); - - }) - }; -})); diff --git a/test/chunking-form/samples/deprecated/emit-chunk/_expected/system/generated-dep.js b/test/chunking-form/samples/deprecated/emit-chunk/_expected/system/generated-dep.js deleted file mode 100644 index eb5993a958a..00000000000 --- a/test/chunking-form/samples/deprecated/emit-chunk/_expected/system/generated-dep.js +++ /dev/null @@ -1,10 +0,0 @@ -System.register([], (function (exports) { - 'use strict'; - return { - execute: (function () { - - var value = exports('v', 42); - - }) - }; -})); diff --git a/test/chunking-form/samples/deprecated/emit-chunk/_expected/system/main.js b/test/chunking-form/samples/deprecated/emit-chunk/_expected/system/main.js deleted file mode 100644 index 39150aad0de..00000000000 --- a/test/chunking-form/samples/deprecated/emit-chunk/_expected/system/main.js +++ /dev/null @@ -1,14 +0,0 @@ -System.register(['./generated-dep.js'], (function () { - 'use strict'; - var value; - return { - setters: [function (module) { - value = module.v; - }], - execute: (function () { - - console.log('main', value); - - }) - }; -})); diff --git a/test/chunking-form/samples/deprecated/emit-chunk/buildStart.js b/test/chunking-form/samples/deprecated/emit-chunk/buildStart.js deleted file mode 100644 index f9b1b414da5..00000000000 --- a/test/chunking-form/samples/deprecated/emit-chunk/buildStart.js +++ /dev/null @@ -1,3 +0,0 @@ -import value from './dep.js'; - -console.log('startBuild', value); diff --git a/test/chunking-form/samples/deprecated/emit-chunk/dep.js b/test/chunking-form/samples/deprecated/emit-chunk/dep.js deleted file mode 100644 index 7a4e8a723a4..00000000000 --- a/test/chunking-form/samples/deprecated/emit-chunk/dep.js +++ /dev/null @@ -1 +0,0 @@ -export default 42; diff --git a/test/chunking-form/samples/deprecated/emit-chunk/main.js b/test/chunking-form/samples/deprecated/emit-chunk/main.js deleted file mode 100644 index 4a9b3a3f405..00000000000 --- a/test/chunking-form/samples/deprecated/emit-chunk/main.js +++ /dev/null @@ -1,3 +0,0 @@ -import value from './dep.js'; - -console.log('main', value); diff --git a/test/chunking-form/samples/deprecated/emit-file-chunk-facade/_config.js b/test/chunking-form/samples/deprecated/emit-file-chunk-facade/_config.js index eb5d67acdb8..8c708fc512e 100644 --- a/test/chunking-form/samples/deprecated/emit-file-chunk-facade/_config.js +++ b/test/chunking-form/samples/deprecated/emit-file-chunk-facade/_config.js @@ -17,5 +17,6 @@ module.exports = { assert.strictEqual(this.getFileName(referenceId), 'generated-buildStart.js'); } } - } + }, + expectedWarnings: ['DEPRECATED_FEATURE'] }; diff --git a/test/chunking-form/samples/deprecated/empty-module-no-treeshake/_config.js b/test/chunking-form/samples/deprecated/empty-module-no-treeshake/_config.js index 182023bccc3..2723c89060b 100644 --- a/test/chunking-form/samples/deprecated/empty-module-no-treeshake/_config.js +++ b/test/chunking-form/samples/deprecated/empty-module-no-treeshake/_config.js @@ -64,5 +64,6 @@ module.exports = { ); } } - } + }, + expectedWarnings: ['DEPRECATED_FEATURE'] }; diff --git a/test/chunking-form/samples/deprecated/indirect-reexports-preserve-modules/_config.js b/test/chunking-form/samples/deprecated/indirect-reexports-preserve-modules/_config.js index be01fb9f36e..41677d57da1 100644 --- a/test/chunking-form/samples/deprecated/indirect-reexports-preserve-modules/_config.js +++ b/test/chunking-form/samples/deprecated/indirect-reexports-preserve-modules/_config.js @@ -1,6 +1,6 @@ module.exports = { description: 'does not drop indirect reexports when preserving modules', - expectedWarnings: ['MIXED_EXPORTS'], + expectedWarnings: ['MIXED_EXPORTS', 'DEPRECATED_FEATURE'], options: { strictDeprecations: false, output: { name: 'bundle' }, diff --git a/test/chunking-form/samples/deprecated/interop-per-reexported-default-dependency-boolean/_config.js b/test/chunking-form/samples/deprecated/interop-per-reexported-default-dependency-boolean/_config.js index 4c6d5748f22..a6459df9326 100644 --- a/test/chunking-form/samples/deprecated/interop-per-reexported-default-dependency-boolean/_config.js +++ b/test/chunking-form/samples/deprecated/interop-per-reexported-default-dependency-boolean/_config.js @@ -10,5 +10,6 @@ module.exports = { return JSON.parse(id.split('-')[1]); } } - } + }, + expectedWarnings: ['DEPRECATED_FEATURE'] }; diff --git a/test/chunking-form/samples/deprecated/manual-chunk-avoid-facade/_config.js b/test/chunking-form/samples/deprecated/manual-chunk-avoid-facade/_config.js index cdbcbdedf88..f0d81228885 100644 --- a/test/chunking-form/samples/deprecated/manual-chunk-avoid-facade/_config.js +++ b/test/chunking-form/samples/deprecated/manual-chunk-avoid-facade/_config.js @@ -6,5 +6,6 @@ module.exports = { manualChunks: { manual: ['main2'] } - } + }, + expectedWarnings: ['DEPRECATED_FEATURE'] }; diff --git a/test/chunking-form/samples/deprecated/manual-chunk-contains-entry-conflict/_config.js b/test/chunking-form/samples/deprecated/manual-chunk-contains-entry-conflict/_config.js index eddc0b545b7..2a955ff0af5 100644 --- a/test/chunking-form/samples/deprecated/manual-chunk-contains-entry-conflict/_config.js +++ b/test/chunking-form/samples/deprecated/manual-chunk-contains-entry-conflict/_config.js @@ -9,5 +9,6 @@ module.exports = { manualChunks: { outer: ['outer'] } - } + }, + expectedWarnings: ['DEPRECATED_FEATURE'] }; diff --git a/test/chunking-form/samples/deprecated/manual-chunk-contains-entry-match/_config.js b/test/chunking-form/samples/deprecated/manual-chunk-contains-entry-match/_config.js index 0265957b69b..5b1b3bd7d42 100644 --- a/test/chunking-form/samples/deprecated/manual-chunk-contains-entry-match/_config.js +++ b/test/chunking-form/samples/deprecated/manual-chunk-contains-entry-match/_config.js @@ -9,5 +9,6 @@ module.exports = { manualChunks: { main: ['outer'] } - } + }, + expectedWarnings: ['DEPRECATED_FEATURE'] }; diff --git a/test/chunking-form/samples/deprecated/manual-chunk-is-entry-conflict/_config.js b/test/chunking-form/samples/deprecated/manual-chunk-is-entry-conflict/_config.js index e30afc125c2..d43369b5207 100644 --- a/test/chunking-form/samples/deprecated/manual-chunk-is-entry-conflict/_config.js +++ b/test/chunking-form/samples/deprecated/manual-chunk-is-entry-conflict/_config.js @@ -9,5 +9,6 @@ module.exports = { manualChunks: { other: ['main'] } - } + }, + expectedWarnings: ['DEPRECATED_FEATURE'] }; diff --git a/test/chunking-form/samples/deprecated/manual-chunk-is-entry-match/_config.js b/test/chunking-form/samples/deprecated/manual-chunk-is-entry-match/_config.js index 3207916f4f1..7a8a9aa09d6 100644 --- a/test/chunking-form/samples/deprecated/manual-chunk-is-entry-match/_config.js +++ b/test/chunking-form/samples/deprecated/manual-chunk-is-entry-match/_config.js @@ -9,5 +9,6 @@ module.exports = { manualChunks: { main: ['main'] } - } + }, + expectedWarnings: ['DEPRECATED_FEATURE'] }; diff --git a/test/chunking-form/samples/deprecated/manual-chunks-different-nested/_config.js b/test/chunking-form/samples/deprecated/manual-chunks-different-nested/_config.js index 9f46a40f134..97bdd7c68aa 100644 --- a/test/chunking-form/samples/deprecated/manual-chunks-different-nested/_config.js +++ b/test/chunking-form/samples/deprecated/manual-chunks-different-nested/_config.js @@ -8,5 +8,6 @@ module.exports = { 'manual-inner': ['inner.js'], 'manual-middle': ['middle.js'] } - } + }, + expectedWarnings: ['DEPRECATED_FEATURE'] }; diff --git a/test/chunking-form/samples/deprecated/manual-chunks-dynamic-facades/_config.js b/test/chunking-form/samples/deprecated/manual-chunks-dynamic-facades/_config.js index 9666b5675d5..957df0be4f3 100644 --- a/test/chunking-form/samples/deprecated/manual-chunks-dynamic-facades/_config.js +++ b/test/chunking-form/samples/deprecated/manual-chunks-dynamic-facades/_config.js @@ -6,5 +6,6 @@ module.exports = { manualChunks: { dynamic: ['dynamic1.js'] } - } + }, + expectedWarnings: ['DEPRECATED_FEATURE'] }; diff --git a/test/chunking-form/samples/deprecated/manual-chunks-dynamic-name-conflict/_config.js b/test/chunking-form/samples/deprecated/manual-chunks-dynamic-name-conflict/_config.js index 28725aa0585..c7344810ced 100644 --- a/test/chunking-form/samples/deprecated/manual-chunks-dynamic-name-conflict/_config.js +++ b/test/chunking-form/samples/deprecated/manual-chunks-dynamic-name-conflict/_config.js @@ -6,5 +6,6 @@ module.exports = { manualChunks: { dynamic: ['dynamic1.js'] } - } + }, + expectedWarnings: ['DEPRECATED_FEATURE'] }; diff --git a/test/chunking-form/samples/deprecated/manual-chunks-dynamic/_config.js b/test/chunking-form/samples/deprecated/manual-chunks-dynamic/_config.js index cfb06c43a96..cdf062d322f 100644 --- a/test/chunking-form/samples/deprecated/manual-chunks-dynamic/_config.js +++ b/test/chunking-form/samples/deprecated/manual-chunks-dynamic/_config.js @@ -6,5 +6,6 @@ module.exports = { manualChunks: { dynamic: ['dynamic.js'] } - } + }, + expectedWarnings: ['DEPRECATED_FEATURE'] }; diff --git a/test/chunking-form/samples/deprecated/manual-chunks-function/_config.js b/test/chunking-form/samples/deprecated/manual-chunks-function/_config.js index 5b225fe7552..ab8ca176201 100644 --- a/test/chunking-form/samples/deprecated/manual-chunks-function/_config.js +++ b/test/chunking-form/samples/deprecated/manual-chunks-function/_config.js @@ -8,5 +8,6 @@ module.exports = { return `chunk-${id[id.length - 4]}`; } } - } + }, + expectedWarnings: ['DEPRECATED_FEATURE'] }; diff --git a/test/chunking-form/samples/deprecated/manual-chunks-nested/_config.js b/test/chunking-form/samples/deprecated/manual-chunks-nested/_config.js index 20ea0b64d16..29e3d7d3db0 100644 --- a/test/chunking-form/samples/deprecated/manual-chunks-nested/_config.js +++ b/test/chunking-form/samples/deprecated/manual-chunks-nested/_config.js @@ -6,5 +6,6 @@ module.exports = { manualChunks: { manual: ['middle.js', 'inner.js', 'outer.js'] } - } + }, + expectedWarnings: ['DEPRECATED_FEATURE'] }; diff --git a/test/chunking-form/samples/deprecated/manual-chunks/_config.js b/test/chunking-form/samples/deprecated/manual-chunks/_config.js index 626186e9b89..bfe73d1c721 100644 --- a/test/chunking-form/samples/deprecated/manual-chunks/_config.js +++ b/test/chunking-form/samples/deprecated/manual-chunks/_config.js @@ -7,5 +7,6 @@ module.exports = { lib1: ['lib1.js'], deps2and3: ['dep2.js', 'dep3.js'] } - } + }, + expectedWarnings: ['DEPRECATED_FEATURE'] }; diff --git a/test/chunking-form/samples/deprecated/missing-export-reused-deconflicting/_config.js b/test/chunking-form/samples/deprecated/missing-export-reused-deconflicting/_config.js index 23bb4b220e9..ccf4f87d8d0 100644 --- a/test/chunking-form/samples/deprecated/missing-export-reused-deconflicting/_config.js +++ b/test/chunking-form/samples/deprecated/missing-export-reused-deconflicting/_config.js @@ -1,6 +1,6 @@ module.exports = { description: 'handles using dependencies with shimmed missing exports as ', - expectedWarnings: ['SHIMMED_EXPORT'], + expectedWarnings: ['SHIMMED_EXPORT', 'DEPRECATED_FEATURE'], options: { strictDeprecations: false, input: ['main.js'], diff --git a/test/chunking-form/samples/deprecated/namespace-tostring/dynamic-import-default-mode/_config.js b/test/chunking-form/samples/deprecated/namespace-tostring/dynamic-import-default-mode/_config.js index 722554bf7df..793d274dd1e 100644 --- a/test/chunking-form/samples/deprecated/namespace-tostring/dynamic-import-default-mode/_config.js +++ b/test/chunking-form/samples/deprecated/namespace-tostring/dynamic-import-default-mode/_config.js @@ -7,5 +7,6 @@ module.exports = { output: { namespaceToStringTag: true } - } + }, + expectedWarnings: ['DEPRECATED_FEATURE'] }; diff --git a/test/chunking-form/samples/deprecated/namespace-tostring/dynamic-import/_config.js b/test/chunking-form/samples/deprecated/namespace-tostring/dynamic-import/_config.js index d0d5ce8e03a..6c668f2287e 100644 --- a/test/chunking-form/samples/deprecated/namespace-tostring/dynamic-import/_config.js +++ b/test/chunking-form/samples/deprecated/namespace-tostring/dynamic-import/_config.js @@ -5,5 +5,6 @@ module.exports = { output: { namespaceToStringTag: true } - } + }, + expectedWarnings: ['DEPRECATED_FEATURE'] }; diff --git a/test/chunking-form/samples/deprecated/preserve-modules-auto-export-mode/_config.js b/test/chunking-form/samples/deprecated/preserve-modules-auto-export-mode/_config.js index 31219523c90..82c01d0483c 100644 --- a/test/chunking-form/samples/deprecated/preserve-modules-auto-export-mode/_config.js +++ b/test/chunking-form/samples/deprecated/preserve-modules-auto-export-mode/_config.js @@ -4,5 +4,6 @@ module.exports = { strictDeprecations: false, input: 'main.js', preserveModules: true - } + }, + expectedWarnings: ['DEPRECATED_FEATURE'] }; diff --git a/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_config.js b/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_config.js index 21593c6541f..d0a5ee29834 100644 --- a/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_config.js +++ b/test/chunking-form/samples/deprecated/preserve-modules-commonjs/_config.js @@ -2,7 +2,7 @@ const commonjs = require('@rollup/plugin-commonjs'); module.exports = { description: 'Handles output from @rollup/plugin-commonjs', - expectedWarnings: ['MIXED_EXPORTS'], + expectedWarnings: ['MIXED_EXPORTS', 'DEPRECATED_FEATURE'], options: { strictDeprecations: false, input: 'main.js', diff --git a/test/chunking-form/samples/deprecated/preserve-modules-dynamic-imports/_config.js b/test/chunking-form/samples/deprecated/preserve-modules-dynamic-imports/_config.js index 3ed23338db8..9d22f1265be 100644 --- a/test/chunking-form/samples/deprecated/preserve-modules-dynamic-imports/_config.js +++ b/test/chunking-form/samples/deprecated/preserve-modules-dynamic-imports/_config.js @@ -4,5 +4,6 @@ module.exports = { strictDeprecations: false, input: ['main.js'], preserveModules: true - } + }, + expectedWarnings: ['DEPRECATED_FEATURE'] }; diff --git a/test/chunking-form/samples/deprecated/preserve-modules-dynamic-namespace/_config.js b/test/chunking-form/samples/deprecated/preserve-modules-dynamic-namespace/_config.js index c5483693708..7ee5f88593a 100644 --- a/test/chunking-form/samples/deprecated/preserve-modules-dynamic-namespace/_config.js +++ b/test/chunking-form/samples/deprecated/preserve-modules-dynamic-namespace/_config.js @@ -4,5 +4,6 @@ module.exports = { strictDeprecations: false, input: ['main.js'], preserveModules: true - } + }, + expectedWarnings: ['DEPRECATED_FEATURE'] }; diff --git a/test/chunking-form/samples/deprecated/preserve-modules-empty/_config.js b/test/chunking-form/samples/deprecated/preserve-modules-empty/_config.js index 820e4c3cf04..af98a0768a3 100644 --- a/test/chunking-form/samples/deprecated/preserve-modules-empty/_config.js +++ b/test/chunking-form/samples/deprecated/preserve-modules-empty/_config.js @@ -4,5 +4,6 @@ module.exports = { strictDeprecations: false, input: 'main.js', preserveModules: true - } + }, + expectedWarnings: ['DEPRECATED_FEATURE'] }; diff --git a/test/chunking-form/samples/deprecated/preserve-modules-export-alias/_config.js b/test/chunking-form/samples/deprecated/preserve-modules-export-alias/_config.js index 9ca75e06f00..de49b787e78 100644 --- a/test/chunking-form/samples/deprecated/preserve-modules-export-alias/_config.js +++ b/test/chunking-form/samples/deprecated/preserve-modules-export-alias/_config.js @@ -4,5 +4,6 @@ module.exports = { strictDeprecations: false, input: ['main1.js', 'main2.js'], preserveModules: true - } + }, + expectedWarnings: ['DEPRECATED_FEATURE'] }; diff --git a/test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/_config.js b/test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/_config.js index fd9c3b9b431..d4f28578cf8 100644 --- a/test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/_config.js +++ b/test/chunking-form/samples/deprecated/preserve-modules-filename-pattern/_config.js @@ -7,5 +7,6 @@ module.exports = { entryFileNames: 'entry-[name]-[format]-[ext][extname].js' }, preserveModules: true - } + }, + expectedWarnings: ['DEPRECATED_FEATURE'] }; diff --git a/test/chunking-form/samples/deprecated/preserve-modules-id-case-sensitive/_config.js b/test/chunking-form/samples/deprecated/preserve-modules-id-case-sensitive/_config.js index 6ffd681d55c..4e94da5c1ff 100644 --- a/test/chunking-form/samples/deprecated/preserve-modules-id-case-sensitive/_config.js +++ b/test/chunking-form/samples/deprecated/preserve-modules-id-case-sensitive/_config.js @@ -18,5 +18,6 @@ module.exports = { } } ] - } + }, + expectedWarnings: ['DEPRECATED_FEATURE'] }; diff --git a/test/chunking-form/samples/deprecated/preserve-modules-named-export-mode/_config.js b/test/chunking-form/samples/deprecated/preserve-modules-named-export-mode/_config.js index b79256cfb0b..9a4318fbc5d 100644 --- a/test/chunking-form/samples/deprecated/preserve-modules-named-export-mode/_config.js +++ b/test/chunking-form/samples/deprecated/preserve-modules-named-export-mode/_config.js @@ -7,5 +7,6 @@ module.exports = { output: { exports: 'named' } - } + }, + expectedWarnings: ['DEPRECATED_FEATURE'] }; diff --git a/test/chunking-form/samples/deprecated/preserve-modules-nested-barrel-es-export/_config.js b/test/chunking-form/samples/deprecated/preserve-modules-nested-barrel-es-export/_config.js index 22ec30f4ec3..130b08f42dd 100644 --- a/test/chunking-form/samples/deprecated/preserve-modules-nested-barrel-es-export/_config.js +++ b/test/chunking-form/samples/deprecated/preserve-modules-nested-barrel-es-export/_config.js @@ -4,5 +4,6 @@ module.exports = { strictDeprecations: false, input: 'main.js', preserveModules: true - } + }, + expectedWarnings: ['DEPRECATED_FEATURE'] }; diff --git a/test/chunking-form/samples/deprecated/preserve-modules-nested-export/_config.js b/test/chunking-form/samples/deprecated/preserve-modules-nested-export/_config.js index 291753db080..3f39126a643 100644 --- a/test/chunking-form/samples/deprecated/preserve-modules-nested-export/_config.js +++ b/test/chunking-form/samples/deprecated/preserve-modules-nested-export/_config.js @@ -4,5 +4,6 @@ module.exports = { strictDeprecations: false, input: 'main.js', preserveModules: true - } + }, + expectedWarnings: ['DEPRECATED_FEATURE'] }; diff --git a/test/chunking-form/samples/deprecated/preserve-modules-non-entry-imports/_config.js b/test/chunking-form/samples/deprecated/preserve-modules-non-entry-imports/_config.js index 157659436ee..9a74ad23ea9 100644 --- a/test/chunking-form/samples/deprecated/preserve-modules-non-entry-imports/_config.js +++ b/test/chunking-form/samples/deprecated/preserve-modules-non-entry-imports/_config.js @@ -4,5 +4,6 @@ module.exports = { strictDeprecations: false, input: 'main.js', preserveModules: true - } + }, + expectedWarnings: ['DEPRECATED_FEATURE'] }; diff --git a/test/chunking-form/samples/deprecated/preserve-modules-proxy-import/_config.js b/test/chunking-form/samples/deprecated/preserve-modules-proxy-import/_config.js index 19e53c11fe1..277a0d24c49 100644 --- a/test/chunking-form/samples/deprecated/preserve-modules-proxy-import/_config.js +++ b/test/chunking-form/samples/deprecated/preserve-modules-proxy-import/_config.js @@ -5,5 +5,6 @@ module.exports = { strictDeprecations: false, preserveModules: true, external: 'external' - } + }, + expectedWarnings: ['DEPRECATED_FEATURE'] }; diff --git a/test/chunking-form/samples/deprecated/preserve-modules-reaching-outside/_config.js b/test/chunking-form/samples/deprecated/preserve-modules-reaching-outside/_config.js index e71eaf513aa..0d5c9eb2e76 100644 --- a/test/chunking-form/samples/deprecated/preserve-modules-reaching-outside/_config.js +++ b/test/chunking-form/samples/deprecated/preserve-modules-reaching-outside/_config.js @@ -4,5 +4,6 @@ module.exports = { strictDeprecations: false, input: 'src/lib/main.js', preserveModules: true - } + }, + expectedWarnings: ['DEPRECATED_FEATURE'] }; diff --git a/test/chunking-form/samples/deprecated/preserve-modules-scriptified-assets/_config.js b/test/chunking-form/samples/deprecated/preserve-modules-scriptified-assets/_config.js index c79966da224..16d00e5298c 100644 --- a/test/chunking-form/samples/deprecated/preserve-modules-scriptified-assets/_config.js +++ b/test/chunking-form/samples/deprecated/preserve-modules-scriptified-assets/_config.js @@ -23,5 +23,6 @@ module.exports = { } } ] - } + }, + expectedWarnings: ['DEPRECATED_FEATURE'] }; diff --git a/test/chunking-form/samples/deprecated/preserve-modules-single-entry/_config.js b/test/chunking-form/samples/deprecated/preserve-modules-single-entry/_config.js index 2c68b2aa9fc..4f9cbcbea6d 100644 --- a/test/chunking-form/samples/deprecated/preserve-modules-single-entry/_config.js +++ b/test/chunking-form/samples/deprecated/preserve-modules-single-entry/_config.js @@ -4,5 +4,6 @@ module.exports = { strictDeprecations: false, input: 'main.js', preserveModules: true - } + }, + expectedWarnings: ['DEPRECATED_FEATURE'] }; diff --git a/test/chunking-form/samples/deprecated/preserve-modules-virtual-modules/_config.js b/test/chunking-form/samples/deprecated/preserve-modules-virtual-modules/_config.js index f9785b99872..163da380583 100644 --- a/test/chunking-form/samples/deprecated/preserve-modules-virtual-modules/_config.js +++ b/test/chunking-form/samples/deprecated/preserve-modules-virtual-modules/_config.js @@ -19,5 +19,6 @@ module.exports = { } } ] - } + }, + expectedWarnings: ['DEPRECATED_FEATURE'] }; diff --git a/test/chunking-form/samples/deprecated/preserve-modules/_config.js b/test/chunking-form/samples/deprecated/preserve-modules/_config.js index fb89b5a641c..77705540676 100644 --- a/test/chunking-form/samples/deprecated/preserve-modules/_config.js +++ b/test/chunking-form/samples/deprecated/preserve-modules/_config.js @@ -4,5 +4,6 @@ module.exports = { strictDeprecations: false, input: ['main1.js', 'main2.js'], preserveModules: true - } + }, + expectedWarnings: ['DEPRECATED_FEATURE'] }; diff --git a/test/form/samples/deprecated/configure-asset-url/_config.js b/test/form/samples/deprecated/configure-asset-url/_config.js deleted file mode 100644 index 56f8d0d0398..00000000000 --- a/test/form/samples/deprecated/configure-asset-url/_config.js +++ /dev/null @@ -1,40 +0,0 @@ -module.exports = { - description: 'allows to configure asset urls', - expectedWarnings: ['DEPRECATED_FEATURE'], - options: { - strictDeprecations: false, - plugins: [ - { - resolveId(id) { - if (id.endsWith('solved')) { - return id; - } - }, - load(id) { - if (id.endsWith('solved')) { - const assetId = this.emitAsset(`asset-${id}.txt`, `Asset for: ${id}`); - return `export default import.meta.ROLLUP_ASSET_URL_${assetId};`; - } - }, - resolveAssetUrl({ chunkId, moduleId, assetFileName, relativeAssetPath }) { - if (!moduleId.endsWith('resolved')) { - return `'${chunkId}:${moduleId - .replace(/\\/g, '/') - .split('/') - .slice(-2) - .join('/')}:${assetFileName}:${relativeAssetPath}'`; - } - return null; - } - }, - { - resolveAssetUrl({ moduleId }) { - if (moduleId === 'resolved') { - return `'resolved'`; - } - return null; - } - } - ] - } -}; diff --git a/test/form/samples/deprecated/configure-asset-url/_expected/amd.js b/test/form/samples/deprecated/configure-asset-url/_expected/amd.js deleted file mode 100644 index 8c55f93c121..00000000000 --- a/test/form/samples/deprecated/configure-asset-url/_expected/amd.js +++ /dev/null @@ -1,11 +0,0 @@ -define(['require'], (function (require) { 'use strict'; - - var asset1 = 'amd.js:solved:assets/asset-solved-28a7ac89.txt:assets/asset-solved-28a7ac89.txt'; - - var asset2 = 'resolved'; - - var asset3 = new URL(require.toUrl('./assets/asset-unresolved-8dcd7fca.txt'), document.baseURI).href; - - console.log(asset1, asset2, asset3); - -})); diff --git a/test/form/samples/deprecated/configure-asset-url/_expected/assets/asset-resolved-8bd22e6e.txt b/test/form/samples/deprecated/configure-asset-url/_expected/assets/asset-resolved-8bd22e6e.txt deleted file mode 100644 index 31fb300f988..00000000000 --- a/test/form/samples/deprecated/configure-asset-url/_expected/assets/asset-resolved-8bd22e6e.txt +++ /dev/null @@ -1 +0,0 @@ -Asset for: resolved \ No newline at end of file diff --git a/test/form/samples/deprecated/configure-asset-url/_expected/assets/asset-solved-28a7ac89.txt b/test/form/samples/deprecated/configure-asset-url/_expected/assets/asset-solved-28a7ac89.txt deleted file mode 100644 index 07c7a096c7e..00000000000 --- a/test/form/samples/deprecated/configure-asset-url/_expected/assets/asset-solved-28a7ac89.txt +++ /dev/null @@ -1 +0,0 @@ -Asset for: solved \ No newline at end of file diff --git a/test/form/samples/deprecated/configure-asset-url/_expected/assets/asset-unresolved-8dcd7fca.txt b/test/form/samples/deprecated/configure-asset-url/_expected/assets/asset-unresolved-8dcd7fca.txt deleted file mode 100644 index fd3ad6261cc..00000000000 --- a/test/form/samples/deprecated/configure-asset-url/_expected/assets/asset-unresolved-8dcd7fca.txt +++ /dev/null @@ -1 +0,0 @@ -Asset for: unresolved \ No newline at end of file diff --git a/test/form/samples/deprecated/configure-asset-url/_expected/cjs.js b/test/form/samples/deprecated/configure-asset-url/_expected/cjs.js deleted file mode 100644 index bdd515403db..00000000000 --- a/test/form/samples/deprecated/configure-asset-url/_expected/cjs.js +++ /dev/null @@ -1,9 +0,0 @@ -'use strict'; - -var asset1 = 'cjs.js:solved:assets/asset-solved-28a7ac89.txt:assets/asset-solved-28a7ac89.txt'; - -var asset2 = 'resolved'; - -var asset3 = (typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __dirname + '/assets/asset-unresolved-8dcd7fca.txt').href : new URL('assets/asset-unresolved-8dcd7fca.txt', document.currentScript && document.currentScript.src || document.baseURI).href); - -console.log(asset1, asset2, asset3); diff --git a/test/form/samples/deprecated/configure-asset-url/_expected/es.js b/test/form/samples/deprecated/configure-asset-url/_expected/es.js deleted file mode 100644 index 35ee8b1dee0..00000000000 --- a/test/form/samples/deprecated/configure-asset-url/_expected/es.js +++ /dev/null @@ -1,7 +0,0 @@ -var asset1 = 'es.js:solved:assets/asset-solved-28a7ac89.txt:assets/asset-solved-28a7ac89.txt'; - -var asset2 = 'resolved'; - -var asset3 = new URL('assets/asset-unresolved-8dcd7fca.txt', import.meta.url).href; - -console.log(asset1, asset2, asset3); diff --git a/test/form/samples/deprecated/configure-asset-url/_expected/iife.js b/test/form/samples/deprecated/configure-asset-url/_expected/iife.js deleted file mode 100644 index 0913d592075..00000000000 --- a/test/form/samples/deprecated/configure-asset-url/_expected/iife.js +++ /dev/null @@ -1,12 +0,0 @@ -(function () { - 'use strict'; - - var asset1 = 'iife.js:solved:assets/asset-solved-28a7ac89.txt:assets/asset-solved-28a7ac89.txt'; - - var asset2 = 'resolved'; - - var asset3 = new URL('assets/asset-unresolved-8dcd7fca.txt', document.currentScript && document.currentScript.src || document.baseURI).href; - - console.log(asset1, asset2, asset3); - -})(); diff --git a/test/form/samples/deprecated/configure-asset-url/_expected/system.js b/test/form/samples/deprecated/configure-asset-url/_expected/system.js deleted file mode 100644 index 1bb20735a17..00000000000 --- a/test/form/samples/deprecated/configure-asset-url/_expected/system.js +++ /dev/null @@ -1,16 +0,0 @@ -System.register([], (function (exports, module) { - 'use strict'; - return { - execute: (function () { - - var asset1 = 'system.js:solved:assets/asset-solved-28a7ac89.txt:assets/asset-solved-28a7ac89.txt'; - - var asset2 = 'resolved'; - - var asset3 = new URL('assets/asset-unresolved-8dcd7fca.txt', module.meta.url).href; - - console.log(asset1, asset2, asset3); - - }) - }; -})); diff --git a/test/form/samples/deprecated/configure-asset-url/_expected/umd.js b/test/form/samples/deprecated/configure-asset-url/_expected/umd.js deleted file mode 100644 index 8ef0ba5ba6d..00000000000 --- a/test/form/samples/deprecated/configure-asset-url/_expected/umd.js +++ /dev/null @@ -1,14 +0,0 @@ -(function (factory) { - typeof define === 'function' && define.amd ? define(factory) : - factory(); -})((function () { 'use strict'; - - var asset1 = 'umd.js:solved:assets/asset-solved-28a7ac89.txt:assets/asset-solved-28a7ac89.txt'; - - var asset2 = 'resolved'; - - var asset3 = (typeof document === 'undefined' && typeof location === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __dirname + '/assets/asset-unresolved-8dcd7fca.txt').href : new URL('assets/asset-unresolved-8dcd7fca.txt', typeof document === 'undefined' ? location.href : document.currentScript && document.currentScript.src || document.baseURI).href); - - console.log(asset1, asset2, asset3); - -})); diff --git a/test/form/samples/deprecated/configure-asset-url/main.js b/test/form/samples/deprecated/configure-asset-url/main.js deleted file mode 100644 index 74a56461e3a..00000000000 --- a/test/form/samples/deprecated/configure-asset-url/main.js +++ /dev/null @@ -1,5 +0,0 @@ -import asset1 from 'solved'; -import asset2 from 'resolved'; -import asset3 from 'unresolved'; - -console.log(asset1, asset2, asset3); diff --git a/test/form/samples/deprecated/dynamic-import-inlining-array/_config.js b/test/form/samples/deprecated/dynamic-import-inlining-array/_config.js index 5f4382d6a8b..8b750ef3779 100644 --- a/test/form/samples/deprecated/dynamic-import-inlining-array/_config.js +++ b/test/form/samples/deprecated/dynamic-import-inlining-array/_config.js @@ -4,5 +4,6 @@ module.exports = { strictDeprecations: false, inlineDynamicImports: true, input: ['main'] - } + }, + expectedWarnings: ['DEPRECATED_FEATURE'] }; diff --git a/test/form/samples/deprecated/dynamic-import-inlining/_config.js b/test/form/samples/deprecated/dynamic-import-inlining/_config.js index 42be3fab8a0..5534cc63a4d 100644 --- a/test/form/samples/deprecated/dynamic-import-inlining/_config.js +++ b/test/form/samples/deprecated/dynamic-import-inlining/_config.js @@ -3,5 +3,6 @@ module.exports = { options: { strictDeprecations: false, inlineDynamicImports: true - } + }, + expectedWarnings: ['DEPRECATED_FEATURE'] }; diff --git a/test/form/samples/deprecated/emit-asset-hacky/_config.js b/test/form/samples/deprecated/emit-asset-hacky/_config.js deleted file mode 100644 index 15b90c920a6..00000000000 --- a/test/form/samples/deprecated/emit-asset-hacky/_config.js +++ /dev/null @@ -1,17 +0,0 @@ -module.exports = { - description: 'supports emitting assets in a hacky way by editing the bundle object', - expectedWarnings: ['DEPRECATED_FEATURE'], - options: { - strictDeprecations: false, - plugins: { - generateBundle(options, outputBundle) { - const file = { - fileName: 'my-hacky-asset.txt', - isAsset: true, - source: 'My Hacky Source' - }; - outputBundle[file.fileName] = file; - } - } - } -}; diff --git a/test/form/samples/deprecated/emit-asset-hacky/_expected/amd.js b/test/form/samples/deprecated/emit-asset-hacky/_expected/amd.js deleted file mode 100644 index 49540b44d78..00000000000 --- a/test/form/samples/deprecated/emit-asset-hacky/_expected/amd.js +++ /dev/null @@ -1,5 +0,0 @@ -define((function () { 'use strict'; - - console.log('main'); - -})); diff --git a/test/form/samples/deprecated/emit-asset-hacky/_expected/cjs.js b/test/form/samples/deprecated/emit-asset-hacky/_expected/cjs.js deleted file mode 100644 index d0ed06d8c90..00000000000 --- a/test/form/samples/deprecated/emit-asset-hacky/_expected/cjs.js +++ /dev/null @@ -1,3 +0,0 @@ -'use strict'; - -console.log('main'); diff --git a/test/form/samples/deprecated/emit-asset-hacky/_expected/es.js b/test/form/samples/deprecated/emit-asset-hacky/_expected/es.js deleted file mode 100644 index c0b933d7b56..00000000000 --- a/test/form/samples/deprecated/emit-asset-hacky/_expected/es.js +++ /dev/null @@ -1 +0,0 @@ -console.log('main'); diff --git a/test/form/samples/deprecated/emit-asset-hacky/_expected/iife.js b/test/form/samples/deprecated/emit-asset-hacky/_expected/iife.js deleted file mode 100644 index 455edee6aa6..00000000000 --- a/test/form/samples/deprecated/emit-asset-hacky/_expected/iife.js +++ /dev/null @@ -1,6 +0,0 @@ -(function () { - 'use strict'; - - console.log('main'); - -})(); diff --git a/test/form/samples/deprecated/emit-asset-hacky/_expected/my-hacky-asset.txt b/test/form/samples/deprecated/emit-asset-hacky/_expected/my-hacky-asset.txt deleted file mode 100644 index 61db1bb6537..00000000000 --- a/test/form/samples/deprecated/emit-asset-hacky/_expected/my-hacky-asset.txt +++ /dev/null @@ -1 +0,0 @@ -My Hacky Source \ No newline at end of file diff --git a/test/form/samples/deprecated/emit-asset-hacky/_expected/system.js b/test/form/samples/deprecated/emit-asset-hacky/_expected/system.js deleted file mode 100644 index 35e2693371a..00000000000 --- a/test/form/samples/deprecated/emit-asset-hacky/_expected/system.js +++ /dev/null @@ -1,10 +0,0 @@ -System.register([], (function () { - 'use strict'; - return { - execute: (function () { - - console.log('main'); - - }) - }; -})); diff --git a/test/form/samples/deprecated/emit-asset-hacky/_expected/umd.js b/test/form/samples/deprecated/emit-asset-hacky/_expected/umd.js deleted file mode 100644 index c8ba7daa897..00000000000 --- a/test/form/samples/deprecated/emit-asset-hacky/_expected/umd.js +++ /dev/null @@ -1,8 +0,0 @@ -(function (factory) { - typeof define === 'function' && define.amd ? define(factory) : - factory(); -})((function () { 'use strict'; - - console.log('main'); - -})); diff --git a/test/form/samples/deprecated/emit-asset-hacky/main.js b/test/form/samples/deprecated/emit-asset-hacky/main.js deleted file mode 100644 index c0b933d7b56..00000000000 --- a/test/form/samples/deprecated/emit-asset-hacky/main.js +++ /dev/null @@ -1 +0,0 @@ -console.log('main'); diff --git a/test/form/samples/deprecated/emit-asset/_config.js b/test/form/samples/deprecated/emit-asset/_config.js deleted file mode 100644 index f7930b32270..00000000000 --- a/test/form/samples/deprecated/emit-asset/_config.js +++ /dev/null @@ -1,40 +0,0 @@ -const assert = require('assert'); -const { readFileSync } = require('fs'); -const path = require('path'); - -module.exports = { - description: 'supports emitting assets from plugin hooks', - expectedWarnings: ['DEPRECATED_FEATURE'], - options: { - strictDeprecations: false, - plugins: { - resolveId(id, importee) { - if (id.endsWith('.svg')) { - return path.resolve(path.dirname(importee), id); - } - }, - load(id) { - if (id.endsWith('.svg')) { - return `export default import.meta.ROLLUP_ASSET_URL_${this.emitAsset( - path.basename(id), - readFileSync(id) - )};`; - } - }, - generateBundle(options, outputBundle) { - const keys = Object.keys(outputBundle); - assert.strictEqual(keys.length, 2); - assert.strictEqual(keys[0], 'assets/logo-25585ac1.svg'); - const asset = outputBundle[keys[0]]; - assert.strictEqual(asset.fileName, 'assets/logo-25585ac1.svg'); - assert.strictEqual(asset.isAsset, true); - assert.strictEqual(asset.type, 'asset'); - assert.ok( - asset.source.equals(readFileSync(path.resolve(__dirname, 'logo.svg'))), - 'asset has correct source' - ); - assert.ok(keys[1].endsWith('.js'), `${keys[1]} ends with ".js"`); - } - } - } -}; diff --git a/test/form/samples/deprecated/emit-asset/_expected/amd.js b/test/form/samples/deprecated/emit-asset/_expected/amd.js deleted file mode 100644 index 0120fbb5f1c..00000000000 --- a/test/form/samples/deprecated/emit-asset/_expected/amd.js +++ /dev/null @@ -1,16 +0,0 @@ -define(['require'], (function (require) { 'use strict'; - - var logo = new URL(require.toUrl('./assets/logo-25585ac1.svg'), document.baseURI).href; - - function showImage(url) { - console.log(url); - if (typeof document !== 'undefined') { - const image = document.createElement('img'); - image.src = url; - document.body.appendChild(image); - } - } - - showImage(logo); - -})); diff --git a/test/form/samples/deprecated/emit-asset/_expected/assets/logo-25585ac1.svg b/test/form/samples/deprecated/emit-asset/_expected/assets/logo-25585ac1.svg deleted file mode 100644 index 20bb5dfe639..00000000000 --- a/test/form/samples/deprecated/emit-asset/_expected/assets/logo-25585ac1.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - \ No newline at end of file diff --git a/test/form/samples/deprecated/emit-asset/_expected/cjs.js b/test/form/samples/deprecated/emit-asset/_expected/cjs.js deleted file mode 100644 index f9a9dac3e1e..00000000000 --- a/test/form/samples/deprecated/emit-asset/_expected/cjs.js +++ /dev/null @@ -1,14 +0,0 @@ -'use strict'; - -var logo = (typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __dirname + '/assets/logo-25585ac1.svg').href : new URL('assets/logo-25585ac1.svg', document.currentScript && document.currentScript.src || document.baseURI).href); - -function showImage(url) { - console.log(url); - if (typeof document !== 'undefined') { - const image = document.createElement('img'); - image.src = url; - document.body.appendChild(image); - } -} - -showImage(logo); diff --git a/test/form/samples/deprecated/emit-asset/_expected/es.js b/test/form/samples/deprecated/emit-asset/_expected/es.js deleted file mode 100644 index d100d42e367..00000000000 --- a/test/form/samples/deprecated/emit-asset/_expected/es.js +++ /dev/null @@ -1,12 +0,0 @@ -var logo = new URL('assets/logo-25585ac1.svg', import.meta.url).href; - -function showImage(url) { - console.log(url); - if (typeof document !== 'undefined') { - const image = document.createElement('img'); - image.src = url; - document.body.appendChild(image); - } -} - -showImage(logo); diff --git a/test/form/samples/deprecated/emit-asset/_expected/iife.js b/test/form/samples/deprecated/emit-asset/_expected/iife.js deleted file mode 100644 index 881dc9e042f..00000000000 --- a/test/form/samples/deprecated/emit-asset/_expected/iife.js +++ /dev/null @@ -1,17 +0,0 @@ -(function () { - 'use strict'; - - var logo = new URL('assets/logo-25585ac1.svg', document.currentScript && document.currentScript.src || document.baseURI).href; - - function showImage(url) { - console.log(url); - if (typeof document !== 'undefined') { - const image = document.createElement('img'); - image.src = url; - document.body.appendChild(image); - } - } - - showImage(logo); - -})(); diff --git a/test/form/samples/deprecated/emit-asset/_expected/system.js b/test/form/samples/deprecated/emit-asset/_expected/system.js deleted file mode 100644 index cbef4b76bfd..00000000000 --- a/test/form/samples/deprecated/emit-asset/_expected/system.js +++ /dev/null @@ -1,21 +0,0 @@ -System.register([], (function (exports, module) { - 'use strict'; - return { - execute: (function () { - - var logo = new URL('assets/logo-25585ac1.svg', module.meta.url).href; - - function showImage(url) { - console.log(url); - if (typeof document !== 'undefined') { - const image = document.createElement('img'); - image.src = url; - document.body.appendChild(image); - } - } - - showImage(logo); - - }) - }; -})); diff --git a/test/form/samples/deprecated/emit-asset/_expected/umd.js b/test/form/samples/deprecated/emit-asset/_expected/umd.js deleted file mode 100644 index b37ed465b1a..00000000000 --- a/test/form/samples/deprecated/emit-asset/_expected/umd.js +++ /dev/null @@ -1,19 +0,0 @@ -(function (factory) { - typeof define === 'function' && define.amd ? define(factory) : - factory(); -})((function () { 'use strict'; - - var logo = (typeof document === 'undefined' && typeof location === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __dirname + '/assets/logo-25585ac1.svg').href : new URL('assets/logo-25585ac1.svg', typeof document === 'undefined' ? location.href : document.currentScript && document.currentScript.src || document.baseURI).href); - - function showImage(url) { - console.log(url); - if (typeof document !== 'undefined') { - const image = document.createElement('img'); - image.src = url; - document.body.appendChild(image); - } - } - - showImage(logo); - -})); diff --git a/test/form/samples/deprecated/emit-asset/index-amd.html b/test/form/samples/deprecated/emit-asset/index-amd.html deleted file mode 100644 index 14c7c2fa4ac..00000000000 --- a/test/form/samples/deprecated/emit-asset/index-amd.html +++ /dev/null @@ -1,10 +0,0 @@ - - - - - AMD - - - - - diff --git a/test/form/samples/deprecated/emit-asset/index-cjs.html b/test/form/samples/deprecated/emit-asset/index-cjs.html deleted file mode 100644 index c5b18ec148f..00000000000 --- a/test/form/samples/deprecated/emit-asset/index-cjs.html +++ /dev/null @@ -1,10 +0,0 @@ - - - - - CommonJS - - - - - diff --git a/test/form/samples/deprecated/emit-asset/index-es.html b/test/form/samples/deprecated/emit-asset/index-es.html deleted file mode 100644 index 5079fce53d8..00000000000 --- a/test/form/samples/deprecated/emit-asset/index-es.html +++ /dev/null @@ -1,10 +0,0 @@ - - - - - ES Module - - - - - diff --git a/test/form/samples/deprecated/emit-asset/index-iife.html b/test/form/samples/deprecated/emit-asset/index-iife.html deleted file mode 100644 index aaf475f1505..00000000000 --- a/test/form/samples/deprecated/emit-asset/index-iife.html +++ /dev/null @@ -1,10 +0,0 @@ - - - - - IIFE - - - - - diff --git a/test/form/samples/deprecated/emit-asset/index-system.html b/test/form/samples/deprecated/emit-asset/index-system.html deleted file mode 100644 index 750eabdba25..00000000000 --- a/test/form/samples/deprecated/emit-asset/index-system.html +++ /dev/null @@ -1,11 +0,0 @@ - - - - - SystemJS - - - - - - diff --git a/test/form/samples/deprecated/emit-asset/index-umd-amd.html b/test/form/samples/deprecated/emit-asset/index-umd-amd.html deleted file mode 100644 index e7c9217ece0..00000000000 --- a/test/form/samples/deprecated/emit-asset/index-umd-amd.html +++ /dev/null @@ -1,10 +0,0 @@ - - - - - UMD (AMD) - - - - - diff --git a/test/form/samples/deprecated/emit-asset/index-umd-iife-queryparam.html b/test/form/samples/deprecated/emit-asset/index-umd-iife-queryparam.html deleted file mode 100644 index fda3f3f6195..00000000000 --- a/test/form/samples/deprecated/emit-asset/index-umd-iife-queryparam.html +++ /dev/null @@ -1,10 +0,0 @@ - - - - - UMD (IIFE) + query parameter - - - - - diff --git a/test/form/samples/deprecated/emit-asset/index-umd-iife.html b/test/form/samples/deprecated/emit-asset/index-umd-iife.html deleted file mode 100644 index 202c1dad8f0..00000000000 --- a/test/form/samples/deprecated/emit-asset/index-umd-iife.html +++ /dev/null @@ -1,10 +0,0 @@ - - - - - UMD (IIFE) - - - - - diff --git a/test/form/samples/deprecated/emit-asset/logo.svg b/test/form/samples/deprecated/emit-asset/logo.svg deleted file mode 100644 index 20bb5dfe639..00000000000 --- a/test/form/samples/deprecated/emit-asset/logo.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - \ No newline at end of file diff --git a/test/form/samples/deprecated/emit-asset/main.js b/test/form/samples/deprecated/emit-asset/main.js deleted file mode 100644 index c63771af02d..00000000000 --- a/test/form/samples/deprecated/emit-asset/main.js +++ /dev/null @@ -1,12 +0,0 @@ -import logo from './logo.svg'; - -function showImage(url) { - console.log(url); - if (typeof document !== 'undefined') { - const image = document.createElement('img'); - image.src = url; - document.body.appendChild(image); - } -} - -showImage(logo); diff --git a/test/form/samples/deprecated/inlined-treeshaken-dynamic-import/_config.js b/test/form/samples/deprecated/inlined-treeshaken-dynamic-import/_config.js index 70a30536aa8..c985d42f87a 100644 --- a/test/form/samples/deprecated/inlined-treeshaken-dynamic-import/_config.js +++ b/test/form/samples/deprecated/inlined-treeshaken-dynamic-import/_config.js @@ -3,5 +3,6 @@ module.exports = { options: { strictDeprecations: false, inlineDynamicImports: true - } + }, + expectedWarnings: ['DEPRECATED_FEATURE'] }; diff --git a/test/form/samples/deprecated/interop-boolean-per-dependency/_config.js b/test/form/samples/deprecated/interop-boolean-per-dependency/_config.js index 9ac55a664fd..4dc5108a105 100644 --- a/test/form/samples/deprecated/interop-boolean-per-dependency/_config.js +++ b/test/form/samples/deprecated/interop-boolean-per-dependency/_config.js @@ -11,5 +11,6 @@ module.exports = { return id.replace('-', ''); } } - } + }, + expectedWarnings: ['DEPRECATED_FEATURE'] }; diff --git a/test/form/samples/deprecated/interop-boolean-per-reexported-dependency/_config.js b/test/form/samples/deprecated/interop-boolean-per-reexported-dependency/_config.js index 8cf9078d7ed..9c8e4000438 100644 --- a/test/form/samples/deprecated/interop-boolean-per-reexported-dependency/_config.js +++ b/test/form/samples/deprecated/interop-boolean-per-reexported-dependency/_config.js @@ -12,5 +12,6 @@ module.exports = { }, name: 'bundle' } - } + }, + expectedWarnings: ['DEPRECATED_FEATURE'] }; diff --git a/test/form/samples/deprecated/interop-false-reexport/_config.js b/test/form/samples/deprecated/interop-false-reexport/_config.js index 1505f8be29b..9d26b513865 100644 --- a/test/form/samples/deprecated/interop-false-reexport/_config.js +++ b/test/form/samples/deprecated/interop-false-reexport/_config.js @@ -8,5 +8,6 @@ module.exports = { name: 'foo', interop: false } - } + }, + expectedWarnings: ['DEPRECATED_FEATURE'] }; diff --git a/test/form/samples/deprecated/interop-false/_config.js b/test/form/samples/deprecated/interop-false/_config.js index 29fb546c761..883a0a2211d 100644 --- a/test/form/samples/deprecated/interop-false/_config.js +++ b/test/form/samples/deprecated/interop-false/_config.js @@ -1,6 +1,6 @@ module.exports = { description: 'getInterop with interop: false', - expectedWarnings: ['UNUSED_EXTERNAL_IMPORT'], + expectedWarnings: ['UNUSED_EXTERNAL_IMPORT', 'DEPRECATED_FEATURE'], options: { strictDeprecations: false, external: ['core/view'], diff --git a/test/form/samples/deprecated/interop-per-dependency-no-live-binding-boolean/_config.js b/test/form/samples/deprecated/interop-per-dependency-no-live-binding-boolean/_config.js index 40e9c43350b..8a30d5398ae 100644 --- a/test/form/samples/deprecated/interop-per-dependency-no-live-binding-boolean/_config.js +++ b/test/form/samples/deprecated/interop-per-dependency-no-live-binding-boolean/_config.js @@ -16,5 +16,6 @@ module.exports = { }, format: 'cjs' } - } + }, + expectedWarnings: ['DEPRECATED_FEATURE'] }; diff --git a/test/form/samples/deprecated/namespace-tostring/entry-default/_config.js b/test/form/samples/deprecated/namespace-tostring/entry-default/_config.js index afe69c097a0..75a69ab246d 100644 --- a/test/form/samples/deprecated/namespace-tostring/entry-default/_config.js +++ b/test/form/samples/deprecated/namespace-tostring/entry-default/_config.js @@ -7,5 +7,6 @@ module.exports = { exports: 'default', name: 'bundle' } - } + }, + expectedWarnings: ['DEPRECATED_FEATURE'] }; diff --git a/test/form/samples/deprecated/namespace-tostring/entry-named/_config.js b/test/form/samples/deprecated/namespace-tostring/entry-named/_config.js index 04c66f0ed4e..dd684cbd4a7 100644 --- a/test/form/samples/deprecated/namespace-tostring/entry-named/_config.js +++ b/test/form/samples/deprecated/namespace-tostring/entry-named/_config.js @@ -7,5 +7,6 @@ module.exports = { exports: 'named', name: 'bundle' } - } + }, + expectedWarnings: ['DEPRECATED_FEATURE'] }; diff --git a/test/form/samples/deprecated/namespace-tostring/external-namespaces/_config.js b/test/form/samples/deprecated/namespace-tostring/external-namespaces/_config.js index 4505660889c..eb328e09d5e 100644 --- a/test/form/samples/deprecated/namespace-tostring/external-namespaces/_config.js +++ b/test/form/samples/deprecated/namespace-tostring/external-namespaces/_config.js @@ -25,5 +25,6 @@ module.exports = { } } } - } + }, + expectedWarnings: ['DEPRECATED_FEATURE'] }; diff --git a/test/form/samples/deprecated/namespace-tostring/inlined-namespace/_config.js b/test/form/samples/deprecated/namespace-tostring/inlined-namespace/_config.js index 70d5429e572..82bfcfb95aa 100644 --- a/test/form/samples/deprecated/namespace-tostring/inlined-namespace/_config.js +++ b/test/form/samples/deprecated/namespace-tostring/inlined-namespace/_config.js @@ -5,5 +5,6 @@ module.exports = { output: { namespaceToStringTag: true } - } + }, + expectedWarnings: ['DEPRECATED_FEATURE'] }; diff --git a/test/form/samples/deprecated/nested-inlined-dynamic-import/_config.js b/test/form/samples/deprecated/nested-inlined-dynamic-import/_config.js index b72d8e62afc..a6ac9c10407 100644 --- a/test/form/samples/deprecated/nested-inlined-dynamic-import/_config.js +++ b/test/form/samples/deprecated/nested-inlined-dynamic-import/_config.js @@ -3,5 +3,6 @@ module.exports = { options: { strictDeprecations: false, inlineDynamicImports: true - } + }, + expectedWarnings: ['DEPRECATED_FEATURE'] }; diff --git a/test/form/samples/deprecated/prefer-const/_config.js b/test/form/samples/deprecated/prefer-const/_config.js index 961c32e5343..e160c9f6e0c 100644 --- a/test/form/samples/deprecated/prefer-const/_config.js +++ b/test/form/samples/deprecated/prefer-const/_config.js @@ -8,5 +8,6 @@ module.exports = { name: 'myBundle', preferConst: true } - } + }, + expectedWarnings: ['DEPRECATED_FEATURE'] }; diff --git a/test/form/samples/deprecated/prune-pure-unused-import-array/_config.js b/test/form/samples/deprecated/prune-pure-unused-import-array/_config.js deleted file mode 100644 index 6dd4090563a..00000000000 --- a/test/form/samples/deprecated/prune-pure-unused-import-array/_config.js +++ /dev/null @@ -1,12 +0,0 @@ -module.exports = { - description: 'prunes pure unused external imports ([#1352])', - expectedWarnings: ['DEPRECATED_FEATURE'], - options: { - strictDeprecations: false, - external: ['external', 'other'], - treeshake: { pureExternalModules: ['external'] }, - output: { - globals: { other: 'other' } - } - } -}; diff --git a/test/form/samples/deprecated/prune-pure-unused-import-array/_expected/amd.js b/test/form/samples/deprecated/prune-pure-unused-import-array/_expected/amd.js deleted file mode 100644 index 1115d7e625a..00000000000 --- a/test/form/samples/deprecated/prune-pure-unused-import-array/_expected/amd.js +++ /dev/null @@ -1,5 +0,0 @@ -define(['other'], (function (other) { 'use strict'; - - - -})); diff --git a/test/form/samples/deprecated/prune-pure-unused-import-array/_expected/cjs.js b/test/form/samples/deprecated/prune-pure-unused-import-array/_expected/cjs.js deleted file mode 100644 index d4c04157586..00000000000 --- a/test/form/samples/deprecated/prune-pure-unused-import-array/_expected/cjs.js +++ /dev/null @@ -1,4 +0,0 @@ -'use strict'; - -require('other'); - diff --git a/test/form/samples/deprecated/prune-pure-unused-import-array/_expected/es.js b/test/form/samples/deprecated/prune-pure-unused-import-array/_expected/es.js deleted file mode 100644 index 4c6a1dd1289..00000000000 --- a/test/form/samples/deprecated/prune-pure-unused-import-array/_expected/es.js +++ /dev/null @@ -1 +0,0 @@ -import 'other'; diff --git a/test/form/samples/deprecated/prune-pure-unused-import-array/_expected/iife.js b/test/form/samples/deprecated/prune-pure-unused-import-array/_expected/iife.js deleted file mode 100644 index 31dfeb95ed9..00000000000 --- a/test/form/samples/deprecated/prune-pure-unused-import-array/_expected/iife.js +++ /dev/null @@ -1,6 +0,0 @@ -(function () { - 'use strict'; - - - -})(); diff --git a/test/form/samples/deprecated/prune-pure-unused-import-array/_expected/system.js b/test/form/samples/deprecated/prune-pure-unused-import-array/_expected/system.js deleted file mode 100644 index b8460796681..00000000000 --- a/test/form/samples/deprecated/prune-pure-unused-import-array/_expected/system.js +++ /dev/null @@ -1,11 +0,0 @@ -System.register(['other'], (function () { - 'use strict'; - return { - setters: [function () {}], - execute: (function () { - - - - }) - }; -})); diff --git a/test/form/samples/deprecated/prune-pure-unused-import-array/_expected/umd.js b/test/form/samples/deprecated/prune-pure-unused-import-array/_expected/umd.js deleted file mode 100644 index f0ccb62ab6d..00000000000 --- a/test/form/samples/deprecated/prune-pure-unused-import-array/_expected/umd.js +++ /dev/null @@ -1,8 +0,0 @@ -(function (factory) { - typeof define === 'function' && define.amd ? define(['other'], factory) : - factory(); -})((function () { 'use strict'; - - - -})); diff --git a/test/form/samples/deprecated/prune-pure-unused-import-array/main.js b/test/form/samples/deprecated/prune-pure-unused-import-array/main.js deleted file mode 100644 index 558f459bd2a..00000000000 --- a/test/form/samples/deprecated/prune-pure-unused-import-array/main.js +++ /dev/null @@ -1,7 +0,0 @@ -import { unused } from 'external'; -import { notused } from 'other'; - -function alsoUnused () { - unused(); - notused(); -} diff --git a/test/form/samples/deprecated/prune-pure-unused-import-function/_config.js b/test/form/samples/deprecated/prune-pure-unused-import-function/_config.js deleted file mode 100644 index ca46cdf2ddd..00000000000 --- a/test/form/samples/deprecated/prune-pure-unused-import-function/_config.js +++ /dev/null @@ -1,12 +0,0 @@ -module.exports = { - description: 'prunes pure unused external imports ([#1352])', - expectedWarnings: ['DEPRECATED_FEATURE', 'EMPTY_BUNDLE'], - options: { - strictDeprecations: false, - external: ['external', 'other'], - treeshake: { pureExternalModules: id => id === 'external' }, - output: { - globals: { other: 'other' } - } - } -}; diff --git a/test/form/samples/deprecated/prune-pure-unused-import-function/_expected/amd.js b/test/form/samples/deprecated/prune-pure-unused-import-function/_expected/amd.js deleted file mode 100644 index 1115d7e625a..00000000000 --- a/test/form/samples/deprecated/prune-pure-unused-import-function/_expected/amd.js +++ /dev/null @@ -1,5 +0,0 @@ -define(['other'], (function (other) { 'use strict'; - - - -})); diff --git a/test/form/samples/deprecated/prune-pure-unused-import-function/_expected/cjs.js b/test/form/samples/deprecated/prune-pure-unused-import-function/_expected/cjs.js deleted file mode 100644 index d4c04157586..00000000000 --- a/test/form/samples/deprecated/prune-pure-unused-import-function/_expected/cjs.js +++ /dev/null @@ -1,4 +0,0 @@ -'use strict'; - -require('other'); - diff --git a/test/form/samples/deprecated/prune-pure-unused-import-function/_expected/es.js b/test/form/samples/deprecated/prune-pure-unused-import-function/_expected/es.js deleted file mode 100644 index 4c6a1dd1289..00000000000 --- a/test/form/samples/deprecated/prune-pure-unused-import-function/_expected/es.js +++ /dev/null @@ -1 +0,0 @@ -import 'other'; diff --git a/test/form/samples/deprecated/prune-pure-unused-import-function/_expected/iife.js b/test/form/samples/deprecated/prune-pure-unused-import-function/_expected/iife.js deleted file mode 100644 index 31dfeb95ed9..00000000000 --- a/test/form/samples/deprecated/prune-pure-unused-import-function/_expected/iife.js +++ /dev/null @@ -1,6 +0,0 @@ -(function () { - 'use strict'; - - - -})(); diff --git a/test/form/samples/deprecated/prune-pure-unused-import-function/_expected/system.js b/test/form/samples/deprecated/prune-pure-unused-import-function/_expected/system.js deleted file mode 100644 index b8460796681..00000000000 --- a/test/form/samples/deprecated/prune-pure-unused-import-function/_expected/system.js +++ /dev/null @@ -1,11 +0,0 @@ -System.register(['other'], (function () { - 'use strict'; - return { - setters: [function () {}], - execute: (function () { - - - - }) - }; -})); diff --git a/test/form/samples/deprecated/prune-pure-unused-import-function/_expected/umd.js b/test/form/samples/deprecated/prune-pure-unused-import-function/_expected/umd.js deleted file mode 100644 index f0ccb62ab6d..00000000000 --- a/test/form/samples/deprecated/prune-pure-unused-import-function/_expected/umd.js +++ /dev/null @@ -1,8 +0,0 @@ -(function (factory) { - typeof define === 'function' && define.amd ? define(['other'], factory) : - factory(); -})((function () { 'use strict'; - - - -})); diff --git a/test/form/samples/deprecated/prune-pure-unused-import-function/main.js b/test/form/samples/deprecated/prune-pure-unused-import-function/main.js deleted file mode 100644 index 558f459bd2a..00000000000 --- a/test/form/samples/deprecated/prune-pure-unused-import-function/main.js +++ /dev/null @@ -1,7 +0,0 @@ -import { unused } from 'external'; -import { notused } from 'other'; - -function alsoUnused () { - unused(); - notused(); -} diff --git a/test/form/samples/deprecated/prune-pure-unused-import/_config.js b/test/form/samples/deprecated/prune-pure-unused-import/_config.js deleted file mode 100644 index fe513326305..00000000000 --- a/test/form/samples/deprecated/prune-pure-unused-import/_config.js +++ /dev/null @@ -1,9 +0,0 @@ -module.exports = { - description: 'prunes pure unused external imports ([#1352])', - expectedWarnings: ['DEPRECATED_FEATURE', 'EMPTY_BUNDLE'], - options: { - strictDeprecations: false, - external: ['external', 'other'], - treeshake: { pureExternalModules: true } - } -}; diff --git a/test/form/samples/deprecated/prune-pure-unused-import/_expected/amd.js b/test/form/samples/deprecated/prune-pure-unused-import/_expected/amd.js deleted file mode 100644 index a9e9419e212..00000000000 --- a/test/form/samples/deprecated/prune-pure-unused-import/_expected/amd.js +++ /dev/null @@ -1,5 +0,0 @@ -define((function () { 'use strict'; - - - -})); diff --git a/test/form/samples/deprecated/prune-pure-unused-import/_expected/cjs.js b/test/form/samples/deprecated/prune-pure-unused-import/_expected/cjs.js deleted file mode 100644 index eb109abbed0..00000000000 --- a/test/form/samples/deprecated/prune-pure-unused-import/_expected/cjs.js +++ /dev/null @@ -1,2 +0,0 @@ -'use strict'; - diff --git a/test/form/samples/deprecated/prune-pure-unused-import/_expected/es.js b/test/form/samples/deprecated/prune-pure-unused-import/_expected/es.js deleted file mode 100644 index 8b137891791..00000000000 --- a/test/form/samples/deprecated/prune-pure-unused-import/_expected/es.js +++ /dev/null @@ -1 +0,0 @@ - diff --git a/test/form/samples/deprecated/prune-pure-unused-import/_expected/iife.js b/test/form/samples/deprecated/prune-pure-unused-import/_expected/iife.js deleted file mode 100644 index 31dfeb95ed9..00000000000 --- a/test/form/samples/deprecated/prune-pure-unused-import/_expected/iife.js +++ /dev/null @@ -1,6 +0,0 @@ -(function () { - 'use strict'; - - - -})(); diff --git a/test/form/samples/deprecated/prune-pure-unused-import/_expected/system.js b/test/form/samples/deprecated/prune-pure-unused-import/_expected/system.js deleted file mode 100644 index 343cc3a5100..00000000000 --- a/test/form/samples/deprecated/prune-pure-unused-import/_expected/system.js +++ /dev/null @@ -1,10 +0,0 @@ -System.register([], (function () { - 'use strict'; - return { - execute: (function () { - - - - }) - }; -})); diff --git a/test/form/samples/deprecated/prune-pure-unused-import/_expected/umd.js b/test/form/samples/deprecated/prune-pure-unused-import/_expected/umd.js deleted file mode 100644 index a39fba4f3da..00000000000 --- a/test/form/samples/deprecated/prune-pure-unused-import/_expected/umd.js +++ /dev/null @@ -1,8 +0,0 @@ -(function (factory) { - typeof define === 'function' && define.amd ? define(factory) : - factory(); -})((function () { 'use strict'; - - - -})); diff --git a/test/form/samples/deprecated/prune-pure-unused-import/main.js b/test/form/samples/deprecated/prune-pure-unused-import/main.js deleted file mode 100644 index ce3e0cb6298..00000000000 --- a/test/form/samples/deprecated/prune-pure-unused-import/main.js +++ /dev/null @@ -1,5 +0,0 @@ -import { unused } from 'external'; - -function alsoUnused () { - unused(); -} diff --git a/test/form/samples/generated-code-compact/arrow-functions-false/_config.js b/test/form/samples/generated-code-compact/arrow-functions-false/_config.js index ffecad616f0..20bea552d16 100644 --- a/test/form/samples/generated-code-compact/arrow-functions-false/_config.js +++ b/test/form/samples/generated-code-compact/arrow-functions-false/_config.js @@ -27,5 +27,6 @@ module.exports = { name: 'bundle', noConflict: true } - } + }, + expectedWarnings: ['DEPRECATED_FEATURE'] }; diff --git a/test/form/samples/generated-code-compact/arrow-functions-true/_config.js b/test/form/samples/generated-code-compact/arrow-functions-true/_config.js index f206f321594..732ebcf703c 100644 --- a/test/form/samples/generated-code-compact/arrow-functions-true/_config.js +++ b/test/form/samples/generated-code-compact/arrow-functions-true/_config.js @@ -27,5 +27,6 @@ module.exports = { name: 'bundle', noConflict: true } - } + }, + expectedWarnings: ['DEPRECATED_FEATURE'] }; diff --git a/test/form/samples/generated-code/arrow-functions-false/_config.js b/test/form/samples/generated-code/arrow-functions-false/_config.js index a3fbecbf803..5ffc687a54e 100644 --- a/test/form/samples/generated-code/arrow-functions-false/_config.js +++ b/test/form/samples/generated-code/arrow-functions-false/_config.js @@ -26,5 +26,6 @@ module.exports = { name: 'bundle', noConflict: true } - } + }, + expectedWarnings: ['DEPRECATED_FEATURE'] }; diff --git a/test/form/samples/generated-code/arrow-functions-true/_config.js b/test/form/samples/generated-code/arrow-functions-true/_config.js index 94e152b4307..82d6f99c5fe 100644 --- a/test/form/samples/generated-code/arrow-functions-true/_config.js +++ b/test/form/samples/generated-code/arrow-functions-true/_config.js @@ -26,5 +26,6 @@ module.exports = { name: 'bundle', noConflict: true } - } + }, + expectedWarnings: ['DEPRECATED_FEATURE'] }; diff --git a/test/function/samples/deprecated/compact/_config.js b/test/function/samples/deprecated/compact/_config.js index 30ce0c74921..08b0fa589f2 100644 --- a/test/function/samples/deprecated/compact/_config.js +++ b/test/function/samples/deprecated/compact/_config.js @@ -14,6 +14,11 @@ module.exports = { cycle: ['main.js', 'main.js'], importer: 'main.js', message: 'Circular dependency: main.js -> main.js' + }, + { + code: 'DEPRECATED_FEATURE', + message: + 'The "output.namespaceToStringTag" option is deprecated. Use the "output.generatedCode.symbols" option instead.' } ], context: { diff --git a/test/function/samples/deprecated/context-resolve-id/_config.js b/test/function/samples/deprecated/context-resolve-id/_config.js deleted file mode 100644 index e5ac08e41e1..00000000000 --- a/test/function/samples/deprecated/context-resolve-id/_config.js +++ /dev/null @@ -1,86 +0,0 @@ -const assert = require('assert'); -const path = require('path'); - -module.exports = { - description: 'correctly returns string or null for the context resolveId helper', - context: { - require(id) { - switch (id) { - case 'external-name': - return { value: 'external name' }; - case 'external-object': - return { value: 'external object' }; - case 'resolveto-unresolved': - return { value: 'unresolved' }; - default: - throw new Error(`Unexpected import ${id}`); - } - } - }, - warnings: [ - { - code: 'DEPRECATED_FEATURE', - message: - 'The "this.resolveId" plugin context function used by plugin at position 1 is deprecated. The "this.resolve" plugin context function should be used instead.', - plugin: 'at position 1' - }, - { - code: 'UNRESOLVED_IMPORT', - importer: 'main.js', - message: - "'resolveto-unresolved' is imported by main.js, but could not be resolved – treating it as an external dependency", - source: 'resolveto-unresolved', - url: 'https://rollupjs.org/guide/en/#warning-treating-module-as-external-dependency' - } - ], - options: { - strictDeprecations: false, - plugins: [ - { - resolveId(id, importer) { - if (id.startsWith('resolveto-')) { - const resolutionId = id.slice('resolveto-'.length); - return this.resolveId(resolutionId, importer).then(resolvedId => { - if (!resolvedId) { - assert.strictEqual(resolutionId, 'unresolved'); - assert.strictEqual(resolvedId, null); - } else { - if (typeof resolvedId !== 'string') { - throw new Error( - `Only valid resolveId return types are string and null, found ${typeof resolvedId} ${JSON.stringify( - resolvedId - )}` - ); - } - return { - id: resolvedId, - external: resolvedId.startsWith('external') - }; - } - }); - } - } - }, - { - resolveId(id) { - switch (id) { - case 'object': - return { - id: path.join(__dirname, 'existing-object.js'), - external: false - }; - case 'external-object': - return { - id: 'external-object', - external: true - }; - case 'name': - return path.join(__dirname, 'existing-name.js'); - case 'external-name': - return false; - } - } - } - ] - } -}; diff --git a/test/function/samples/deprecated/context-resolve-id/existing-name.js b/test/function/samples/deprecated/context-resolve-id/existing-name.js deleted file mode 100644 index d7aebd0e184..00000000000 --- a/test/function/samples/deprecated/context-resolve-id/existing-name.js +++ /dev/null @@ -1 +0,0 @@ -export const value = 'existing name'; diff --git a/test/function/samples/deprecated/context-resolve-id/existing-object.js b/test/function/samples/deprecated/context-resolve-id/existing-object.js deleted file mode 100644 index fb5c62510d0..00000000000 --- a/test/function/samples/deprecated/context-resolve-id/existing-object.js +++ /dev/null @@ -1 +0,0 @@ -export const value = 'existing object'; diff --git a/test/function/samples/deprecated/context-resolve-id/main.js b/test/function/samples/deprecated/context-resolve-id/main.js deleted file mode 100644 index 188a3921e2e..00000000000 --- a/test/function/samples/deprecated/context-resolve-id/main.js +++ /dev/null @@ -1,11 +0,0 @@ -import { value as name } from 'resolveto-name'; -import { value as externalName } from 'resolveto-external-name'; -import { value as object } from 'resolveto-object'; -import { value as externalObject } from 'resolveto-external-object'; -import { value as unresolved } from 'resolveto-unresolved'; - -assert.strictEqual(externalName, 'external name'); -assert.strictEqual(externalObject, 'external object'); -assert.strictEqual(name, 'existing name'); -assert.strictEqual(object, 'existing object'); -assert.strictEqual(unresolved, 'unresolved'); diff --git a/test/function/samples/deprecated/deconflicts-interop-boolean/_config.js b/test/function/samples/deprecated/deconflicts-interop-boolean/_config.js index 01fb5ca2888..fa488ae7c81 100644 --- a/test/function/samples/deprecated/deconflicts-interop-boolean/_config.js +++ b/test/function/samples/deprecated/deconflicts-interop-boolean/_config.js @@ -13,5 +13,13 @@ module.exports = { require: () => { return Object.defineProperty({ foo: 'foo', default: 'bar' }, '__esModule', { value: true }); } - } + }, + warnings: [ + { + code: 'DEPRECATED_FEATURE', + message: + 'The boolean value "true" for the "output.interop" option is deprecated. Use "auto" instead.', + url: 'https://rollupjs.org/guide/en/#outputinterop' + } + ] }; diff --git a/test/function/samples/deprecated/dynamic-import-duplicates/_config.js b/test/function/samples/deprecated/dynamic-import-duplicates/_config.js index c71c26f5b04..8fe7b79a4fd 100644 --- a/test/function/samples/deprecated/dynamic-import-duplicates/_config.js +++ b/test/function/samples/deprecated/dynamic-import-duplicates/_config.js @@ -11,5 +11,12 @@ module.exports = { return exports.promise.then(y => { assert.equal(y, 42); }); - } + }, + warnings: [ + { + code: 'DEPRECATED_FEATURE', + message: + 'The "inlineDynamicImports" option is deprecated. Use the "output.inlineDynamicImports" option instead.' + } + ] }; diff --git a/test/function/samples/deprecated/dynamic-import-inlining/_config.js b/test/function/samples/deprecated/dynamic-import-inlining/_config.js index c71c26f5b04..8fe7b79a4fd 100644 --- a/test/function/samples/deprecated/dynamic-import-inlining/_config.js +++ b/test/function/samples/deprecated/dynamic-import-inlining/_config.js @@ -11,5 +11,12 @@ module.exports = { return exports.promise.then(y => { assert.equal(y, 42); }); - } + }, + warnings: [ + { + code: 'DEPRECATED_FEATURE', + message: + 'The "inlineDynamicImports" option is deprecated. Use the "output.inlineDynamicImports" option instead.' + } + ] }; diff --git a/test/function/samples/deprecated/dynamic-import-name-warn/_config.js b/test/function/samples/deprecated/dynamic-import-name-warn/_config.js index c9b5c1ad736..29ec0a81284 100644 --- a/test/function/samples/deprecated/dynamic-import-name-warn/_config.js +++ b/test/function/samples/deprecated/dynamic-import-name-warn/_config.js @@ -27,6 +27,11 @@ module.exports = { ); }, warnings: [ + { + code: 'DEPRECATED_FEATURE', + message: + 'The "output.dynamicImportFunction" option is deprecated. Use the "renderDynamicImport" plugin hook instead.' + }, { code: 'INVALID_OPTION', message: diff --git a/test/function/samples/deprecated/dynamic-import-name/_config.js b/test/function/samples/deprecated/dynamic-import-name/_config.js index afb4f3ba114..c11b24b5e28 100644 --- a/test/function/samples/deprecated/dynamic-import-name/_config.js +++ b/test/function/samples/deprecated/dynamic-import-name/_config.js @@ -24,5 +24,12 @@ module.exports = { }, exports() { assert.ok(imported); - } + }, + warnings: [ + { + code: 'DEPRECATED_FEATURE', + message: + 'The "output.dynamicImportFunction" option is deprecated. Use the "renderDynamicImport" plugin hook instead.' + } + ] }; diff --git a/test/function/samples/deprecated/emit-asset/asset-source-missing-2/_config.js b/test/function/samples/deprecated/emit-asset/asset-source-missing-2/_config.js deleted file mode 100644 index 4b973d7d804..00000000000 --- a/test/function/samples/deprecated/emit-asset/asset-source-missing-2/_config.js +++ /dev/null @@ -1,17 +0,0 @@ -module.exports = { - description: 'throws when not setting the asset source and accessing the asset URL', - options: { - strictDeprecations: false, - plugins: { - name: 'test-plugin', - load() { - return `export default import.meta.ROLLUP_ASSET_URL_${this.emitAsset('test.ext')};`; - } - } - }, - generateError: { - code: 'ASSET_NOT_FINALISED', - message: - 'Plugin error - Unable to get file name for asset "test.ext". Ensure that the source is set and that generate is called first.' - } -}; diff --git a/test/function/samples/deprecated/emit-asset/asset-source-missing-2/main.js b/test/function/samples/deprecated/emit-asset/asset-source-missing-2/main.js deleted file mode 100644 index c4b940fc952..00000000000 --- a/test/function/samples/deprecated/emit-asset/asset-source-missing-2/main.js +++ /dev/null @@ -1 +0,0 @@ -throw new Error('should not build'); diff --git a/test/function/samples/deprecated/emit-asset/asset-source-missing-3/_config.js b/test/function/samples/deprecated/emit-asset/asset-source-missing-3/_config.js deleted file mode 100644 index 131b79c50c8..00000000000 --- a/test/function/samples/deprecated/emit-asset/asset-source-missing-3/_config.js +++ /dev/null @@ -1,21 +0,0 @@ -module.exports = { - description: 'throws when setting an empty asset source', - options: { - strictDeprecations: false, - plugins: { - name: 'test-plugin', - buildStart() { - const assetId = this.emitAsset('test.ext'); - this.setAssetSource(assetId, null); - } - } - }, - error: { - code: 'PLUGIN_ERROR', - hook: 'buildStart', - message: - 'Could not set source for asset "test.ext", asset source needs to be a string, Uint8Array or Buffer.', - plugin: 'test-plugin', - pluginCode: 'VALIDATION_ERROR' - } -}; diff --git a/test/function/samples/deprecated/emit-asset/asset-source-missing-3/main.js b/test/function/samples/deprecated/emit-asset/asset-source-missing-3/main.js deleted file mode 100644 index c4b940fc952..00000000000 --- a/test/function/samples/deprecated/emit-asset/asset-source-missing-3/main.js +++ /dev/null @@ -1 +0,0 @@ -throw new Error('should not build'); diff --git a/test/function/samples/deprecated/emit-asset/asset-source-missing/_config.js b/test/function/samples/deprecated/emit-asset/asset-source-missing/_config.js deleted file mode 100644 index 59b5946f927..00000000000 --- a/test/function/samples/deprecated/emit-asset/asset-source-missing/_config.js +++ /dev/null @@ -1,16 +0,0 @@ -module.exports = { - description: 'throws when not setting the asset source', - options: { - strictDeprecations: false, - plugins: { - name: 'test-plugin', - load() { - this.emitAsset('test.ext'); - } - } - }, - generateError: { - code: 'ASSET_SOURCE_MISSING', - message: 'Plugin error creating asset "test.ext" - no asset source set.' - } -}; diff --git a/test/function/samples/deprecated/emit-asset/asset-source-missing/main.js b/test/function/samples/deprecated/emit-asset/asset-source-missing/main.js deleted file mode 100644 index c4b940fc952..00000000000 --- a/test/function/samples/deprecated/emit-asset/asset-source-missing/main.js +++ /dev/null @@ -1 +0,0 @@ -throw new Error('should not build'); diff --git a/test/function/samples/deprecated/emit-asset/invalid-asset-id/_config.js b/test/function/samples/deprecated/emit-asset/invalid-asset-id/_config.js deleted file mode 100644 index 85f8e8fe64f..00000000000 --- a/test/function/samples/deprecated/emit-asset/invalid-asset-id/_config.js +++ /dev/null @@ -1,16 +0,0 @@ -module.exports = { - description: 'throws for invalid asset ids', - options: { - strictDeprecations: false, - plugins: { - name: 'test-plugin', - load() { - return `export default import.meta.ROLLUP_ASSET_URL_invalid;`; - } - } - }, - generateError: { - code: 'FILE_NOT_FOUND', - message: 'Plugin error - Unable to get file name for unknown file "invalid".' - } -}; diff --git a/test/function/samples/deprecated/emit-asset/invalid-asset-id/main.js b/test/function/samples/deprecated/emit-asset/invalid-asset-id/main.js deleted file mode 100644 index c4b940fc952..00000000000 --- a/test/function/samples/deprecated/emit-asset/invalid-asset-id/main.js +++ /dev/null @@ -1 +0,0 @@ -throw new Error('should not build'); diff --git a/test/function/samples/deprecated/emit-asset/invalid-asset-name/_config.js b/test/function/samples/deprecated/emit-asset/invalid-asset-name/_config.js deleted file mode 100644 index f807478d8f4..00000000000 --- a/test/function/samples/deprecated/emit-asset/invalid-asset-name/_config.js +++ /dev/null @@ -1,20 +0,0 @@ -module.exports = { - description: 'throws for invalid asset names', - options: { - strictDeprecations: false, - plugins: { - name: 'test-plugin', - buildStart() { - this.emitAsset('/test.ext', 'content'); - } - } - }, - error: { - code: 'PLUGIN_ERROR', - hook: 'buildStart', - message: - 'The "fileName" or "name" properties of emitted files must be strings that are neither absolute nor relative paths, received "/test.ext".', - plugin: 'test-plugin', - pluginCode: 'VALIDATION_ERROR' - } -}; diff --git a/test/function/samples/deprecated/emit-asset/invalid-asset-name/main.js b/test/function/samples/deprecated/emit-asset/invalid-asset-name/main.js deleted file mode 100644 index c4b940fc952..00000000000 --- a/test/function/samples/deprecated/emit-asset/invalid-asset-name/main.js +++ /dev/null @@ -1 +0,0 @@ -throw new Error('should not build'); diff --git a/test/function/samples/deprecated/emit-asset/invalid-set-asset-source-id/_config.js b/test/function/samples/deprecated/emit-asset/invalid-set-asset-source-id/_config.js deleted file mode 100644 index 1f536fd748d..00000000000 --- a/test/function/samples/deprecated/emit-asset/invalid-set-asset-source-id/_config.js +++ /dev/null @@ -1,19 +0,0 @@ -module.exports = { - description: 'throws for invalid asset ids', - options: { - strictDeprecations: false, - plugins: { - name: 'test-plugin', - buildStart() { - this.setAssetSource('invalid', 'content'); - } - } - }, - error: { - code: 'PLUGIN_ERROR', - hook: 'buildStart', - message: 'Plugin error - Unable to set the source for unknown asset "invalid".', - plugin: 'test-plugin', - pluginCode: 'ASSET_NOT_FOUND' - } -}; diff --git a/test/function/samples/deprecated/emit-asset/invalid-set-asset-source-id/main.js b/test/function/samples/deprecated/emit-asset/invalid-set-asset-source-id/main.js deleted file mode 100644 index c4b940fc952..00000000000 --- a/test/function/samples/deprecated/emit-asset/invalid-set-asset-source-id/main.js +++ /dev/null @@ -1 +0,0 @@ -throw new Error('should not build'); diff --git a/test/function/samples/deprecated/emit-asset/set-asset-source-transform/_config.js b/test/function/samples/deprecated/emit-asset/set-asset-source-transform/_config.js deleted file mode 100644 index a65b559c360..00000000000 --- a/test/function/samples/deprecated/emit-asset/set-asset-source-transform/_config.js +++ /dev/null @@ -1,26 +0,0 @@ -const path = require('path'); - -module.exports = { - description: 'throws when setting the asset source in the transform hook', - options: { - strictDeprecations: false, - plugins: { - name: 'test-plugin', - transform(code) { - const assetId = this.emitAsset('test.ext'); - this.setAssetSource(assetId, 'asdf'); - return code; - } - } - }, - error: { - code: 'PLUGIN_ERROR', - hook: 'transform', - id: path.join(__dirname, 'main.js'), - message: - 'setAssetSource cannot be called in transform for caching reasons. Use emitFile with a source, or call setAssetSource in another hook.', - plugin: 'test-plugin', - pluginCode: 'INVALID_SETASSETSOURCE', - watchFiles: [path.join(__dirname, 'main.js')] - } -}; diff --git a/test/function/samples/deprecated/emit-asset/set-asset-source-transform/main.js b/test/function/samples/deprecated/emit-asset/set-asset-source-transform/main.js deleted file mode 100644 index c4b940fc952..00000000000 --- a/test/function/samples/deprecated/emit-asset/set-asset-source-transform/main.js +++ /dev/null @@ -1 +0,0 @@ -throw new Error('should not build'); diff --git a/test/function/samples/deprecated/emit-asset/set-asset-source-twice/_config.js b/test/function/samples/deprecated/emit-asset/set-asset-source-twice/_config.js deleted file mode 100644 index 1f6d657d302..00000000000 --- a/test/function/samples/deprecated/emit-asset/set-asset-source-twice/_config.js +++ /dev/null @@ -1,21 +0,0 @@ -module.exports = { - description: 'throws when setting the asset source twice', - options: { - strictDeprecations: false, - plugins: { - name: 'test-plugin', - buildEnd() { - const assetId = this.emitAsset('test.ext'); - this.setAssetSource(assetId, 'hello world'); - this.setAssetSource(assetId, 'another'); - } - } - }, - error: { - code: 'PLUGIN_ERROR', - hook: 'buildEnd', - message: 'Unable to set the source for asset "test.ext", source already set.', - plugin: 'test-plugin', - pluginCode: 'ASSET_SOURCE_ALREADY_SET' - } -}; diff --git a/test/function/samples/deprecated/emit-asset/set-asset-source-twice/main.js b/test/function/samples/deprecated/emit-asset/set-asset-source-twice/main.js deleted file mode 100644 index c4b940fc952..00000000000 --- a/test/function/samples/deprecated/emit-asset/set-asset-source-twice/main.js +++ /dev/null @@ -1 +0,0 @@ -throw new Error('should not build'); diff --git a/test/function/samples/deprecated/emit-chunk/chunk-filename-not-available-render-start/_config.js b/test/function/samples/deprecated/emit-chunk/chunk-filename-not-available-render-start/_config.js deleted file mode 100644 index 42a48e679eb..00000000000 --- a/test/function/samples/deprecated/emit-chunk/chunk-filename-not-available-render-start/_config.js +++ /dev/null @@ -1,26 +0,0 @@ -let chunkId; - -module.exports = { - description: 'Throws when accessing the filename in renderStart', - options: { - strictDeprecations: false, - input: 'main.js', - plugins: { - name: 'test-plugin', - buildStart() { - chunkId = this.emitChunk('chunk.js'); - }, - renderStart() { - this.getChunkFileName(chunkId); - } - } - }, - generateError: { - code: 'PLUGIN_ERROR', - hook: 'renderStart', - message: - 'Plugin error - Unable to get file name for chunk "chunk.js". Ensure that generate is called first.', - plugin: 'test-plugin', - pluginCode: 'CHUNK_NOT_GENERATED' - } -}; diff --git a/test/function/samples/deprecated/emit-chunk/chunk-filename-not-available-render-start/chunk.js b/test/function/samples/deprecated/emit-chunk/chunk-filename-not-available-render-start/chunk.js deleted file mode 100644 index 36b1d61dd25..00000000000 --- a/test/function/samples/deprecated/emit-chunk/chunk-filename-not-available-render-start/chunk.js +++ /dev/null @@ -1 +0,0 @@ -console.log('chunk'); diff --git a/test/function/samples/deprecated/emit-chunk/chunk-filename-not-available-render-start/main.js b/test/function/samples/deprecated/emit-chunk/chunk-filename-not-available-render-start/main.js deleted file mode 100644 index c0b933d7b56..00000000000 --- a/test/function/samples/deprecated/emit-chunk/chunk-filename-not-available-render-start/main.js +++ /dev/null @@ -1 +0,0 @@ -console.log('main'); diff --git a/test/function/samples/deprecated/emit-chunk/chunk-filename-not-available/_config.js b/test/function/samples/deprecated/emit-chunk/chunk-filename-not-available/_config.js deleted file mode 100644 index 52a5ee32ae1..00000000000 --- a/test/function/samples/deprecated/emit-chunk/chunk-filename-not-available/_config.js +++ /dev/null @@ -1,22 +0,0 @@ -module.exports = { - description: 'Throws when accessing the filename before it has been generated', - options: { - strictDeprecations: false, - input: 'main.js', - plugins: { - name: 'test-plugin', - buildStart() { - const chunkId = this.emitChunk('chunk.js'); - this.getChunkFileName(chunkId); - } - } - }, - error: { - code: 'PLUGIN_ERROR', - hook: 'buildStart', - message: - 'Plugin error - Unable to get file name for chunk "chunk.js". Ensure that generate is called first.', - plugin: 'test-plugin', - pluginCode: 'CHUNK_NOT_GENERATED' - } -}; diff --git a/test/function/samples/deprecated/emit-chunk/chunk-filename-not-available/chunk.js b/test/function/samples/deprecated/emit-chunk/chunk-filename-not-available/chunk.js deleted file mode 100644 index 36b1d61dd25..00000000000 --- a/test/function/samples/deprecated/emit-chunk/chunk-filename-not-available/chunk.js +++ /dev/null @@ -1 +0,0 @@ -console.log('chunk'); diff --git a/test/function/samples/deprecated/emit-chunk/chunk-filename-not-available/main.js b/test/function/samples/deprecated/emit-chunk/chunk-filename-not-available/main.js deleted file mode 100644 index c0b933d7b56..00000000000 --- a/test/function/samples/deprecated/emit-chunk/chunk-filename-not-available/main.js +++ /dev/null @@ -1 +0,0 @@ -console.log('main'); diff --git a/test/function/samples/deprecated/emit-chunk/chunk-not-found/_config.js b/test/function/samples/deprecated/emit-chunk/chunk-not-found/_config.js deleted file mode 100644 index c731c60c9c5..00000000000 --- a/test/function/samples/deprecated/emit-chunk/chunk-not-found/_config.js +++ /dev/null @@ -1,19 +0,0 @@ -const path = require('path'); - -module.exports = { - description: 'Throws if an emitted entry chunk cannot be resolved', - options: { - strictDeprecations: false, - input: 'main.js', - plugins: { - buildStart() { - this.emitChunk('not-found.js'); - } - } - }, - error: { - code: 'UNRESOLVED_ENTRY', - message: 'Could not resolve entry module (not-found.js).', - watchFiles: [path.join(__dirname, 'main.js')] - } -}; diff --git a/test/function/samples/deprecated/emit-chunk/chunk-not-found/main.js b/test/function/samples/deprecated/emit-chunk/chunk-not-found/main.js deleted file mode 100644 index c0b933d7b56..00000000000 --- a/test/function/samples/deprecated/emit-chunk/chunk-not-found/main.js +++ /dev/null @@ -1 +0,0 @@ -console.log('main'); diff --git a/test/function/samples/deprecated/emit-chunk/invalid-chunk-id/_config.js b/test/function/samples/deprecated/emit-chunk/invalid-chunk-id/_config.js deleted file mode 100644 index 5f131d72bd5..00000000000 --- a/test/function/samples/deprecated/emit-chunk/invalid-chunk-id/_config.js +++ /dev/null @@ -1,16 +0,0 @@ -module.exports = { - description: 'throws for invalid chunk ids', - options: { - strictDeprecations: false, - plugins: { - name: 'test-plugin', - load() { - return `export default import.meta.ROLLUP_CHUNK_URL_invalid;`; - } - } - }, - generateError: { - code: 'FILE_NOT_FOUND', - message: 'Plugin error - Unable to get file name for unknown file "invalid".' - } -}; diff --git a/test/function/samples/deprecated/emit-chunk/invalid-chunk-id/main.js b/test/function/samples/deprecated/emit-chunk/invalid-chunk-id/main.js deleted file mode 100644 index c4b940fc952..00000000000 --- a/test/function/samples/deprecated/emit-chunk/invalid-chunk-id/main.js +++ /dev/null @@ -1 +0,0 @@ -throw new Error('should not build'); diff --git a/test/function/samples/deprecated/emit-chunk/modules-loaded/_config.js b/test/function/samples/deprecated/emit-chunk/modules-loaded/_config.js deleted file mode 100644 index da093620bc8..00000000000 --- a/test/function/samples/deprecated/emit-chunk/modules-loaded/_config.js +++ /dev/null @@ -1,20 +0,0 @@ -module.exports = { - description: 'Throws when adding a chunk after the modules have finished loading', - options: { - strictDeprecations: false, - input: 'main.js', - plugins: { - name: 'test-plugin', - buildEnd() { - this.emitChunk('chunk.js'); - } - } - }, - error: { - code: 'PLUGIN_ERROR', - hook: 'buildEnd', - message: 'Cannot emit chunks after module loading has finished.', - plugin: 'test-plugin', - pluginCode: 'INVALID_ROLLUP_PHASE' - } -}; diff --git a/test/function/samples/deprecated/emit-chunk/modules-loaded/chunk.js b/test/function/samples/deprecated/emit-chunk/modules-loaded/chunk.js deleted file mode 100644 index a9244a453fb..00000000000 --- a/test/function/samples/deprecated/emit-chunk/modules-loaded/chunk.js +++ /dev/null @@ -1 +0,0 @@ -throw new Error('Not executed'); diff --git a/test/function/samples/deprecated/emit-chunk/modules-loaded/main.js b/test/function/samples/deprecated/emit-chunk/modules-loaded/main.js deleted file mode 100644 index c0b933d7b56..00000000000 --- a/test/function/samples/deprecated/emit-chunk/modules-loaded/main.js +++ /dev/null @@ -1 +0,0 @@ -console.log('main'); diff --git a/test/function/samples/deprecated/emit-chunk/no-input/_config.js b/test/function/samples/deprecated/emit-chunk/no-input/_config.js deleted file mode 100644 index 7536323ba6a..00000000000 --- a/test/function/samples/deprecated/emit-chunk/no-input/_config.js +++ /dev/null @@ -1,21 +0,0 @@ -module.exports = { - description: 'It is not necessary to provide an input if a dynamic entry is emitted', - options: { - strictDeprecations: false, - input: undefined, - plugins: { - name: 'test-plugin', - buildStart() { - this.emitChunk('chunk.js'); - } - } - }, - warnings: [ - { - code: 'DEPRECATED_FEATURE', - message: - 'The "this.emitChunk" plugin context function used by plugin test-plugin is deprecated. The "this.emitFile" plugin context function should be used instead.', - plugin: 'test-plugin' - } - ] -}; diff --git a/test/function/samples/deprecated/emit-chunk/no-input/chunk.js b/test/function/samples/deprecated/emit-chunk/no-input/chunk.js deleted file mode 100644 index c40c320ba58..00000000000 --- a/test/function/samples/deprecated/emit-chunk/no-input/chunk.js +++ /dev/null @@ -1 +0,0 @@ -assert.equal(42, 42); diff --git a/test/function/samples/deprecated/inline-dynamic-imports-bundle/_config.js b/test/function/samples/deprecated/inline-dynamic-imports-bundle/_config.js index ce23254e2ce..39f0738b74e 100644 --- a/test/function/samples/deprecated/inline-dynamic-imports-bundle/_config.js +++ b/test/function/samples/deprecated/inline-dynamic-imports-bundle/_config.js @@ -14,5 +14,12 @@ module.exports = { ]); } } - } + }, + warnings: [ + { + code: 'DEPRECATED_FEATURE', + message: + 'The "inlineDynamicImports" option is deprecated. Use the "output.inlineDynamicImports" option instead.' + } + ] }; diff --git a/test/function/samples/deprecated/inline-imports-with-manual/_config.js b/test/function/samples/deprecated/inline-imports-with-manual/_config.js index 907a12634e4..e84d3ec9c3b 100644 --- a/test/function/samples/deprecated/inline-imports-with-manual/_config.js +++ b/test/function/samples/deprecated/inline-imports-with-manual/_config.js @@ -13,5 +13,6 @@ module.exports = { message: 'Invalid value for option "output.manualChunks" - this option is not supported for "output.inlineDynamicImports".', url: 'https://rollupjs.org/guide/en/#outputmanualchunks' - } + }, + warnings: [] }; diff --git a/test/function/samples/deprecated/inline-imports-with-multiple-array/_config.js b/test/function/samples/deprecated/inline-imports-with-multiple-array/_config.js index dff057acf9b..1436e3072ee 100644 --- a/test/function/samples/deprecated/inline-imports-with-multiple-array/_config.js +++ b/test/function/samples/deprecated/inline-imports-with-multiple-array/_config.js @@ -10,5 +10,6 @@ module.exports = { message: 'Invalid value for option "output.inlineDynamicImports" - multiple inputs are not supported when "output.inlineDynamicImports" is true.', url: 'https://rollupjs.org/guide/en/#outputinlinedynamicimports' - } + }, + warnings: [] }; diff --git a/test/function/samples/deprecated/inline-imports-with-multiple-object/_config.js b/test/function/samples/deprecated/inline-imports-with-multiple-object/_config.js index ca38de58603..d3df98d1c3b 100644 --- a/test/function/samples/deprecated/inline-imports-with-multiple-object/_config.js +++ b/test/function/samples/deprecated/inline-imports-with-multiple-object/_config.js @@ -10,5 +10,12 @@ module.exports = { message: 'Invalid value for option "output.inlineDynamicImports" - multiple inputs are not supported when "output.inlineDynamicImports" is true.', url: 'https://rollupjs.org/guide/en/#outputinlinedynamicimports' - } + }, + warnings: [ + { + code: 'DEPRECATED_FEATURE', + message: + 'The "inlineDynamicImports" option is deprecated. Use the "output.inlineDynamicImports" option instead.' + } + ] }; diff --git a/test/function/samples/deprecated/interop-false/_config.js b/test/function/samples/deprecated/interop-false/_config.js index f50a6495ea5..4651e9ab514 100644 --- a/test/function/samples/deprecated/interop-false/_config.js +++ b/test/function/samples/deprecated/interop-false/_config.js @@ -57,5 +57,13 @@ module.exports = { throw new Error(`Unexpected import "${id}"`); } } - } + }, + warnings: [ + { + code: 'DEPRECATED_FEATURE', + message: + 'The boolean value "false" for the "output.interop" option is deprecated. Use "esModule", "default" or "defaultOnly" instead.', + url: 'https://rollupjs.org/guide/en/#outputinterop' + } + ] }; diff --git a/test/function/samples/deprecated/interop-true-live-bindings/_config.js b/test/function/samples/deprecated/interop-true-live-bindings/_config.js index aa0adf12c4d..13a9669136b 100644 --- a/test/function/samples/deprecated/interop-true-live-bindings/_config.js +++ b/test/function/samples/deprecated/interop-true-live-bindings/_config.js @@ -57,5 +57,13 @@ module.exports = { throw new Error(`Unexpected import "${id}"`); } } - } + }, + warnings: [ + { + code: 'DEPRECATED_FEATURE', + message: + 'The boolean value "true" for the "output.interop" option is deprecated. Use "auto" instead.', + url: 'https://rollupjs.org/guide/en/#outputinterop' + } + ] }; diff --git a/test/function/samples/deprecated/interop-true-no-live-bindings/_config.js b/test/function/samples/deprecated/interop-true-no-live-bindings/_config.js index d53d739e94c..5bba6bb7ecc 100644 --- a/test/function/samples/deprecated/interop-true-no-live-bindings/_config.js +++ b/test/function/samples/deprecated/interop-true-no-live-bindings/_config.js @@ -44,5 +44,13 @@ module.exports = { throw new Error(`Unexpected import "${id}"`); } } - } + }, + warnings: [ + { + code: 'DEPRECATED_FEATURE', + message: + 'The boolean value "true" for the "output.interop" option is deprecated. Use "auto" instead.', + url: 'https://rollupjs.org/guide/en/#outputinterop' + } + ] }; diff --git a/test/function/samples/deprecated/keep-used-imports-from-pure-external-modules/_config.js b/test/function/samples/deprecated/keep-used-imports-from-pure-external-modules/_config.js deleted file mode 100644 index 45fe156dc40..00000000000 --- a/test/function/samples/deprecated/keep-used-imports-from-pure-external-modules/_config.js +++ /dev/null @@ -1,24 +0,0 @@ -const assert = require('assert'); - -module.exports = { - description: 'imports from pure external modules that are used should not be omitted', - options: { - strictDeprecations: false, - external: ['warning'], - treeshake: { - pureExternalModules: ['warning'] - } - }, - context: { - require: id => { - if (id === 'warning') return arg => assert.equal(arg, 'hi'); - throw new Error('Unexpected import', id); - } - }, - warnings: [ - { - code: 'DEPRECATED_FEATURE', - message: `The "treeshake.pureExternalModules" option is deprecated. The "treeshake.moduleSideEffects" option should be used instead. "treeshake.pureExternalModules: true" is equivalent to "treeshake.moduleSideEffects: 'no-external'"` - } - ] -}; diff --git a/test/function/samples/deprecated/keep-used-imports-from-pure-external-modules/main.js b/test/function/samples/deprecated/keep-used-imports-from-pure-external-modules/main.js deleted file mode 100644 index 992a4573f52..00000000000 --- a/test/function/samples/deprecated/keep-used-imports-from-pure-external-modules/main.js +++ /dev/null @@ -1,3 +0,0 @@ -import warning from 'warning'; - -warning('hi'); diff --git a/test/function/samples/deprecated/manual-chunks-conflict/_config.js b/test/function/samples/deprecated/manual-chunks-conflict/_config.js index 8ef99e03397..0784b63bbb2 100644 --- a/test/function/samples/deprecated/manual-chunks-conflict/_config.js +++ b/test/function/samples/deprecated/manual-chunks-conflict/_config.js @@ -13,5 +13,6 @@ module.exports = { generateError: { code: 'INVALID_CHUNK', message: `Cannot assign dep.js to the "dep2" chunk as it is already in the "dep1" chunk.` - } + }, + warnings: [] }; diff --git a/test/function/samples/deprecated/manual-chunks-info/_config.js b/test/function/samples/deprecated/manual-chunks-info/_config.js index 3e410ca2161..44dcf747df5 100644 --- a/test/function/samples/deprecated/manual-chunks-info/_config.js +++ b/test/function/samples/deprecated/manual-chunks-info/_config.js @@ -288,5 +288,6 @@ module.exports = { ); } } - } + }, + warnings: [] }; diff --git a/test/function/samples/deprecated/manual-chunks-preserve-modules/_config.js b/test/function/samples/deprecated/manual-chunks-preserve-modules/_config.js index adb29a8dbca..de258b20125 100644 --- a/test/function/samples/deprecated/manual-chunks-preserve-modules/_config.js +++ b/test/function/samples/deprecated/manual-chunks-preserve-modules/_config.js @@ -13,5 +13,6 @@ module.exports = { message: 'Invalid value for option "output.manualChunks" - this option is not supported for "output.preserveModules".', url: 'https://rollupjs.org/guide/en/#outputmanualchunks' - } + }, + warnings: [] }; diff --git a/test/function/samples/deprecated/name-conflict-symbol/_config.js b/test/function/samples/deprecated/name-conflict-symbol/_config.js index 87812cfdceb..b21115f0bbf 100644 --- a/test/function/samples/deprecated/name-conflict-symbol/_config.js +++ b/test/function/samples/deprecated/name-conflict-symbol/_config.js @@ -11,5 +11,12 @@ module.exports = { exports(exports) { assert.strictEqual(exports.Symbol, null); assert.strictEqual(exports.toString(), '[object Module]'); - } + }, + warnings: [ + { + code: 'DEPRECATED_FEATURE', + message: + 'The "output.namespaceToStringTag" option is deprecated. Use the "output.generatedCode.symbols" option instead.' + } + ] }; diff --git a/test/function/samples/deprecated/namespace-tostring/dynamic-import-default-mode/_config.js b/test/function/samples/deprecated/namespace-tostring/dynamic-import-default-mode/_config.js index 229c2f06ac5..2ec429ad920 100644 --- a/test/function/samples/deprecated/namespace-tostring/dynamic-import-default-mode/_config.js +++ b/test/function/samples/deprecated/namespace-tostring/dynamic-import-default-mode/_config.js @@ -15,5 +15,12 @@ module.exports = { assert.strictEqual(foo[Symbol.toStringTag], 'Module'); assert.strictEqual(Object.prototype.toString.call(foo), '[object Module]'); assert.strictEqual(foo.default, 42); - } + }, + warnings: [ + { + code: 'DEPRECATED_FEATURE', + message: + 'The "output.namespaceToStringTag" option is deprecated. Use the "output.generatedCode.symbols" option instead.' + } + ] }; diff --git a/test/function/samples/deprecated/namespace-tostring/dynamic-import/_config.js b/test/function/samples/deprecated/namespace-tostring/dynamic-import/_config.js index 8e2345f65d2..290d2965863 100644 --- a/test/function/samples/deprecated/namespace-tostring/dynamic-import/_config.js +++ b/test/function/samples/deprecated/namespace-tostring/dynamic-import/_config.js @@ -18,5 +18,12 @@ module.exports = { assert.deepStrictEqual(copied, { bar: 42 }); assert.strictEqual(Object.prototype.toString.call(copied), '[object Object]'); assert.strictEqual(copied[Symbol.toStringTag], undefined); - } + }, + warnings: [ + { + code: 'DEPRECATED_FEATURE', + message: + 'The "output.namespaceToStringTag" option is deprecated. Use the "output.generatedCode.symbols" option instead.' + } + ] }; diff --git a/test/function/samples/deprecated/namespace-tostring/entry-default/_config.js b/test/function/samples/deprecated/namespace-tostring/entry-default/_config.js index 157a349ffe1..567b7d97fce 100644 --- a/test/function/samples/deprecated/namespace-tostring/entry-default/_config.js +++ b/test/function/samples/deprecated/namespace-tostring/entry-default/_config.js @@ -13,5 +13,12 @@ module.exports = { assert.strictEqual(exports[Symbol.toStringTag], undefined); assert.strictEqual(Object.prototype.toString.call(exports), '[object Object]'); assert.strictEqual(exports.foo, 42); - } + }, + warnings: [ + { + code: 'DEPRECATED_FEATURE', + message: + 'The "output.namespaceToStringTag" option is deprecated. Use the "output.generatedCode.symbols" option instead.' + } + ] }; diff --git a/test/function/samples/deprecated/namespace-tostring/entry-named/_config.js b/test/function/samples/deprecated/namespace-tostring/entry-named/_config.js index f4d48b27188..59f3e02561a 100644 --- a/test/function/samples/deprecated/namespace-tostring/entry-named/_config.js +++ b/test/function/samples/deprecated/namespace-tostring/entry-named/_config.js @@ -18,5 +18,12 @@ module.exports = { assert.deepStrictEqual(copied, { foo: 42 }); assert.strictEqual(Object.prototype.toString.call(copied), '[object Object]'); assert.strictEqual(copied[Symbol.toStringTag], undefined); - } + }, + warnings: [ + { + code: 'DEPRECATED_FEATURE', + message: + 'The "output.namespaceToStringTag" option is deprecated. Use the "output.generatedCode.symbols" option instead.' + } + ] }; diff --git a/test/function/samples/deprecated/namespace-tostring/external-namespaces/_config.js b/test/function/samples/deprecated/namespace-tostring/external-namespaces/_config.js index 21ac84c6eb5..d856f9cf321 100644 --- a/test/function/samples/deprecated/namespace-tostring/external-namespaces/_config.js +++ b/test/function/samples/deprecated/namespace-tostring/external-namespaces/_config.js @@ -25,5 +25,12 @@ module.exports = { require() { return { foo: 42 }; } - } + }, + warnings: [ + { + code: 'DEPRECATED_FEATURE', + message: + 'The "output.namespaceToStringTag" option is deprecated. Use the "output.generatedCode.symbols" option instead.' + } + ] }; diff --git a/test/function/samples/deprecated/namespace-tostring/inlined-namespace/_config.js b/test/function/samples/deprecated/namespace-tostring/inlined-namespace/_config.js index 70d5429e572..da23f1267c7 100644 --- a/test/function/samples/deprecated/namespace-tostring/inlined-namespace/_config.js +++ b/test/function/samples/deprecated/namespace-tostring/inlined-namespace/_config.js @@ -5,5 +5,12 @@ module.exports = { output: { namespaceToStringTag: true } - } + }, + warnings: [ + { + code: 'DEPRECATED_FEATURE', + message: + 'The "output.namespaceToStringTag" option is deprecated. Use the "output.generatedCode.symbols" option instead.' + } + ] }; diff --git a/test/function/samples/deprecated/namespace-tostring/interop-property-descriptor/_config.js b/test/function/samples/deprecated/namespace-tostring/interop-property-descriptor/_config.js index 3b6363a482d..f77d40fe85d 100644 --- a/test/function/samples/deprecated/namespace-tostring/interop-property-descriptor/_config.js +++ b/test/function/samples/deprecated/namespace-tostring/interop-property-descriptor/_config.js @@ -16,5 +16,12 @@ module.exports = { return id.split('-')[1]; } } - } + }, + warnings: [ + { + code: 'DEPRECATED_FEATURE', + message: + 'The "output.namespaceToStringTag" option is deprecated. Use the "output.generatedCode.symbols" option instead.' + } + ] }; diff --git a/test/function/samples/deprecated/namespace-tostring/property-descriptor/_config.js b/test/function/samples/deprecated/namespace-tostring/property-descriptor/_config.js index aeac0e0efff..c12c3a3f423 100644 --- a/test/function/samples/deprecated/namespace-tostring/property-descriptor/_config.js +++ b/test/function/samples/deprecated/namespace-tostring/property-descriptor/_config.js @@ -5,5 +5,12 @@ module.exports = { output: { namespaceToStringTag: true } - } + }, + warnings: [ + { + code: 'DEPRECATED_FEATURE', + message: + 'The "output.namespaceToStringTag" option is deprecated. Use the "output.generatedCode.symbols" option instead.' + } + ] }; diff --git a/test/function/samples/deprecated/nested-inlined-dynamic-import-1/_config.js b/test/function/samples/deprecated/nested-inlined-dynamic-import-1/_config.js index 8ab6e162777..2c5fd7e0246 100644 --- a/test/function/samples/deprecated/nested-inlined-dynamic-import-1/_config.js +++ b/test/function/samples/deprecated/nested-inlined-dynamic-import-1/_config.js @@ -9,5 +9,12 @@ module.exports = { }, exports(exports) { return exports().then(result => assert.strictEqual(result, 43)); - } + }, + warnings: [ + { + code: 'DEPRECATED_FEATURE', + message: + 'The "inlineDynamicImports" option is deprecated. Use the "output.inlineDynamicImports" option instead.' + } + ] }; diff --git a/test/function/samples/deprecated/plugin-module-ids/_config.js b/test/function/samples/deprecated/plugin-module-ids/_config.js index 4faf1e294a2..8fcaac3409c 100644 --- a/test/function/samples/deprecated/plugin-module-ids/_config.js +++ b/test/function/samples/deprecated/plugin-module-ids/_config.js @@ -21,5 +21,13 @@ module.exports = { }, bundle() { assert.ok(rendered); - } + }, + warnings: [ + { + code: 'DEPRECATED_FEATURE', + message: + 'Accessing "this.moduleIds" on the plugin context by plugin at position 1 is deprecated. The "this.getModuleIds" plugin context function should be used instead.', + plugin: 'at position 1' + } + ] }; diff --git a/test/function/samples/deprecated/preserveModules/mixed-exports/_config.js b/test/function/samples/deprecated/preserveModules/mixed-exports/_config.js index 239d8f84960..be4b11c9385 100644 --- a/test/function/samples/deprecated/preserveModules/mixed-exports/_config.js +++ b/test/function/samples/deprecated/preserveModules/mixed-exports/_config.js @@ -8,6 +8,11 @@ module.exports = { preserveModules: true }, warnings: [ + { + code: 'DEPRECATED_FEATURE', + message: + 'The "preserveModules" option is deprecated. Use the "output.preserveModules" option instead.' + }, { code: 'MIXED_EXPORTS', id: path.join(__dirname, 'main.js'), diff --git a/test/function/samples/deprecated/preserveModules/virtual-modules-conflict/_config.js b/test/function/samples/deprecated/preserveModules/virtual-modules-conflict/_config.js index 0f024647c97..e26520edc46 100644 --- a/test/function/samples/deprecated/preserveModules/virtual-modules-conflict/_config.js +++ b/test/function/samples/deprecated/preserveModules/virtual-modules-conflict/_config.js @@ -29,5 +29,12 @@ module.exports = { ['main.js', '_virtual/_virtualModule.js', '_virtual/_virtualModule2.js'] ) ); - } + }, + warnings: [ + { + code: 'DEPRECATED_FEATURE', + message: + 'The "preserveModules" option is deprecated. Use the "output.preserveModules" option instead.' + } + ] }; diff --git a/test/function/samples/deprecated/preserveModules/virtual-modules/_config.js b/test/function/samples/deprecated/preserveModules/virtual-modules/_config.js index ece89c970b4..6e181d257ee 100644 --- a/test/function/samples/deprecated/preserveModules/virtual-modules/_config.js +++ b/test/function/samples/deprecated/preserveModules/virtual-modules/_config.js @@ -29,5 +29,12 @@ module.exports = { ['main.js', '_virtual/_virtualModule.js', 'lib/lib.js'] ) ); - } + }, + warnings: [ + { + code: 'DEPRECATED_FEATURE', + message: + 'The "preserveModules" option is deprecated. Use the "output.preserveModules" option instead.' + } + ] }; diff --git a/test/function/samples/deprecated/reexport-ns/_config.js b/test/function/samples/deprecated/reexport-ns/_config.js index 60fecaa0d22..b1dae2ca191 100644 --- a/test/function/samples/deprecated/reexport-ns/_config.js +++ b/test/function/samples/deprecated/reexport-ns/_config.js @@ -13,5 +13,12 @@ module.exports = { assert.strictEqual(typeof exports.maths, 'object'); assert.strictEqual(exports[Symbol.toStringTag], 'Module'); assert.strictEqual(exports.maths.external, true); - } + }, + warnings: [ + { + code: 'DEPRECATED_FEATURE', + message: + 'The "output.namespaceToStringTag" option is deprecated. Use the "output.generatedCode.symbols" option instead.' + } + ] }; diff --git a/test/function/samples/deprecated/resolve-id-external/_config.js b/test/function/samples/deprecated/resolve-id-external/_config.js index f03887bea14..65e426652fc 100644 --- a/test/function/samples/deprecated/resolve-id-external/_config.js +++ b/test/function/samples/deprecated/resolve-id-external/_config.js @@ -79,7 +79,9 @@ module.exports = { }, warnings(warnings) { for (const warning of warnings) { - assert.strictEqual(warning.code, 'UNUSED_EXTERNAL_IMPORT'); + if (warning.code !== 'UNUSED_EXTERNAL_IMPORT' && warning.code !== 'DEPRECATED_FEATURE') { + throw new Error(`Unexpected warning code "${warning.code}"`); + } } } }; diff --git a/test/function/samples/deprecated/resolve-id/_config.js b/test/function/samples/deprecated/resolve-id/_config.js index 19f254b2b42..461318f1db0 100644 --- a/test/function/samples/deprecated/resolve-id/_config.js +++ b/test/function/samples/deprecated/resolve-id/_config.js @@ -85,5 +85,10 @@ module.exports = { ); } } + }, + warnings(warnings) { + for (const warning of warnings) { + assert.strictEqual(warning.code, 'DEPRECATED_FEATURE'); + } } }; diff --git a/test/function/samples/deprecations/ROLLUP_ASSET_URL/_config.js b/test/function/samples/deprecations/ROLLUP_ASSET_URL/_config.js deleted file mode 100644 index 1537c66604a..00000000000 --- a/test/function/samples/deprecations/ROLLUP_ASSET_URL/_config.js +++ /dev/null @@ -1,19 +0,0 @@ -module.exports = { - description: 'marks ROLLUP_ASSET_URL as deprecated', - options: { - plugins: { - load() { - return `export default import.meta.ROLLUP_ASSET_URL_${this.emitFile({ - type: 'asset', - name: 'asset', - source: 'asset' - })};`; - } - } - }, - generateError: { - code: 'DEPRECATED_FEATURE', - message: - 'Using the "ROLLUP_ASSET_URL_" prefix to reference files is deprecated. Use the "ROLLUP_FILE_URL_" prefix instead.' - } -}; diff --git a/test/function/samples/deprecations/ROLLUP_ASSET_URL/main.js b/test/function/samples/deprecations/ROLLUP_ASSET_URL/main.js deleted file mode 100644 index f8a2d88d245..00000000000 --- a/test/function/samples/deprecations/ROLLUP_ASSET_URL/main.js +++ /dev/null @@ -1,11 +0,0 @@ -const foo = {}; - -function doIt(x) { - if (foo[x]) { - return true; - } - foo[x] = true; -} - -doIt('x'); -assert.ok(doIt('x'), 'foo was not reassigned'); diff --git a/test/function/samples/deprecations/ROLLUP_CHUNK_URL/_config.js b/test/function/samples/deprecations/ROLLUP_CHUNK_URL/_config.js deleted file mode 100644 index eac2bdb901b..00000000000 --- a/test/function/samples/deprecations/ROLLUP_CHUNK_URL/_config.js +++ /dev/null @@ -1,26 +0,0 @@ -module.exports = { - description: 'marks ROLLUP_CHUNK_URL as deprecated', - options: { - plugins: { - resolveId(id) { - if (id === 'chunk') { - return id; - } - }, - load(id) { - if (id === 'chunk') { - return "console.log('chunk')"; - } - return `export default import.meta.ROLLUP_CHUNK_URL_${this.emitFile({ - type: 'chunk', - id: 'chunk' - })};`; - } - } - }, - generateError: { - code: 'DEPRECATED_FEATURE', - message: - 'Using the "ROLLUP_CHUNK_URL_" prefix to reference files is deprecated. Use the "ROLLUP_FILE_URL_" prefix instead.' - } -}; diff --git a/test/function/samples/deprecations/ROLLUP_CHUNK_URL/main.js b/test/function/samples/deprecations/ROLLUP_CHUNK_URL/main.js deleted file mode 100644 index f8a2d88d245..00000000000 --- a/test/function/samples/deprecations/ROLLUP_CHUNK_URL/main.js +++ /dev/null @@ -1,11 +0,0 @@ -const foo = {}; - -function doIt(x) { - if (foo[x]) { - return true; - } - foo[x] = true; -} - -doIt('x'); -assert.ok(doIt('x'), 'foo was not reassigned'); diff --git a/test/function/samples/deprecations/resolveAssetUrl/_config.js b/test/function/samples/deprecations/resolveAssetUrl/_config.js deleted file mode 100644 index 25e521c58c9..00000000000 --- a/test/function/samples/deprecations/resolveAssetUrl/_config.js +++ /dev/null @@ -1,14 +0,0 @@ -module.exports = { - description: 'marks the resolveAssetUrl hook as deprecated', - options: { - plugins: { - resolveAssetUrl() {} - } - }, - error: { - code: 'DEPRECATED_FEATURE', - message: - 'The "resolveAssetUrl" hook used by plugin at position 1 is deprecated. The "resolveFileUrl" hook should be used instead.', - plugin: 'at position 1' - } -}; diff --git a/test/function/samples/deprecations/resolveAssetUrl/main.js b/test/function/samples/deprecations/resolveAssetUrl/main.js deleted file mode 100644 index f8a2d88d245..00000000000 --- a/test/function/samples/deprecations/resolveAssetUrl/main.js +++ /dev/null @@ -1,11 +0,0 @@ -const foo = {}; - -function doIt(x) { - if (foo[x]) { - return true; - } - foo[x] = true; -} - -doIt('x'); -assert.ok(doIt('x'), 'foo was not reassigned'); diff --git a/test/function/samples/deprecations/this-emitAsset/_config.js b/test/function/samples/deprecations/this-emitAsset/_config.js deleted file mode 100644 index 1a7a563a557..00000000000 --- a/test/function/samples/deprecations/this-emitAsset/_config.js +++ /dev/null @@ -1,17 +0,0 @@ -module.exports = { - description: 'marks this.emitAsset as deprecated', - options: { - plugins: { - buildStart() { - this.emitAsset('asset', 'asset'); - } - } - }, - error: { - code: 'PLUGIN_ERROR', - hook: 'buildStart', - message: `The "this.emitAsset" plugin context function used by plugin at position 1 is deprecated. The "this.emitFile" plugin context function should be used instead.`, - plugin: 'at position 1', - pluginCode: 'DEPRECATED_FEATURE' - } -}; diff --git a/test/function/samples/deprecations/this-emitAsset/main.js b/test/function/samples/deprecations/this-emitAsset/main.js deleted file mode 100644 index f8a2d88d245..00000000000 --- a/test/function/samples/deprecations/this-emitAsset/main.js +++ /dev/null @@ -1,11 +0,0 @@ -const foo = {}; - -function doIt(x) { - if (foo[x]) { - return true; - } - foo[x] = true; -} - -doIt('x'); -assert.ok(doIt('x'), 'foo was not reassigned'); diff --git a/test/function/samples/deprecations/this-emitChunk/_config.js b/test/function/samples/deprecations/this-emitChunk/_config.js deleted file mode 100644 index 207a79446f1..00000000000 --- a/test/function/samples/deprecations/this-emitChunk/_config.js +++ /dev/null @@ -1,17 +0,0 @@ -module.exports = { - description: 'marks this.emitChunk as deprecated', - options: { - plugins: { - buildStart() { - this.emitChunk('chunk'); - } - } - }, - error: { - code: 'PLUGIN_ERROR', - hook: 'buildStart', - message: `The "this.emitChunk" plugin context function used by plugin at position 1 is deprecated. The "this.emitFile" plugin context function should be used instead.`, - plugin: 'at position 1', - pluginCode: 'DEPRECATED_FEATURE' - } -}; diff --git a/test/function/samples/deprecations/this-emitChunk/main.js b/test/function/samples/deprecations/this-emitChunk/main.js deleted file mode 100644 index f8a2d88d245..00000000000 --- a/test/function/samples/deprecations/this-emitChunk/main.js +++ /dev/null @@ -1,11 +0,0 @@ -const foo = {}; - -function doIt(x) { - if (foo[x]) { - return true; - } - foo[x] = true; -} - -doIt('x'); -assert.ok(doIt('x'), 'foo was not reassigned'); diff --git a/test/function/samples/deprecations/this-getAssetFileName/_config.js b/test/function/samples/deprecations/this-getAssetFileName/_config.js deleted file mode 100644 index 85f86ebcdd2..00000000000 --- a/test/function/samples/deprecations/this-getAssetFileName/_config.js +++ /dev/null @@ -1,18 +0,0 @@ -module.exports = { - description: 'marks this.getAssetFileName as deprecated', - options: { - plugins: { - renderChunk() { - this.getAssetFileName(this.emitFile({ type: 'asset', name: 'asset', source: 'asset' })); - } - } - }, - generateError: { - code: 'PLUGIN_ERROR', - hook: 'renderChunk', - message: - 'The "this.getAssetFileName" plugin context function used by plugin at position 1 is deprecated. The "this.getFileName" plugin context function should be used instead.', - plugin: 'at position 1', - pluginCode: 'DEPRECATED_FEATURE' - } -}; diff --git a/test/function/samples/deprecations/this-getAssetFileName/main.js b/test/function/samples/deprecations/this-getAssetFileName/main.js deleted file mode 100644 index f8a2d88d245..00000000000 --- a/test/function/samples/deprecations/this-getAssetFileName/main.js +++ /dev/null @@ -1,11 +0,0 @@ -const foo = {}; - -function doIt(x) { - if (foo[x]) { - return true; - } - foo[x] = true; -} - -doIt('x'); -assert.ok(doIt('x'), 'foo was not reassigned'); diff --git a/test/function/samples/deprecations/this-getChunkFileName/_config.js b/test/function/samples/deprecations/this-getChunkFileName/_config.js deleted file mode 100644 index 641cde735ea..00000000000 --- a/test/function/samples/deprecations/this-getChunkFileName/_config.js +++ /dev/null @@ -1,23 +0,0 @@ -let chunkReferenceId; - -module.exports = { - description: 'marks this.getChunkFileName as deprecated', - options: { - plugins: { - buildStart() { - chunkReferenceId = this.emitFile({ type: 'chunk', id: 'chunk' }); - }, - renderChunk() { - this.getChunkFileName(chunkReferenceId); - } - } - }, - generateError: { - code: 'PLUGIN_ERROR', - hook: 'renderChunk', - message: - 'The "this.getChunkFileName" plugin context function used by plugin at position 1 is deprecated. The "this.getFileName" plugin context function should be used instead.', - plugin: 'at position 1', - pluginCode: 'DEPRECATED_FEATURE' - } -}; diff --git a/test/function/samples/deprecations/this-getChunkFileName/chunk.js b/test/function/samples/deprecations/this-getChunkFileName/chunk.js deleted file mode 100644 index 820c7c052bc..00000000000 --- a/test/function/samples/deprecations/this-getChunkFileName/chunk.js +++ /dev/null @@ -1 +0,0 @@ -assert.equal(1, 1); diff --git a/test/function/samples/deprecations/this-getChunkFileName/main.js b/test/function/samples/deprecations/this-getChunkFileName/main.js deleted file mode 100644 index f8a2d88d245..00000000000 --- a/test/function/samples/deprecations/this-getChunkFileName/main.js +++ /dev/null @@ -1,11 +0,0 @@ -const foo = {}; - -function doIt(x) { - if (foo[x]) { - return true; - } - foo[x] = true; -} - -doIt('x'); -assert.ok(doIt('x'), 'foo was not reassigned'); diff --git a/test/function/samples/deprecations/this-isExternal/_config.js b/test/function/samples/deprecations/this-isExternal/_config.js deleted file mode 100644 index 5c322a5ccd9..00000000000 --- a/test/function/samples/deprecations/this-isExternal/_config.js +++ /dev/null @@ -1,18 +0,0 @@ -module.exports = { - description: 'marks this.isExternal as deprecated', - options: { - plugins: { - buildStart() { - this.isExternal('external'); - } - } - }, - error: { - code: 'PLUGIN_ERROR', - hook: 'buildStart', - message: - 'The "this.isExternal" plugin context function used by plugin at position 1 is deprecated. The "this.resolve" plugin context function should be used instead.', - plugin: 'at position 1', - pluginCode: 'DEPRECATED_FEATURE' - } -}; diff --git a/test/function/samples/deprecations/this-isExternal/main.js b/test/function/samples/deprecations/this-isExternal/main.js deleted file mode 100644 index f8a2d88d245..00000000000 --- a/test/function/samples/deprecations/this-isExternal/main.js +++ /dev/null @@ -1,11 +0,0 @@ -const foo = {}; - -function doIt(x) { - if (foo[x]) { - return true; - } - foo[x] = true; -} - -doIt('x'); -assert.ok(doIt('x'), 'foo was not reassigned'); diff --git a/test/function/samples/deprecations/this-resolveId/_config.js b/test/function/samples/deprecations/this-resolveId/_config.js deleted file mode 100644 index 6ecacb3cf80..00000000000 --- a/test/function/samples/deprecations/this-resolveId/_config.js +++ /dev/null @@ -1,18 +0,0 @@ -module.exports = { - description: 'marks this.resolveId as deprecated', - options: { - plugins: { - buildStart() { - this.resolveId('external'); - } - } - }, - error: { - code: 'PLUGIN_ERROR', - hook: 'buildStart', - message: - 'The "this.resolveId" plugin context function used by plugin at position 1 is deprecated. The "this.resolve" plugin context function should be used instead.', - plugin: 'at position 1', - pluginCode: 'DEPRECATED_FEATURE' - } -}; diff --git a/test/function/samples/deprecations/this-resolveId/main.js b/test/function/samples/deprecations/this-resolveId/main.js deleted file mode 100644 index f8a2d88d245..00000000000 --- a/test/function/samples/deprecations/this-resolveId/main.js +++ /dev/null @@ -1,11 +0,0 @@ -const foo = {}; - -function doIt(x) { - if (foo[x]) { - return true; - } - foo[x] = true; -} - -doIt('x'); -assert.ok(doIt('x'), 'foo was not reassigned'); diff --git a/test/function/samples/deprecations/treeshake-pureExternalModules/_config.js b/test/function/samples/deprecations/treeshake-pureExternalModules/_config.js deleted file mode 100644 index bc0a9aa5e7a..00000000000 --- a/test/function/samples/deprecations/treeshake-pureExternalModules/_config.js +++ /dev/null @@ -1,10 +0,0 @@ -module.exports = { - description: 'marks the treeshake.pureExternalModules option as deprecated', - options: { - treeshake: { pureExternalModules: true } - }, - error: { - code: 'DEPRECATED_FEATURE', - message: `The "treeshake.pureExternalModules" option is deprecated. The "treeshake.moduleSideEffects" option should be used instead. "treeshake.pureExternalModules: true" is equivalent to "treeshake.moduleSideEffects: 'no-external'"` - } -}; diff --git a/test/function/samples/deprecations/treeshake-pureExternalModules/main.js b/test/function/samples/deprecations/treeshake-pureExternalModules/main.js deleted file mode 100644 index f8a2d88d245..00000000000 --- a/test/function/samples/deprecations/treeshake-pureExternalModules/main.js +++ /dev/null @@ -1,11 +0,0 @@ -const foo = {}; - -function doIt(x) { - if (foo[x]) { - return true; - } - foo[x] = true; -} - -doIt('x'); -assert.ok(doIt('x'), 'foo was not reassigned'); diff --git a/test/hooks/index.js b/test/hooks/index.js index 1a6f71919f0..a9018215bd9 100644 --- a/test/hooks/index.js +++ b/test/hooks/index.js @@ -142,45 +142,6 @@ describe('hooks', () => { }); }); - it('supports isExternal on plugin context', () => - rollup.rollup({ - input: 'input', - external: ['test'], - plugins: [ - loader({ input: `alert('hello')` }), - { - buildStart() { - assert.strictEqual(this.isExternal('test'), true); - assert.strictEqual(this.isExternal('another'), false); - } - } - ] - })); - - it('supports resolveId on plugin context', () => - rollup - .rollup({ - input: 'input', - plugins: [ - loader({ - input: `import 'test'`, - dep1: `import 'next'`, - dep2: `alert('hello')` - }), - { - resolveId(id) { - if (id === 'test') return 'dep1'; - if (id === 'next') return this.resolveId('final'); - if (id === 'final') return 'dep2'; - } - } - ] - }) - .then(bundle => bundle.generate({ format: 'es' })) - .then(({ output: [output] }) => { - assert.strictEqual(output.code, `alert('hello');\n`); - })); - it('caches chunk emission in transform hook', () => { let cache; return rollup @@ -1001,29 +962,6 @@ describe('hooks', () => { }); }); - it('passes bundle object to generateBundle hook', () => - rollup - .rollup({ - input: 'input', - plugins: [ - loader({ input: `alert('hello')` }), - { - transform() { - const assetId = this.emitAsset('test.ext', 'hello world'); - return `export default import.meta.ROLLUP_ASSET_URL_${assetId};`; - }, - generateBundle(options, outputBundle, isWrite) { - assert.strictEqual(outputBundle['assets/test-0a676135.ext'].source, 'hello world'); - assert.strictEqual( - outputBundle['input.js'].code, - `var input = new URL('assets/test-0a676135.ext', import.meta.url).href;\n\nexport { input as default };\n` - ); - } - } - ] - }) - .then(bundle => bundle.generate({ format: 'es' }))); - it('supports closeBundle hook', () => { let closeBundleCalls = 0; return rollup @@ -1308,270 +1246,4 @@ describe('hooks', () => { } }); }); - - describe('deprecated', () => { - it('caches chunk emission in transform hook', () => { - let cache; - return rollup - .rollup({ - input: 'input', - plugins: [ - loader({ input: '', chunk: "console.log('chunk');" }), - { - transform(code, id) { - if (id === 'input') { - return `export default import.meta.ROLLUP_CHUNK_URL_${this.emitChunk('chunk')};`; - } - } - } - ] - }) - .then(bundle => { - cache = bundle.cache; - return bundle.generate({ format: 'es' }); - }) - .then(({ output }) => { - assert.strictEqual( - output[0].code, - `var input = new URL('chunk-928cb70b.js', import.meta.url).href;\n\nexport { input as default };\n` - ); - assert.strictEqual(output[1].fileName, 'chunk-928cb70b.js'); - assert.strictEqual(output[1].code, `console.log('chunk');\n`); - - return rollup.rollup({ - cache, - input: 'input', - plugins: [ - loader({ input: '', chunk: "console.log('chunk');" }), - { - transform() { - assert.fail('Should cache transform'); - } - } - ] - }); - }) - .then(bundle => { - cache = bundle.cache; - return bundle.generate({ format: 'es' }); - }) - .then(({ output }) => { - assert.strictEqual( - output[0].code, - `var input = new URL('chunk-928cb70b.js', import.meta.url).href;\n\nexport { input as default };\n` - ); - assert.strictEqual(output[1].fileName, 'chunk-928cb70b.js'); - assert.strictEqual(output[1].code, `console.log('chunk');\n`); - - return rollup.rollup({ - cache, - input: 'input', - plugins: [ - loader({ input: '', chunk: "console.log('chunk');" }), - { - transform() { - assert.fail('Should cache transform'); - } - } - ] - }); - }) - .then(bundle => bundle.generate({ format: 'es' })) - .then(({ output }) => { - assert.strictEqual( - output[0].code, - `var input = new URL('chunk-928cb70b.js', import.meta.url).href;\n\nexport { input as default };\n` - ); - assert.strictEqual(output[1].fileName, 'chunk-928cb70b.js'); - assert.strictEqual(output[1].code, `console.log('chunk');\n`); - }); - }); - - it('caches asset emission in transform hook', () => { - let cache; - return rollup - .rollup({ - input: 'input', - plugins: [ - loader({ input: '' }), - { - transform() { - const assetId = this.emitAsset('test.ext', 'hello world'); - return `export default import.meta.ROLLUP_ASSET_URL_${assetId};`; - } - } - ] - }) - .then(bundle => { - cache = bundle.cache; - return bundle.generate({ format: 'es' }); - }) - .then(({ output }) => { - assert.strictEqual( - output[0].code, - `var input = new URL('assets/test-0a676135.ext', import.meta.url).href;\n\nexport { input as default };\n` - ); - assert.strictEqual(output[1].fileName, 'assets/test-0a676135.ext'); - assert.strictEqual(output[1].source, 'hello world'); - assert.strictEqual(output[1].fileName, 'assets/test-0a676135.ext'); - assert.strictEqual(output[1].source, 'hello world'); - - return rollup.rollup({ - cache, - input: 'input', - plugins: [ - loader({ input: '' }), - { - transform() { - assert.fail('Should cache transform'); - } - } - ] - }); - }) - .then(bundle => { - cache = bundle.cache; - return bundle.generate({ format: 'es' }); - }) - .then(({ output }) => { - assert.strictEqual( - output[0].code, - `var input = new URL('assets/test-0a676135.ext', import.meta.url).href;\n\nexport { input as default };\n` - ); - assert.strictEqual(output[1].fileName, 'assets/test-0a676135.ext'); - assert.strictEqual(output[1].source, 'hello world'); - assert.strictEqual(output[1].fileName, 'assets/test-0a676135.ext'); - assert.strictEqual(output[1].source, 'hello world'); - - return rollup.rollup({ - cache, - input: 'input', - plugins: [ - loader({ input: '' }), - { - transform() { - assert.fail('Should cache transform'); - } - } - ] - }); - }) - .then(bundle => bundle.generate({ format: 'es' })) - .then(({ output }) => { - assert.strictEqual( - output[0].code, - `var input = new URL('assets/test-0a676135.ext', import.meta.url).href;\n\nexport { input as default };\n` - ); - assert.strictEqual(output[1].fileName, 'assets/test-0a676135.ext'); - assert.strictEqual(output[1].source, 'hello world'); - assert.strictEqual(output[1].fileName, 'assets/test-0a676135.ext'); - assert.strictEqual(output[1].source, 'hello world'); - }); - }); - - it('opts-out transform hook cache for custom cache', () => { - let runs = 0; - let cache; - return rollup - .rollup({ - input: 'input', - plugins: [ - loader({ input: '' }), - { - name: 'x', - transform() { - this.cache.set('asdf', 'asdf'); - runs++; - const assetId = this.emitAsset('test.ext', 'hello world'); - return `export default import.meta.ROLLUP_ASSET_URL_${assetId};`; - } - } - ] - }) - .then(bundle => { - cache = bundle.cache; - return bundle.generate({ format: 'es' }); - }) - .then(({ output }) => { - assert.strictEqual( - output[0].code, - `var input = new URL('assets/test-0a676135.ext', import.meta.url).href;\n\nexport { input as default };\n` - ); - assert.strictEqual(output[1].fileName, 'assets/test-0a676135.ext'); - assert.strictEqual(output[1].source, 'hello world'); - assert.strictEqual(output[1].fileName, 'assets/test-0a676135.ext'); - assert.strictEqual(output[1].source, 'hello world'); - - return rollup.rollup({ - cache, - input: 'input', - plugins: [ - loader({ input: '' }), - { - name: 'x', - transform() { - runs++; - return `alert('hello world')`; - } - } - ] - }); - }) - .then(bundle => bundle.generate({ format: 'es' })) - .then(({ output }) => { - assert.strictEqual(runs, 2); - assert.strictEqual(output[0].code.trim(), `alert('hello world');`); - assert.strictEqual(output.length, 1); - }); - }); - - it('allows setting asset source at generateBundle', () => { - let assetId; - return rollup - .rollup({ - input: 'input', - plugins: [ - loader({ input: `alert('hello')` }), - { - transform() { - return ''; - }, - generateBundle() { - assetId = this.emitAsset('test.ext'); - this.setAssetSource(assetId, 'hello world'); - } - } - ] - }) - .then(bundle => bundle.generate({ format: 'es' })) - .then(({ output: [, output] }) => { - assert.strictEqual(output.source, 'hello world'); - }); - }); - - it('allows setting asset source separately', () => { - let assetId; - return rollup - .rollup({ - input: 'input', - plugins: [ - loader({ input: `alert('hello')` }), - { - transform() { - assetId = this.emitAsset('test.ext'); - return ''; - }, - generateBundle() { - this.setAssetSource(assetId, 'hello world'); - } - } - ] - }) - .then(bundle => bundle.generate({ format: 'es' })) - .then(({ output: [, output] }) => { - assert.strictEqual(output.fileName, 'assets/test-0a676135.ext'); - assert.strictEqual(output.source, 'hello world'); - }); - }); - }); }); diff --git a/test/watch/index.js b/test/watch/index.js index 0e8a7dd7883..7094649bef0 100644 --- a/test/watch/index.js +++ b/test/watch/index.js @@ -1262,7 +1262,7 @@ describe('rollup.watch', () => { it('rebuilds immediately by default', async () => { await copy('test/watch/samples/basic', 'test/_tmp/input'); - await wait(100); + await wait(200); watcher = rollup.watch({ input: 'test/_tmp/input/main.js', output: {