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

Remove .extend(...) in favour of constructor #523

Merged
merged 2 commits into from
Dec 13, 2021
Merged

Remove .extend(...) in favour of constructor #523

merged 2 commits into from
Dec 13, 2021

Conversation

mmkal
Copy link
Contributor

@mmkal mmkal commented Dec 6, 2021

Fixes #441

(by removing the method that had out of date docs!)

@papb no worries if you're not able to review this, but before doing the v3 release, I wanted to drop the .extend(...) method which is confusing, inflexible, and not really necessary.

This is a breaking change to the beta release. Users of .extend will have to change code like this:

const parent = new Umzug({ ... })

const umzug = parent.extend(
  migrations => migrations.slice().reverse()
)

To this:

const parent = new Umzug({ ... })

const umzug = new Umzug({
  ...parent.options,
  migrations: async ctx => (await parent.migrations(ctx)).slice().reverse(),
})

@mmkal mmkal requested a review from papb December 6, 2021 14:22
@mmkal mmkal merged commit 2911d20 into master Dec 13, 2021
@mmkal mmkal deleted the rm-extend branch December 13, 2021 00:29
@github-actions
Copy link

Release v3.0.0-beta-cli.18 addresses this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Docs: extend instructions out of date
1 participant