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

RFC: use LB3 models in an LB4 app [SPIKE - DO NOT MERGE] #2274

Closed
wants to merge 15 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions SPIKE-NOTES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
## Open questions

- How to test code migrated from strong-remoting and loopback (v3)? Do we want
to copy existing tests over? Migrate them to async/await style? Don't bother
Copy link
Contributor

Choose a reason for hiding this comment

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

IMO the answer ideally should be definitely use async/await style, but re-write them using the tests for inspiration. If you were to reflect on how you migrated strong-remoting and loopback (v3) code over for the spike, do you feel that there were significant changes to warrant a re-write of the tests?

with testing at all, use few acceptance-level tests only?

- How to split 2k+ lines of new (migrated) code into smaller chunks that will be
easier to review?

- Should we register LB3 Models for dependency injection into LB4 code? Register
them as repositories, models, services, or something else?

- Should we implement booting datasources from `datasources.json`? I see two
obstacles:

1. Datasources must be booted before models are attached.
2. LB3 supports variable replacement in JSON config files using ENV vars but
also `app.get(name)`. This may add unwanted complexity to our compat layer.

## By the way

- TypeScript does not support static index signature, which make it difficult to
consume custom model methods. See
https://github.com/Microsoft/TypeScript/issues/6480.

- I'd like us to extract the Booter contract into a standalone package so that
v3compat and other similar extensions don't have to inherit entire boot and
don't have to lock down a specific semver-major version of boot in extension
dependencies. Instead, they should depend on the Booter contract only, this
contract should not be changed so often (hopefully).
156 changes: 0 additions & 156 deletions lb3api.md

This file was deleted.

Loading