Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup v2.0.0 #3347

Merged
merged 19 commits into from Mar 6, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
62 changes: 19 additions & 43 deletions .circleci/config.yml
@@ -1,23 +1,5 @@
version: 2

unit_tests: &unit_tests
steps:
- checkout
- restore_cache:
key: dependency-cache-{{ checksum "package-lock.json" }}
- run:
name: Run unit tests.
command: npm run ci:test

unit_tests_12: &unit_tests_12
steps:
- checkout
- restore_cache:
key: dependency-cache-{{ checksum "package-lock.json" }}
- run:
name: Run unit tests.
command: npm run ci:test_12

jobs:
analysis:
docker:
Expand All @@ -27,30 +9,35 @@ jobs:
- restore_cache:
key: dependency-cache-{{ checksum "package-lock.json" }}
- run:
name: Install Dependencies
name: Installing Dependencies
command: npm ci --ignore-scripts
- run:
name: Run linting.
name: Running linting
command: npm run ci:lint
- run:
name: Run NPM Security Audit
name: Running NPM Security Audit
command: npm run security
- save_cache:
key: dependency-cache-{{ checksum "package-lock.json" }}
paths:
- ./node_modules
node-v6-latest:
docker:
- image: rollupcabal/circleci-node-v6:latest
<<: *unit_tests
node-v8-latest:
docker:
- image: rollupcabal/circleci-node-v8:latest
<<: *unit_tests
node-v10-latest:
docker:
- image: rollupcabal/circleci-node-v10:latest
<<: *unit_tests
steps:
- checkout
- restore_cache:
key: dependency-cache-{{ checksum "package-lock.json" }}
- run:
name: Running tests
command: npm run ci:test
- store_artifacts:
name: Storing browser build for REPL
path: /home/circleci/project/dist/rollup.browser.js
destination: rollup.browser.js
- run:
name: Post REPL comment
command: ./scripts/post-comment.js
node-v12-latest:
docker:
- image: rollupcabal/circleci-node-v12:latest
Expand All @@ -59,9 +46,10 @@ jobs:
- restore_cache:
key: dependency-cache-{{ checksum "package-lock.json" }}
- run:
name: Run tests with coverage.
name: Running tests with coverage
command: npm run ci:coverage


workflows:
version: 2
validate-test:
Expand All @@ -70,18 +58,6 @@ workflows:
filters:
tags:
only: /.*/
- node-v6-latest:
requires:
- analysis
filters:
tags:
only: /.*/
- node-v8-latest:
requires:
- analysis
filters:
tags:
only: /.*/
- node-v10-latest:
requires:
- analysis
Expand Down
4 changes: 0 additions & 4 deletions .eslintignore

This file was deleted.

11 changes: 8 additions & 3 deletions .eslintrc.json
@@ -1,6 +1,11 @@
{
"root": true,
"rules": {
"ignorePatterns": [
"test/*/samples/**/*.js",
"!test/*/samples/**/_config.js",
"test/leak/index.js",
"**/*.ts"
],
"rules": {
"indent": [ 2, "tab", { "SwitchCase": 1 } ],
"semi": [ 2, "always" ],
"keyword-spacing": [ 2, { "before": true, "after": true } ],
Expand Down Expand Up @@ -32,7 +37,7 @@
"plugin:import/warnings"
],
"parserOptions": {
"ecmaVersion": 6,
"ecmaVersion": 2018,
"sourceType": "module"
},
"settings": {
Expand Down
35 changes: 15 additions & 20 deletions .github/workflows/node-windows.yml
Expand Up @@ -4,30 +4,25 @@ on: [push]

jobs:
build:

runs-on: windows-2019

strategy:
matrix:
node: [ '10', '6' ]
node: ['12', '10']

name: ${{ matrix.node }} (Windows)
steps:
- name: Configure git line-breaks
run: git config --global core.autocrlf false
- name: Checkout Commit
uses: actions/checkout@v1
- name: Setup Node
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node }}
- name: Check npm version
# This is only necessary until we dump Node 6
run: if [ ${{ matrix.node }} -lt 8 ]; then npm i npm@5 -g; fi;
shell: bash
- name: Install dependencies
run: npm ci --ignore-scripts
- name: Run tests
run: npm test
env:
CI: true
- name: Configure git line-breaks
run: git config --global core.autocrlf false
- name: Checkout Commit
uses: actions/checkout@v1
- name: Setup Node
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node }}
- name: Install dependencies
run: npm ci --ignore-scripts
- name: Run tests
run: npm test
env:
CI: true
9 changes: 3 additions & 6 deletions .lintstagedrc
@@ -1,17 +1,14 @@
{
"{src,bin,browser,typings}/**/*.ts": [
"prettier --write",
"tslint --project . --fix",
"git add"
"tslint --project . --fix"
],
"test/**/*.ts": [
"prettier --write",
"tslint --project test/typescript --fix",
"git add"
"tslint --project test/typescript --fix"
],
"{test/test,test/*/index,test/utils,test/**/_config}.js": [
"prettier --write",
"eslint --fix",
"git add"
"eslint --fix"
]
}
63 changes: 63 additions & 0 deletions CHANGELOG.md
@@ -1,5 +1,68 @@
# rollup changelog

## 2.0.0
*2020-03-06*

### Breaking Changes
* 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](https://github.com/acornjs/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)

### Features
* Rollup now bundles [Chokidar](https://github.com/paulmillr/chokidar) for a better watch experience (#3331)
* Rollup now bundles [acorn](https://github.com/acornjs/acorn) again, removing its only external dependency (#3391)
* Do not consider empty imports from side-effect-free modules for chunking and hoist side-effect imports if necessary (#3369)
* 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](https://nodejs.org/dist/latest-v13.x/docs/api/esm.html#esm_conditional_exports) feature and is therefore itself experimental (#3391)
* `systemjs` can be used as format alias for `system` (#3381)

### Bug Fixes
* Unknown output options now trigger a warning when using the JavaScript API (#3352)
* Rollup will no longer introduce Node types into TypeScript projects that do not use them (#3395)
* Generate correct sourcemaps when tree-shaking occurs in a multi-file bundle (#3423)

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

## 1.32.1
*2020-03-06*

Expand Down