clean: remove backward-compat checks for old Rollup versions#374
Merged
ezolenko merged 1 commit intoezolenko:masterfrom Jul 6, 2022
Merged
Conversation
- we require Rollup `>=1.26.3` in the peerDeps and the README and have for years now
- (and Rollup is currently at `2.75.7`, so this is a pretty low target)
- as such, we can remove various checks that are legacy backward-compat remnants for old Rollup versions:
- `this.meta` was added to `options` in `1.1.0`: https://github.com/rollup/rollup/blob/master/CHANGELOG.md#110
- `this.addWatchFile` was added at least in `1.0.0`: https://github.com/rollup/rollup/blob/master/CHANGELOG.md#100
- `this.error` and `this.warn` were added to `transform` in `0.41.0`: https://github.com/rollup/rollup/blob/master/CHANGELOG.md#0410
- this simplifies some of the code a decent bit, `RollupContext` in particular
- see also the usage of `buildEnd` in my other PR
- modify tests to account for these changes; basically just simplify them
- and remove the check against private internals of the class, as they're private
- guess I forgot to remove this when I was refactoring the test code?
Owner
|
btw, there is no reason not to bump minimum rollup version if we need to use anything new, I expect most people either update whole build toolchain, or freeze the lot. Well, all sane people would anyway... :) |
Collaborator
Author
Yea I figure, given how old the current min is, but that also would technically be a breaking change, so also wouldn't want to do so without good reason. So far, I haven't encountered anything that needed new APIs though (which is surprising, because as a Rollup user, it seemed like I had to update quite a lot for Rollup 2, but now, as a plugin developer, I'm not seeing the same need to upgrade 🤷 ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Clean up some old backward-compat checks that are no longer necessary for the minimum version of Rollup that rpt2 requires
included files missed bytransform(type-only files) #345 (comment), where I realized several of these checks were legacy and no longer neededDetails
we require Rollup
>=1.26.3in the peerDeps and the README and have for years now2.75.7, so this is a pretty low target)this.metawas added tooptionsin1.1.0: https://github.com/rollup/rollup/blob/master/CHANGELOG.md#110this.addWatchFilewas added at least in1.0.0: https://github.com/rollup/rollup/blob/master/CHANGELOG.md#100this.errorandthis.warnwere added totransformin0.41.0: https://github.com/rollup/rollup/blob/master/CHANGELOG.md#0410this simplifies some of the code a decent bit,
RollupContextin particularbuildEndin fix: type-checkincluded files missed bytransform(type-only files) #345modify tests to account for these changes; basically just simplify them
Future Work
lodashusage_.isFunctionusage can be replaced with a check for the opposite condition, i.e.typeof message === "string" ? message : message()_.merge,_.isEqual, and_.compactwould be the only ones leftover after