Repository navigation
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? |
lukastaegert
left a comment
There was a problem hiding this comment.
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.
| export interface PluginContext { | ||
| // TODO deprecate: | ||
| watcher: Watcher; | ||
| /** @deprecated */ |
| load?: LoadHook; | ||
| resolveId?: ResolveIdHook; | ||
| resolveExternal?: any; | ||
| preferConst?: boolean; |
There was a problem hiding this comment.
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.
| 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}`; |
| 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.
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.
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.
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.
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. |
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 `[email protected]`. rollup/rollup#2409
@egoist @lmihaidaniel Fixes egoist#147 The `onwrite` rollup hook has been deprecated in favor of `generateBundle` in `[email protected]`. 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.