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

Move the Properties block to be above Functions #2908

Merged
merged 3 commits into from Apr 6, 2023

Conversation

IgnatBeresnev
Copy link
Member

@IgnatBeresnev IgnatBeresnev commented Mar 8, 2023

  • It is more consistent with the declaration order described in our coding conventions
  • There are usually less properties than functions, so it should help with not having to scroll as much to get to them

Current (that is, before this change) behaviour could be seen here: kotlinx-datetime#Instant

@qwwdfsad
Copy link
Member

qwwdfsad commented Mar 8, 2023

Could you please show how documentation (any lib will work, not necessarily datetime) looks after the change?

@IgnatBeresnev IgnatBeresnev force-pushed the move-properties-above-functions branch from 57686db to 08f77ef Compare March 8, 2023 16:08
Comment on lines +93 to +94
BasicTabbedContentType.PROPERTY,
BasicTabbedContentType.FUNCTION
Copy link
Member Author

Choose a reason for hiding this comment

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

Changing the order here doesn't actually do anything, so it's just for consistency

@IgnatBeresnev
Copy link
Member Author

Could you please show how documentation (any lib will work, not necessarily datetime) looks after the change?

If you want a live demo to be able to click around:

  1. Open up the GitHub actions dropdown of this PR, you'll see one of Build example projects and publish them to s3. Go to details
  2. Open up Print link:

2023-03-08_17-04-43

But the link is dynamic based on the latest commit, and one branch can only have one live preview, so it's not permanent. These previews are also published to GitHub artifacts as zip archives.

If the goal is to preserve context / improve description, I can certainly make a screenshot or upload the live preview to a more permanent hosting, just let me know


Had to change the order of the actual blocks, updated and force-pushed the branch

@IgnatBeresnev
Copy link
Member Author

IgnatBeresnev commented Mar 14, 2023

An argument for this change: with Kotlin as Java applied, it's rather strange to first see the functions and then the properties

2023-03-14_01-38-34

@qwwdfsad
Copy link
Member

I've skimmed through the generated documentation, few things caught my eye (I'm not sure they are relevant to this PR, though, so feel free to proceed):

Copy link
Member

@qwwdfsad qwwdfsad left a comment

Choose a reason for hiding this comment

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

Semantically, the change looks good (better and more natural than it was 👍).

It would be nice to have some tests on it or documentation though, so any accidental order change will lead to a build failure

BasicTabbedContentType.PROPERTY,
BasicTabbedContentType.FUNCTION,
Copy link
Member

Choose a reason for hiding this comment

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

Would be nice to drop a comment about the order's meaning and why the order is the way it is

Copy link
Member Author

Choose a reason for hiding this comment

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

Unfortunately, here the order doesn't make any difference, even though I expected it would :( Here it's purely cosmetic and I made the change for consistency. Something tells me leaving a comment like that here could be confusing down the road..

I'll write the tests for the true order though

@IgnatBeresnev
Copy link
Member Author

I've skimmed through the generated documentation, few things caught my eye (I'm not sure they are relevant to this PR, though, so feel free to proceed):

https://dokka-snapshots.s3.eu-central-1.amazonaws.com/move-properties-above-functions/coroutines/08f77ef/kotlinx-coroutines-core/kotlinx.coroutines.flow/-shared-flow/index.html shared flow link is broken (I have to press on common selector)
https://dokka-snapshots.s3.eu-central-1.amazonaws.com/move-properties-above-functions/coroutines/08f77ef/kotlinx-coroutines-core/kotlinx.coroutines/-coroutine-scope/index.html a bit weird empty "properties" tab

I've looked at the links and I don't see what's wrong :( Maybe there's something wrong with the cached styles or something?

The "properties" tab is not empty for me

screenshot

2023-04-06_21-09-38

and all links work for me, not sure which one exactly you mean and how pressing the "common" selector can help with it :(

I'll try to remember to bring it up during one of the syncs, but I might forget

@IgnatBeresnev IgnatBeresnev force-pushed the move-properties-above-functions branch from 08f77ef to 0a97005 Compare April 6, 2023 19:36
@IgnatBeresnev IgnatBeresnev merged commit 21afcb4 into master Apr 6, 2023
31 checks passed
@IgnatBeresnev IgnatBeresnev deleted the move-properties-above-functions branch April 6, 2023 22:20
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

3 participants