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
1.0: deprecations #2409
1.0: deprecations #2409
Conversation
a177f2b
to
b0d0880
Compare
Transform is repeated twice |
Not 100% sure about "output options as input options". In any case, the current have-baked approach needed to be removed 👍The question is if we want to reintroduce it properly working for all options? Also maybe in a separate PR? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice! Added some comments. Maybe we want to add more urls to warnings as this helps people jump to the docs right away. For wrongly used plugin hooks, a link to the (upcoming?) plugin API section could be great.
src/rollup/types.d.ts
Outdated
@@ -89,8 +89,8 @@ export interface PluginCache { | |||
} | |||
|
|||
export interface PluginContext { | |||
// TODO deprecate: | |||
watcher: Watcher; | |||
/** @deprecated */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
src/rollup/types.d.ts
Outdated
load?: LoadHook; | ||
resolveId?: ResolveIdHook; | ||
resolveExternal?: any; | ||
preferConst?: boolean; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know this one is not documented but I am not sure it should be deprecated. Maybe it should be documented instead? const
seems to have a slight performance benefit in certain environments while var
has the universal compatibility.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes agreed.
@@ -102,14 +126,14 @@ export function createPluginDriver( | |||
if (typeof warning === 'string') warning = { message: warning }; | |||
if (warning.code) warning.pluginCode = warning.code; | |||
warning.code = 'PLUGIN_WARNING'; | |||
warning.plugin = plugin.name || '(anonymous plugin)'; | |||
warning.plugin = plugin.name || `Plugin at position ${pidx + 1}`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
message: `The ${name} hook used by plugin ${plugin.name || | ||
`at position ${pidx + 1}`} is deprecated. The ${newName} hook should be used instead.` | ||
}; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be nice to add a .url
with a link to the upcoming plugin API section on the website once it is available.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similarly, we could add a link to the big list of options when an unknown option is passed: https://rollupjs.org/guide/en#big-list-of-options
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup I've wanted to add links recently, but couldn't as we don't have documentation on most of the new errors.
Will see if I can work on refactoring some of the logic from batchWarnings to prepare for this sort of thing though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
It's good to consider this but note that we have been providing all users with deprecation warnings if not doing this, so that the moment those deprecation paths were created that decision was made to deprecate here as far as I'm concerned. That said, we can certainly reconsider this. Personally I think it's good to be explicit and stick with the model we've set. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me!
d7184f2
to
87b4e49
Compare
0632cde
to
014a10d
Compare
# Conflicts: # src/rollup/index.ts # src/rollup/types.d.ts # src/utils/mergeOptions.ts # src/utils/pluginDriver.ts # src/watch/index.ts # test/hooks/index.js # test/misc/optionList.js
* emit watch changes as a plugin hook * fix path require * deprecate asset dependencies * renderChunk hook to replace transformChunk * renderChunk to follow all transformBundle tests, type definition * 1.0 deprecations * legacy deprecations * new deprecation tests * type fix, output options deprecations * type fixes * deprecation deprecations
* emit watch changes as a plugin hook * fix path require * deprecate asset dependencies * renderChunk hook to replace transformChunk * renderChunk to follow all transformBundle tests, type definition * 1.0 deprecations * legacy deprecations * new deprecation tests * type fix, output options deprecations * type fixes * deprecation deprecations
* emit watch changes as a plugin hook * fix path require * deprecate asset dependencies * renderChunk hook to replace transformChunk * renderChunk to follow all transformBundle tests, type definition * 1.0 deprecations * legacy deprecations * new deprecation tests * type fix, output options deprecations * type fixes * deprecation deprecations
* emit watch changes as a plugin hook * fix path require * deprecate asset dependencies * renderChunk hook to replace transformChunk * renderChunk to follow all transformBundle tests, type definition * 1.0 deprecations * legacy deprecations * new deprecation tests * type fix, output options deprecations * type fixes * deprecation deprecations
* emit watch changes as a plugin hook * fix path require * deprecate asset dependencies * renderChunk hook to replace transformChunk * renderChunk to follow all transformBundle tests, type definition * 1.0 deprecations * legacy deprecations * new deprecation tests * type fix, output options deprecations * type fixes * deprecation deprecations
* emit watch changes as a plugin hook * fix path require * deprecate asset dependencies * renderChunk hook to replace transformChunk * renderChunk to follow all transformBundle tests, type definition * 1.0 deprecations * legacy deprecations * new deprecation tests * type fix, output options deprecations * type fixes * deprecation deprecations
* emit watch changes as a plugin hook * fix path require * deprecate asset dependencies * renderChunk hook to replace transformChunk * renderChunk to follow all transformBundle tests, type definition * 1.0 deprecations * legacy deprecations * new deprecation tests * type fix, output options deprecations * type fixes * deprecation deprecations
* emit watch changes as a plugin hook * fix path require * deprecate asset dependencies * renderChunk hook to replace transformChunk * renderChunk to follow all transformBundle tests, type definition * 1.0 deprecations * legacy deprecations * new deprecation tests * type fix, output options deprecations * type fixes * deprecation deprecations
* emit watch changes as a plugin hook * fix path require * deprecate asset dependencies * renderChunk hook to replace transformChunk * renderChunk to follow all transformBundle tests, type definition * 1.0 deprecations * legacy deprecations * new deprecation tests * type fix, output options deprecations * type fixes * deprecation deprecations
* emit watch changes as a plugin hook * fix path require * deprecate asset dependencies * renderChunk hook to replace transformChunk * renderChunk to follow all transformBundle tests, type definition * 1.0 deprecations * legacy deprecations * new deprecation tests * type fix, output options deprecations * type fixes * deprecation deprecations
* emit watch changes as a plugin hook * fix path require * deprecate asset dependencies * renderChunk hook to replace transformChunk * renderChunk to follow all transformBundle tests, type definition * 1.0 deprecations * legacy deprecations * new deprecation tests * type fix, output options deprecations * type fixes * deprecation deprecations
* emit watch changes as a plugin hook * fix path require * deprecate asset dependencies * renderChunk hook to replace transformChunk * renderChunk to follow all transformBundle tests, type definition * 1.0 deprecations * legacy deprecations * new deprecation tests * type fix, output options deprecations * type fixes * deprecation deprecations
* emit watch changes as a plugin hook * fix path require * deprecate asset dependencies * renderChunk hook to replace transformChunk * renderChunk to follow all transformBundle tests, type definition * 1.0 deprecations * legacy deprecations * new deprecation tests * type fix, output options deprecations * type fixes * deprecation deprecations
* emit watch changes as a plugin hook * fix path require * deprecate asset dependencies * renderChunk hook to replace transformChunk * renderChunk to follow all transformBundle tests, type definition * 1.0 deprecations * legacy deprecations * new deprecation tests * type fix, output options deprecations * type fixes * deprecation deprecations
* emit watch changes as a plugin hook * fix path require * deprecate asset dependencies * renderChunk hook to replace transformChunk * renderChunk to follow all transformBundle tests, type definition * 1.0 deprecations * legacy deprecations * new deprecation tests * type fix, output options deprecations * type fixes * deprecation deprecations
* emit watch changes as a plugin hook * fix path require * deprecate asset dependencies * renderChunk hook to replace transformChunk * renderChunk to follow all transformBundle tests, type definition * 1.0 deprecations * legacy deprecations * new deprecation tests * type fix, output options deprecations * type fixes * deprecation deprecations
* emit watch changes as a plugin hook * fix path require * deprecate asset dependencies * renderChunk hook to replace transformChunk * renderChunk to follow all transformBundle tests, type definition * 1.0 deprecations * legacy deprecations * new deprecation tests * type fix, output options deprecations * type fixes * deprecation deprecations
* emit watch changes as a plugin hook * fix path require * deprecate asset dependencies * renderChunk hook to replace transformChunk * renderChunk to follow all transformBundle tests, type definition * 1.0 deprecations * legacy deprecations * new deprecation tests * type fix, output options deprecations * type fixes * deprecation deprecations
* emit watch changes as a plugin hook * fix path require * deprecate asset dependencies * renderChunk hook to replace transformChunk * renderChunk to follow all transformBundle tests, type definition * 1.0 deprecations * legacy deprecations * new deprecation tests * type fix, output options deprecations * type fixes * deprecation deprecations
* emit watch changes as a plugin hook * fix path require * deprecate asset dependencies * renderChunk hook to replace transformChunk * renderChunk to follow all transformBundle tests, type definition * 1.0 deprecations * legacy deprecations * new deprecation tests * type fix, output options deprecations * type fixes * deprecation deprecations
* emit watch changes as a plugin hook * fix path require * deprecate asset dependencies * renderChunk hook to replace transformChunk * renderChunk to follow all transformBundle tests, type definition * 1.0 deprecations * legacy deprecations * new deprecation tests * type fix, output options deprecations * type fixes * deprecation deprecations
* emit watch changes as a plugin hook * fix path require * deprecate asset dependencies * renderChunk hook to replace transformChunk * renderChunk to follow all transformBundle tests, type definition * 1.0 deprecations * legacy deprecations * new deprecation tests * type fix, output options deprecations * type fixes * deprecation deprecations
* Add English docs to repo * emit watch changes as a plugin hook * deprecate asset dependencies * 1.0 API changest status * watcher interface simplifications * Add new option errors * Make sure only valid JS is piped to stdout * Refine error handling to include dyamic imports * Fix output sorting * 1.0: deprecations (#2409) * emit watch changes as a plugin hook * fix path require * deprecate asset dependencies * renderChunk hook to replace transformChunk * renderChunk to follow all transformBundle tests, type definition * 1.0 deprecations * legacy deprecations * new deprecation tests * type fix, output options deprecations * type fixes * deprecation deprecations * Only print file ids in plugin warnings and errors if present * Upgrading to Acorn 6 (#2486) * WIP Upgrading to Acorn 6 * Fix rollup-plugin-commonjs issue, remaining type issues and tests * Sort options list in docs (no content changes) * Make sure --input option supports named entries as well as default CLI options * Make preferConst an output option * Small type fixes * Externalise acorn * Allow the `d` alias for the `--dir` option * Further refine types and make sure returning false from resolveId marks imports as external * Thoroughly review and update docs
The changelog mentions that returning The actual deprecation message says to use |
Thanks! I think things got a little messed up with the |
@egoist @lmihaidaniel Fixes #147 The `onwrite` rollup hook has been deprecated in favor of `generateBundle` in `rollup@1.x.x`. rollup/rollup#2409
@egoist @lmihaidaniel Fixes egoist#147 The `onwrite` rollup hook has been deprecated in favor of `generateBundle` in `rollup@1.x.x`. rollup/rollup#2409
This PR contains:
Breaking Changes?
If yes, please describe the breakage.
Please Describe Your Changes
This is another PR for the 1.0 release only (DO NOT MERGE into master).
This removes old deprecations, and creates new deprecations in Rollup for some of the recent API changes as discussed.
It's currently based to the combination of both #2405 and #2406 to ensure both of those deprecation paths are included.
Removed deprecated features:
New deprecations added:
All of the new deprecations have deprecation warnings and tests.