Skip to content

chore: update dependency loopback-datasource-juggler to ^4.21.1#5261

Merged
bajtos merged 1 commit into
masterfrom
renovate/loopback-datasource-juggler-4.x
Apr 28, 2020
Merged

chore: update dependency loopback-datasource-juggler to ^4.21.1#5261
bajtos merged 1 commit into
masterfrom
renovate/loopback-datasource-juggler-4.x

Conversation

@renovate

@renovate renovate Bot commented Apr 27, 2020

Copy link
Copy Markdown
Contributor

This PR contains the following updates:

Package Type Update Change
loopback-datasource-juggler dependencies minor ^4.20.0 -> ^4.21.1
loopback-datasource-juggler devDependencies minor ^4.20.0 -> ^4.21.1

Release Notes

strongloop/loopback-datasource-juggler

v4.21.1

v4.21.0

Compare Source

==========================

  • types: make DataSource.stop compatible with LB4 (Miroslav Bajtoš)

  • feat: implement DataSource.stop() (Miroslav Bajtoš)

  • Add __parent reference to embedded models (Dimitris Xalatsis)


Renovate configuration

📅 Schedule: At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

♻️ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about these updates again.


  • If you want to rebase/retry this PR, check this box

This PR has been generated by WhiteSource Renovate. View repository job log here.

@bajtos

bajtos commented Apr 27, 2020

Copy link
Copy Markdown
Member

Ouch, looks like loopbackio/loopback-datasource-juggler#1835 was not as backwards compatible as I thought 🙈 While I could change juggler's typings to describe the return value of stop method as PromiseOrValue<void>, I feel such description would be incorrect and would make the stop method more difficult to use outside of LB4 life-cycle observer use-cases.

Instead, I decided bite the bullet and update both our CLI template and existing apps to use the new style where start and stop methods are not scaffolded at all.

@bajtos bajtos mentioned this pull request Apr 27, 2020
7 tasks
@bajtos bajtos changed the title chore: update dependency loopback-datasource-juggler to ^4.21.0 feat: remove hand-written datasource stop() method + update loopback-datasource-juggler to ^4.21.0 Apr 27, 2020

@hacksparrow hacksparrow left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@bajtos
bajtos force-pushed the renovate/loopback-datasource-juggler-4.x branch from af33fbe to ba986e2 Compare April 27, 2020 14:15
Comment thread packages/cli/generators/datasource/templates/datasource.ts.ejs
@bajtos
bajtos force-pushed the renovate/loopback-datasource-juggler-4.x branch from ba986e2 to 572420d Compare April 27, 2020 15:17
@bajtos

bajtos commented Apr 27, 2020

Copy link
Copy Markdown
Member

@raymondfeng I added the link you suggested, LGTY now?

@raymondfeng

Copy link
Copy Markdown
Contributor

Ouch, looks like loopbackio/loopback-datasource-juggler#1835 was not as backwards compatible as I thought 🙈 While I could change juggler's typings to describe the return value of stop method as PromiseOrValue, I feel such description would be incorrect and would make the stop method more difficult to use outside of LB4 life-cycle observer use-cases.

What usage is broken do you have in mind?

@bajtos

bajtos commented Apr 27, 2020

Copy link
Copy Markdown
Member

What usage is broken do you have in mind?

See the failed CI build for the dependency upgrade commit created by RenovateBot:

Commit 46d66a9, build https://travis-ci.com/github/strongloop/loopback-next/jobs/323793285

> loopback-next@0.1.0 build /home/travis/build/strongloop/loopback-next
> node packages/build/bin/compile-package -b

examples/multi-tenancy/src/datasources/db.datasource.ts:40:3 - error TS2416: Property 'stop' in type 'DbDataSource' is not assignable to the same property in base type 'DataSource'.
  Type '() => ValueOrPromise<void>' is not assignable to type '() => Promise<void>'.
    Type 'ValueOrPromise<void>' is not assignable to type 'Promise<void>'.
      Type 'void' is not assignable to type 'Promise<void>'.

40   stop(): ValueOrPromise<void> {
     ~~~~


(...)

@bajtos

bajtos commented Apr 27, 2020

Copy link
Copy Markdown
Member

I wish we scaffolded the start/stop methods with no return type, that way the compiler would infer that start returns void and stop returns Promise<void> and we wouldn't have this problem :(

@raymondfeng

Copy link
Copy Markdown
Contributor

I see. Then we may need either mark this as a breaking change or continue to generate the start/stop.

Comment thread docs/site/OpenAPI-generator.md
@bajtos

bajtos commented Apr 28, 2020

Copy link
Copy Markdown
Member

Cross-posting loopbackio/loopback-datasource-juggler#1835 (comment)

Ouch, looks like strongloop/loopback-datasource-juggler#1835 was not as backwards compatible as I thought 🙈 While I could change juggler's typings to describe the return value of stop method as PromiseOrValue<void>, I feel such description would be incorrect and would make the stop method more difficult to use outside of LB4 life-cycle observer use-cases.

I was thinking about this a bit more and realized that we have to fix the typings because I don't see any other way how to avoid breaking existing LB4 applications.

I opened a new PR in juggler, I would like to get it approved, merged and published today. See
loopbackio/loopback-datasource-juggler#1838


As for the changes proposed in 572420d, I opened a new pull request where we can discuss them separately from juggler update. Please continue the discussion in #5279

@renovate
renovate Bot force-pushed the renovate/loopback-datasource-juggler-4.x branch from 572420d to 08d4c76 Compare April 28, 2020 06:50
@renovate renovate Bot changed the title feat: remove hand-written datasource stop() method + update loopback-datasource-juggler to ^4.21.0 chore: update dependency loopback-datasource-juggler to ^4.21.0 Apr 28, 2020
@bajtos bajtos closed this Apr 28, 2020
@bajtos bajtos reopened this Apr 28, 2020
@bajtos

bajtos commented Apr 28, 2020

Copy link
Copy Markdown
Member

(Waiting for RenovateBot to notice loopback-datasource-juggler@4.21.1 and update this pull request accordingly.)

@bajtos
bajtos force-pushed the renovate/loopback-datasource-juggler-4.x branch from 08d4c76 to 9d0aa95 Compare April 28, 2020 08:01
@bajtos bajtos changed the title chore: update dependency loopback-datasource-juggler to ^4.21.0 chore: update dependency loopback-datasource-juggler to ^4.21.1 Apr 28, 2020
@renovate

renovate Bot commented Apr 28, 2020

Copy link
Copy Markdown
Contributor Author

PR has been edited

👷 This PR has received other commits, so Renovate will stop updating it to avoid conflicts or other problems. If you wish to abandon your changes and have Renovate start over you may click the "rebase" checkbox in the PR body/description.

@bajtos
bajtos merged commit 07c431b into master Apr 28, 2020
@bajtos
bajtos deleted the renovate/loopback-datasource-juggler-4.x branch April 28, 2020 08:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants