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

v6 docs updates #4195

Merged
merged 2 commits into from
Apr 21, 2023
Merged

v6 docs updates #4195

merged 2 commits into from
Apr 21, 2023

Conversation

SpencerKaiser
Copy link
Contributor

@SpencerKaiser SpencerKaiser commented Apr 6, 2023

  • Adding a warning icon to the upgrade notes about typescript
  • Separating .load into a dedicated section for clarity
  • Removing stale references to BaseEntity

image

@B4nan
Copy link
Member

B4nan commented Apr 6, 2023

i just finished rebasing v6, sry about that

@SpencerKaiser SpencerKaiser marked this pull request as ready for review April 6, 2023 18:58
@SpencerKaiser
Copy link
Contributor Author

Sorry about the mess of commits; I'm not really sure what I can do on my end to clean up that history aside from making a new branch. If you'd prefer that, let me know, but I imagine you're squash merging anyways.

@SpencerKaiser SpencerKaiser changed the title V6 docs updates v6 docs updates Apr 6, 2023
@codecov
Copy link

codecov bot commented Apr 6, 2023

Codecov Report

Patch and project coverage have no change.

Comparison is base (9c3e4c4) 99.48% compared to head (8ed9a4b) 99.48%.

❗ Current head 8ed9a4b differs from pull request most recent head 728c693. Consider uploading reports for the commit 728c693 to get more accurate results

Additional details and impacted files
@@           Coverage Diff           @@
##               v6    #4195   +/-   ##
=======================================
  Coverage   99.48%   99.48%           
=======================================
  Files         219      219           
  Lines       14361    14361           
  Branches     3277     3277           
=======================================
  Hits        14287    14287           
  Misses         73       73           
  Partials        1        1           

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@B4nan
Copy link
Member

B4nan commented Apr 6, 2023

Reset the changes, stash it and create new branch from v6.

@B4nan
Copy link
Member

B4nan commented Apr 6, 2023

Or in the end, I will be squash merging, so as long as I can do that, it should be fine.

Comment on lines 174 to 175
const author = await book2.author.load();
author.name; // sync safe access
Copy link
Member

Choose a reason for hiding this comment

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

this is not really sync-safe access - that is the $ property from Loaded type. those two examples are doing exactly the same, both using the return value of the ref.load() method

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yea I struggled with the verbiage there; what I was trying to highly was that you can save a copy of the newly loaded entity... if you'd prefer to have only one of the two, I'd advocate for the second as I think it's clearer. Thoughts?

@SpencerKaiser
Copy link
Contributor Author

I just deleted the local branch, created a new one from your v6, cherry-picked, and force pushed... all clean now 😬

@SpencerKaiser
Copy link
Contributor Author

@B4nan FYI I added a new section; I just tried to create a migrations after upgrading as a sanity check and it tried to generate a migration switching everything from timestampz(0) to timestampz. If that was intentional (I'm assuming it was), there's now a comment in the upgrading doc.

@B4nan B4nan force-pushed the v6 branch 2 times, most recently from 5165c10 to c8676e7 Compare April 12, 2023 17:50
@SpencerKaiser
Copy link
Contributor Author

SpencerKaiser commented Apr 13, 2023

@B4nan just added the mention about discouraging the use of eager with large collections. Anything else you'd like in this PR?

|--------------|------|----------|------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `entity` | `string` | `() => EntityName` | yes | Set target entity type. |
| `cascade` | `Cascade[]` | yes | Set what actions on owning entity should be cascaded to the relationship. Defaults to `[Cascade.PERSIST, Cascade.MERGE]` (see [Cascading](cascading.md)).|
| `eager` | `boolean` | yes | Always load the relationship. (Discouraged for use with large collections) |
Copy link
Member

Choose a reason for hiding this comment

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

maybe better this way? i would really discourage it for any to-many relations, simply because any collection can get large over time, turning this into a timebomb basically.

Suggested change
| `eager` | `boolean` | yes | Always load the relationship. (Discouraged for use with large collections) |
| `eager` | `boolean` | yes | Always load the relationship. (Discouraged for use with to-many relations.) |

docs/docs/upgrading-v5-to-v6.md Outdated Show resolved Hide resolved
Copy link
Member

@B4nan B4nan left a comment

Choose a reason for hiding this comment

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

one last nit, and we can merge 👍

docs/docs/decorators.md Show resolved Hide resolved
Adding a warning icon to make the header more obvious

Removing stale references to BaseEntity

Adding a section dedicated to .load

Adding a comment about the changing default for timestamps

Adding note to discourage eager with large collections

Co-authored-by: Martin Adámek <banan23@gmail.com>
|--------------|------|----------|------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `entity` | `string` &#124; `() => EntityName` | yes | Set target entity type. |
| `cascade` | `Cascade[]` | yes | Set what actions on owning entity should be cascaded to the relationship. Defaults to `[Cascade.PERSIST, Cascade.MERGE]` (see [Cascading](cascading.md)).|
| `eager` | `boolean` | yes | Always load the relationship. (Discouraged for use with to-many relations.) |
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@B4nan do the periods there bug you? If so, I can fix

@B4nan B4nan merged commit bc820e8 into mikro-orm:v6 Apr 21, 2023
5 checks passed
B4nan added a commit that referenced this pull request Apr 26, 2023
- Adding a warning icon to the upgrade notes about typescript
- Separating `.load` into a dedicated section for clarity
- Removing stale references to `BaseEntity`

<img width="1139" alt="image"
src="https://user-images.githubusercontent.com/6445731/230470881-5a2b8e24-685b-4029-9737-1ca36792c079.png">

---------

Co-authored-by: Martin Adámek <banan23@gmail.com>
jsprw pushed a commit to jsprw/mikro-orm-full-text-operators that referenced this pull request May 7, 2023
- Adding a warning icon to the upgrade notes about typescript
- Separating `.load` into a dedicated section for clarity
- Removing stale references to `BaseEntity`

<img width="1139" alt="image"
src="https://user-images.githubusercontent.com/6445731/230470881-5a2b8e24-685b-4029-9737-1ca36792c079.png">

---------

Co-authored-by: Martin Adámek <banan23@gmail.com>
B4nan added a commit that referenced this pull request May 14, 2023
- Adding a warning icon to the upgrade notes about typescript
- Separating `.load` into a dedicated section for clarity
- Removing stale references to `BaseEntity`

<img width="1139" alt="image"
src="https://user-images.githubusercontent.com/6445731/230470881-5a2b8e24-685b-4029-9737-1ca36792c079.png">

---------

Co-authored-by: Martin Adámek <banan23@gmail.com>
B4nan added a commit that referenced this pull request May 14, 2023
- Adding a warning icon to the upgrade notes about typescript
- Separating `.load` into a dedicated section for clarity
- Removing stale references to `BaseEntity`

<img width="1139" alt="image"
src="https://user-images.githubusercontent.com/6445731/230470881-5a2b8e24-685b-4029-9737-1ca36792c079.png">

---------

Co-authored-by: Martin Adámek <banan23@gmail.com>
B4nan added a commit that referenced this pull request May 24, 2023
- Adding a warning icon to the upgrade notes about typescript
- Separating `.load` into a dedicated section for clarity
- Removing stale references to `BaseEntity`

<img width="1139" alt="image"
src="https://user-images.githubusercontent.com/6445731/230470881-5a2b8e24-685b-4029-9737-1ca36792c079.png">

---------

Co-authored-by: Martin Adámek <banan23@gmail.com>
B4nan added a commit that referenced this pull request May 26, 2023
- Adding a warning icon to the upgrade notes about typescript
- Separating `.load` into a dedicated section for clarity
- Removing stale references to `BaseEntity`

<img width="1139" alt="image"
src="https://user-images.githubusercontent.com/6445731/230470881-5a2b8e24-685b-4029-9737-1ca36792c079.png">

---------

Co-authored-by: Martin Adámek <banan23@gmail.com>
B4nan added a commit that referenced this pull request Jun 11, 2023
- Adding a warning icon to the upgrade notes about typescript
- Separating `.load` into a dedicated section for clarity
- Removing stale references to `BaseEntity`

<img width="1139" alt="image"
src="https://user-images.githubusercontent.com/6445731/230470881-5a2b8e24-685b-4029-9737-1ca36792c079.png">

---------

Co-authored-by: Martin Adámek <banan23@gmail.com>
B4nan added a commit that referenced this pull request Sep 10, 2023
- Adding a warning icon to the upgrade notes about typescript
- Separating `.load` into a dedicated section for clarity
- Removing stale references to `BaseEntity`

<img width="1139" alt="image"
src="https://user-images.githubusercontent.com/6445731/230470881-5a2b8e24-685b-4029-9737-1ca36792c079.png">

---------

Co-authored-by: Martin Adámek <banan23@gmail.com>
B4nan added a commit that referenced this pull request Sep 20, 2023
- Adding a warning icon to the upgrade notes about typescript
- Separating `.load` into a dedicated section for clarity
- Removing stale references to `BaseEntity`

<img width="1139" alt="image"
src="https://user-images.githubusercontent.com/6445731/230470881-5a2b8e24-685b-4029-9737-1ca36792c079.png">

---------

Co-authored-by: Martin Adámek <banan23@gmail.com>
B4nan added a commit that referenced this pull request Sep 24, 2023
- Adding a warning icon to the upgrade notes about typescript
- Separating `.load` into a dedicated section for clarity
- Removing stale references to `BaseEntity`

<img width="1139" alt="image"
src="https://user-images.githubusercontent.com/6445731/230470881-5a2b8e24-685b-4029-9737-1ca36792c079.png">

---------

Co-authored-by: Martin Adámek <banan23@gmail.com>
B4nan added a commit that referenced this pull request Sep 30, 2023
- Adding a warning icon to the upgrade notes about typescript
- Separating `.load` into a dedicated section for clarity
- Removing stale references to `BaseEntity`

<img width="1139" alt="image"
src="https://user-images.githubusercontent.com/6445731/230470881-5a2b8e24-685b-4029-9737-1ca36792c079.png">

---------

Co-authored-by: Martin Adámek <banan23@gmail.com>
B4nan added a commit that referenced this pull request Oct 2, 2023
- Adding a warning icon to the upgrade notes about typescript
- Separating `.load` into a dedicated section for clarity
- Removing stale references to `BaseEntity`

<img width="1139" alt="image"
src="https://user-images.githubusercontent.com/6445731/230470881-5a2b8e24-685b-4029-9737-1ca36792c079.png">

---------

Co-authored-by: Martin Adámek <banan23@gmail.com>
B4nan added a commit that referenced this pull request Oct 17, 2023
- Adding a warning icon to the upgrade notes about typescript
- Separating `.load` into a dedicated section for clarity
- Removing stale references to `BaseEntity`

<img width="1139" alt="image"
src="https://user-images.githubusercontent.com/6445731/230470881-5a2b8e24-685b-4029-9737-1ca36792c079.png">

---------

Co-authored-by: Martin Adámek <banan23@gmail.com>
B4nan added a commit that referenced this pull request Oct 21, 2023
- Adding a warning icon to the upgrade notes about typescript
- Separating `.load` into a dedicated section for clarity
- Removing stale references to `BaseEntity`

<img width="1139" alt="image"
src="https://user-images.githubusercontent.com/6445731/230470881-5a2b8e24-685b-4029-9737-1ca36792c079.png">

---------

Co-authored-by: Martin Adámek <banan23@gmail.com>
B4nan added a commit that referenced this pull request Oct 25, 2023
- Adding a warning icon to the upgrade notes about typescript
- Separating `.load` into a dedicated section for clarity
- Removing stale references to `BaseEntity`

<img width="1139" alt="image"
src="https://user-images.githubusercontent.com/6445731/230470881-5a2b8e24-685b-4029-9737-1ca36792c079.png">

---------

Co-authored-by: Martin Adámek <banan23@gmail.com>
B4nan added a commit that referenced this pull request Nov 2, 2023
- Adding a warning icon to the upgrade notes about typescript
- Separating `.load` into a dedicated section for clarity
- Removing stale references to `BaseEntity`

<img width="1139" alt="image"
src="https://user-images.githubusercontent.com/6445731/230470881-5a2b8e24-685b-4029-9737-1ca36792c079.png">

---------

Co-authored-by: Martin Adámek <banan23@gmail.com>
B4nan added a commit that referenced this pull request Nov 5, 2023
- Adding a warning icon to the upgrade notes about typescript
- Separating `.load` into a dedicated section for clarity
- Removing stale references to `BaseEntity`

<img width="1139" alt="image"
src="https://user-images.githubusercontent.com/6445731/230470881-5a2b8e24-685b-4029-9737-1ca36792c079.png">

---------

Co-authored-by: Martin Adámek <banan23@gmail.com>
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.

None yet

2 participants