Skip to content

chore(deps): upgrade Rollup and plugins

Paul Gascou-Vaillancourt requested to merge upgrade-rollup into master

Integration MR: gitlab!30866 (closed)

This MR upgrades Rollup and its plugins to their latest stable version. Below is a list of specific upgrades along with the corresponding changelogs if available.

Breaking changes summary:

  • rollup@2.0.0

    • Rollup now requires at least Node 10 to run, or a sufficiently modern browser (#3346)

    • The file structure of Rollup's ESM builds has changed:

      • The main ESM entry point is now at rollup/dist/es/rollup.js instead of rollup/dist/rollup.es.js
      • The ESM browser build is at rollup/dist/es/rollup.browser.js instead of rollup/dist/rollup.browser.es.js

      In general, the ESM builds now follow the same naming scheme as the CJS builds but are located in the rollup/dist/es subfolder instead of rollup/dist (#3391)

    • The "watch.chokidar" option no longer accepts a boolean value but only an object of parameters that is passed to the bundled Chokidar instance. Chokidar installations by the user will be ignored in favour of the bundled instance (#3331)

    • Modules that are completely tree-shaken will no longer be listed as part of any chunks in generateBundle

    • The experimentalOptimizeChunks and chunkGroupingSize options have been removed

    • acorn plugins can only be used if they accept a passed-in acorn instance instead of importing it themselves. See https://github.com/acornjs/acorn/pull/870#issuecomment-527339830 for what needs to be done to make plugins compatible that do not support this yet (#3391)

    • Emitted chunks now have the TypeScript type Uint8Array instead of Buffer. A Buffer can still be used, though (#3395)

    • The TypeScript types no longer use ESTree types for AST nodes but a very generic type that does not contain information specific to certain node types (#3395)

    • The signature of the writeBundle plugin hook has been changed to match generateBundle: The bundle object is now passed as second parameter instead of first and the first parameter is the output options (#3361)

    • The following plugin hooks have been removed:

      • ongenerate: use generateBundle instead
      • onwrite: use writeBundle instead
      • transformBundle: use renderChunk instead
      • transformChunk: use renderChunk instead
    • You can no longer access this.watcher on the plugin context.

    • The transform hook can no longer return dependencies.

    • The treeshake.pureExternalModules option will now show a deprecation warning when used: use treeshake.moduleSideEffects: 'no-external' instead

    • Using import.meta.ROLLUP_ASSET_URL_<..> and import.meta.ROLLUP_CHUNK_URL_<..> in code will now show warnings: use import.meta.ROLLUP_FILE_URL_<..> instead

    • The resolveAssetUrl hook will now show a deprecation warning when used: use resolveFileUrl instead

    • The following plugin context functions will show warnings when used:

      • this.emitAsset: use this.emitFile
      • this.emitChunk: use this.emitFile
      • this.getAssetFileName: use this.getFileName
      • this.getChunkFileName: use this.getFileName
      • this.isExternal: use this.resolve
      • this.resolveId: use this.resolve
    • Directly adding properties to the bundle object in the generateBundle is deprecated will show a warning (removing properties is allowed, though): Use this.emitFile

    • Accessing chunk.isAsset on the bundle is deprecated: Use chunk.type === 'asset' instead

    • The error code for a missing name property when targeting UMD has been changed to MISSING_NAME_OPTION_FOR_IIFE_EXPORT to emphasize this is needed for the IIFE part of UMD (#3393)

  • rollup-plugin-postcss@3.0.0

    • dropped support for Rollup v1

Despite the fairly high amount of changes brought by upgrading those packages, there doesn't seem to be any negative impact on GitLab UI.


@rollup/plugin-commonjs

11.0.2 -> 11.1.0 - CHANGELOG

v11.1.0

2020-04-12

Bugfixes

  • fix: produce legal variable names from filenames containing hyphens.

Features

  • feat: support dynamic require
  • feat: export properties defined using Object.defineProperty(exports, ..)

Updates

  • chore: snapshot mismatch running tests before publish (d6bbfdd)
  • test: add snapshots to all "function" tests

@rollup/plugin-node-resolve

7.1.1 -> 7.1.3 - CHANGELOG

v7.1.3

2020-04-12

Bugfixes

  • fix: resolve symlinked entry point properly

v7.1.2

2020-04-12

Updates

  • docs: fix url

@rollup/plugin-replace

2.3.1 -> 2.3.2 - CHANGELOG

v2.3.2

2020-04-19

Updates

  • chore: add rollup 2 to peer range (3e0d775)

rollup

1.31.1 => 2.8.2 - CHANGELOG

2.8.2

2020-05-07

Bug Fixes

  • Avoid invalid code when simplifying the body of a shorthand arrow function expression

Pull Requests

  • #3540: Wrap object expressions in parentheses if they become children of an arrow function expression

2.8.1

2020-05-07

Bug Fixes

  • Allow using plugins on CLI that are exported as exports.default
  • Do not fail side-effect detection in nested callbacks of builtins

Pull Requests

  • #3529: Use default named export with plugins
  • #3539: Track call side-effects both by entity and CallExpression to avoid untracked side-effects in nested calls

2.8.0

2020-05-06

Features

  • When a dynamically imported chunk contains more exports than the imported module namespace, do not create a facade chunk but an inline namespace)

Bug Fixes

  • Do not execute dynamically imported code before synchronous code in the importing module when generating CommonJS

Pull Requests

  • #3535: Avoid dynamic facade chunks

2.7.6

2020-04-30

Bug Fixes

  • Fix a type issue when a default export references a global variable

Pull Requests

  • #3526: Handles default exporting global variables

2.7.5

2020-04-29

Bug Fixes

  • Prevent infinite loop when default values of function parameters in a default export contain a slash

Pull Requests

  • #3522: Avoid infinite loop when finding position for id insertion in default export

2.7.4

2020-04-29

Bug Fixes

  • Fix an issue where wrong variable names were used when preserving modules

Pull Requests

  • #3521: Fix and improve default export alias logic

2.7.3

2020-04-27

Bug Fixes

  • Do not access __proto__ when running Rollup

Pull Requests

  • #3518: use acorn-class-fields and acorn-static-class-features from npm

2.7.2

2020-04-22

Bug Fixes

  • Prevent an infinite loop when creating separate manual chunks with circular dependencies
  • Do not fail if "super" is used in the definition of a class field
  • Throw if a plugin tries to emit a file with an absolute Windows path

Pull Requests

  • #3509: Ban emitFile via absolute paths on Windows OS
  • #3510: Do not fail for circular imports between manual chunks
  • #3511: Support "super" in class fields

2.7.1

2020-04-21

Bug Fixes

  • Use correct path for dynamic imports if output.paths is used

Pull Requests

  • #3508: Respect output.paths in dynamic imports

2.7.0

2020-04-21

Features

  • Add preserveEntrySignatures option to control how exports of entry points are handled
  • Add preserveSignature flag to this.emitFile to control exports of emitted chunks
  • Add output.minifyInternalExports option to control if internal exports are minified

Pull Requests

  • #3498: Add option to configure if entry signatures are preserved

2.6.1

2020-04-12

Bug Fixes

  • Close watch mode when stdin closes in a non-TTY environment

Pull Requests

  • #3493: Ensure --watch mode exits correctly when stdin is closed

2.6.0

2020-04-10

Features

  • Allow regular expressions to declare external modules

Pull Requests

  • #3482: Allow regular expressions in config.external

2.5.0

This version is identical to 2.4.0

2.4.0

2020-04-09

Features

  • Add support for most private and public class field features

Bug Fixes

  • Do not replace this with undefined in class field definitions

Pull Requests

  • #3488: Rollup class fields support

2.3.5

2020-04-09

Bug Fixes

  • Never remove labels when tree-shaking is disabled

Pull Requests

  • #3492: Always use a new inclusion context when including declarations of variables, always inlcude labels when not treeshaking

2.3.4

2020-04-07

Bug Fixes

  • Handle re-exporting synthetic exports from entry-points
  • Fix cross-chunk imports of synthetic exports
  • Handle namespace objects that contain re-exported synthetic namespaces

Pull Requests

  • #3319: Handle re-exports of synthetic named exports

2.3.3

2020-04-04

Bug Fixes

  • Add external namespaces to dynamic namespace objects

Pull Requests

  • #3474: Support external star exports on namespace objects

2.3.2

2020-03-31

Bug Fixes

  • Only warn but do not fail build when a namespace is called as a function
  • Make sure pre-existing sourcemap comments are also removed when rebuilding using the cache

Pull Requests

  • #3475: Call namespace error as a warning
  • #3476: Store locations for removed comments in cache

2.3.1

2020-03-30

Bug Fixes

  • Do not fail if the config file returns an function returning a Promise

Pull Requests

  • #3472: Fix support for async functions as config

2.3.0

2020-03-29

Features

  • Do not transpile config files with .mjs extension in Node 13+ or .cjs extension in any Node version and load them appropriately
  • Extract helper to load a config file the way rollup does it via rollup/dist/loadConfigFile

Bug Fixes

  • Keep watching the config file if an error occurs during initial load in watch node
  • Add a helpful error message when using a transpiled config in a repository with "type": "module"

Pull Requests

  • #3445: Support native ESM configs in Node 13, support untranspiled configs
  • #3468: Don't use esm output format alias in the documentation

2.2.0

2020-03-24

Features

  • Add renderDynamicImport hook to rewrite dynamic import expressions
  • Add information about dynamically imported modules to this.getModuleInfo

Bug Fixes

  • Make file emission work with Uin8Array sources when using Rollup in the browser
  • Fix types to allow watch to accept an array of configs
  • Do not strip .js extensions from AMD imports when the import is a user-supplied replacement for a non-resolvable dynamic import target

Pull Requests

  • #3449: Add hook to rewrite dynamic import expressions
  • #3452: Avoid the assumption of Buffer in browser envs
  • #3453: fix types since watch accepts single or array config
  • #3456: fix SystemJS url in tutorial

2.1.0

2020-03-18

Features

  • Allow specifying an importer when emitting files to resolve relative ids

Pull Requests

  • #3442: Add optional importer parameter to this.emitFile

2.0.6

2020-03-13

Bug Fixes

  • Do not use file names from different outputs when generating sourcemaps using the dir option

Pull Requests

  • #3440: Use correct file names when writing sourcemaps for multiple outputs

2.0.5

2020-03-12

Bug Fixes

  • Fix an issue where conditional statements would assume they have the wrong test value

Pull Requests

  • #3438: Make sure logical expressions always check the left argument for side-effects

2.0.4

2020-03-12

Bug Fixes

  • Avoid conflicts between namespace imports when preserving modules

Pull Requests

  • #3435: Deconflict multiple index imports for ES format using nested export star statements

2.0.3

2020-03-10

Bug Fixes

  • Add type for this.getCombinedSourcemap to transform context

Pull Requests

  • #3377: Switch to yargs-parser lib
  • #3426: Use strict types with PluginDriver
  • #3431: Add missing type declaration for getCombinedSourcemap
  • #3432: Detail how return values from augmentChunkHash are used

2.0.2

2020-03-07

Bug Fixes

  • Make sure the ESM import still works

Pull Requests

  • #3430: Fix conditional exports again

2.0.1

2020-03-07

Bug Fixes

  • Reenable importing rollup in Node 13.0 - 13.7

Pull Requests

  • #3428: Fix conditional exports in Node 13.0 - 13.7

2.0.0

2020-03-06

Breaking Changes

  • Rollup now requires at least Node 10 to run, or a sufficiently modern browser

  • The file structure of Rollup's ESM builds has changed:

    • The main ESM entry point is now at rollup/dist/es/rollup.js instead of rollup/dist/rollup.es.js
    • The ESM browser build is at rollup/dist/es/rollup.browser.js instead of rollup/dist/rollup.browser.es.js

    In general, the ESM builds now follow the same naming scheme as the CJS builds but are located in the rollup/dist/es subfolder instead of rollup/dist

  • The "watch.chokidar" option no longer accepts a boolean value but only an object of parameters that is passed to the bundled Chokidar instance. Chokidar installations by the user will be ignored in favour of the bundled instance

  • Modules that are completely tree-shaken will no longer be listed as part of any chunks in generateBundle

  • The experimentalOptimizeChunks and chunkGroupingSize options have been removed

  • acorn plugins can only be used if they accept a passed-in acorn instance instead of importing it themselves. See https://github.com/acornjs/acorn/pull/870#issuecomment-527339830 for what needs to be done to make plugins compatible that do not support this yet

  • Emitted chunks now have the TypeScript type Uint8Array instead of Buffer. A Buffer can still be used, though

  • The TypeScript types no longer use ESTree types for AST nodes but a very generic type that does not contain information specific to certain node types

  • The signature of the writeBundle plugin hook has been changed to match generateBundle: The bundle object is now passed as second parameter instead of first and the first parameter is the output options

  • The following plugin hooks have been removed:

    • ongenerate: use generateBundle instead
    • onwrite: use writeBundle instead
    • transformBundle: use renderChunk instead
    • transformChunk: use renderChunk instead
  • You can no longer access this.watcher on the plugin context.

  • The transform hook can no longer return dependencies.

  • The treeshake.pureExternalModules option will now show a deprecation warning when used: use treeshake.moduleSideEffects: 'no-external' instead

  • Using import.meta.ROLLUP_ASSET_URL_<..> and import.meta.ROLLUP_CHUNK_URL_<..> in code will now show warnings: use import.meta.ROLLUP_FILE_URL_<..> instead

  • The resolveAssetUrl hook will now show a deprecation warning when used: use resolveFileUrl instead

  • The following plugin context functions will show warnings when used:

    • this.emitAsset: use this.emitFile
    • this.emitChunk: use this.emitFile
    • this.getAssetFileName: use this.getFileName
    • this.getChunkFileName: use this.getFileName
    • this.isExternal: use this.resolve
    • this.resolveId: use this.resolve
  • Directly adding properties to the bundle object in the generateBundle is deprecated will show a warning (removing properties is allowed, though): Use this.emitFile

  • Accessing chunk.isAsset on the bundle is deprecated: Use chunk.type === 'asset' instead

  • The error code for a missing name property when targeting UMD has been changed to MISSING_NAME_OPTION_FOR_IIFE_EXPORT to emphasize this is needed for the IIFE part of UMD

Features

  • Rollup now bundles Chokidar for a better watch experience
  • Rollup now bundles acorn again, removing its only external dependency
  • Do not consider empty imports from side-effect-free modules for chunking and hoist side-effect imports if necessary
  • Rollup can now be imported as an ES module in Node via import {rollup} from 'rollup'. Note that this relies on Node's experimental conditional package exports feature and is therefore itself experimental
  • systemjs can be used as format alias for system

Bug Fixes

  • Unknown output options now trigger a warning when using the JavaScript API
  • Rollup will no longer introduce Node types into TypeScript projects that do not use them
  • Generate correct sourcemaps when tree-shaking occurs in a multi-file bundle

Pull Requests

  • #3331: Bundle Chokidar
  • #3343: Remove experimentalOptimizeChunks
  • #3346: Update minimum required Node version to 10
  • #3352: Remove active deprecations
  • #3361: Change writeBundle signature to match generateBundle
  • #3369: Avoid empty imports from side-effect-free chunks
  • #3381: Rename esm to es everywhere, add systemjs alias
  • #3391: Bundle acorn, allow importing Rollup as Node ES module, update dependencies
  • #3393: Better error code for name-less umd bundle
  • #3395: Remove @types dependencies
  • #3423: Update magic-string and fix sourcemaps

1.32.1

2020-03-06

Bug Fixes

  • Handle default export detection for AMD and IIFE externals that do not have a prototype
  • Handle missing whitespace when the else branch of an if-statement is simplified
  • Mention the importing module when reporting errors for missing named exports
  • Add code to warning for missing output.name of IIFE bundles

Pull Requests

  • #3372: Add warning code for missing output.name of IIFE bundle that has export
  • #3401: Missing exports errors now print the importing module
  • #3418: Structure lifecycle hooks, add links to build time hooks
  • #3420: Update generated code of getInteropBlock() to work with null prototype objects
  • #3421: Avoid invalid code when "else" branch is simplified

1.32.0

2020-02-28

Features

  • Allow adding plugins on the command line via --plugin <plugin>

Pull Requests

  • #3379: introduce CLI --plugin support
  • #3390: fix typo: this.addWatchfile
  • #3392: Bump codecov from 3.6.1 to 3.6.5
  • #3404: Update resolveFileUrl docs

rollup-plugin-babel

4.3.3 -> 4.4.0 - DIFF

No meaningful change

rollup-plugin-postcss

2.0.6 -> 3.1.1 - RELEASES

3.1.1 (2020-04-24)

Bug Fixes

  • revert "feat: allow multiple entry files and outputs"

3.1.0 (2020-04-23)

Features

  • allow multiple entry files and outputs

3.0.0 (2020-04-21)

Documentation

  • add v3 usage

BREAKING CHANGES

  • v3 not support rollup v1.
  • extract relative path based on bundle root.

2.8.2

Bug Fixes

  • extract relative path

2.8.1

Bug Fixes

  • AssetInfo modules used for chunk

2.6.4

Bug Fixes

  • package.json version

2.6.2

Bug Fixes

  • resolve typo

2.6.1

Bug Fixes

  • package.json version

2.5.0

Features

  • add the typescript declaration file

2.4.1

Bug Fixes

  • package.json version

2.4.0

Features

  • update options.inject

2.3.0

Features

  • allow to pass options to built-in loaders

2.2.0

Features

  • sass-loader: prepend options.data to code payload

2.1.1

Bug Fixes

  • Github Actions release.yml incorrect
Edited by Paul Gascou-Vaillancourt

Merge request reports

Loading