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

deprecation(path): split off all constants into their own files and deprecate old names #4153

Merged
merged 10 commits into from
Jan 18, 2024

Conversation

lino-levan
Copy link
Contributor

Closes #4070.

@lino-levan lino-levan requested a review from kt3k as a code owner January 10, 2024 18:08
@github-actions github-actions bot added the path label Jan 10, 2024
Copy link
Contributor

@iuioiua iuioiua left a comment

Choose a reason for hiding this comment

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

LGTM! However, I wonder whether it might be worth having a constants.ts instead. That'd be 3 fewer files, and next-to-no added dependency cost. Doing so would require deprecating separator.ts files. WDYT, @lino-levan and @kt3k?

@lino-levan
Copy link
Contributor Author

I'm neutral on this. I'm curious to hear what @kt3k thinks.

@kt3k
Copy link
Member

kt3k commented Jan 11, 2024

However, I wonder whether it might be worth having a constants.ts instead. That'd be 3 fewer files, and next-to-no added dependency cost. Doing so would require deprecating separator.ts files.

constants.ts sounds good to me.

@iuioiua
Copy link
Contributor

iuioiua commented Jan 11, 2024

@lino-levan, are you able to reorient this PR to instead introduce constants.ts files?

@lino-levan
Copy link
Contributor Author

Yup, let me do that right now.

@lino-levan lino-levan changed the title chore(path): split off delimiter into its own file deprecation(path): split off all constants into their own files and deprecate old names Jan 12, 2024
@lino-levan lino-levan requested a review from iuioiua January 12, 2024 16:17
@@ -1,5 +1,11 @@
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
// This module is browser compatible.

/**
* @deprecated (will be removed in 1.0.0) Use "separator" in https://deno.land/std@$STD_VERSION/path/posix/constants.ts instead.
Copy link
Member

Choose a reason for hiding this comment

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

I don't think the IDE (deno lsp) can render $STD_VERSION part as the corresponding version number, and this url notation can be confusing. How about just omitting the urls in deprecation notes?

Copy link
Contributor

Choose a reason for hiding this comment

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

Including URLs is fine if the @$STD_VERSION portion is omitted. The documentation should be rendered fine if we also wrap the URL in a {@link <url>} tag. E.g. the win32 export in path/mod.ts renders correctly.

@iuioiua
Copy link
Contributor

iuioiua commented Jan 14, 2024

I've made some tweaks, Lino. Please tell me what you think.

  1. Changed the constant names to be uppercase. This is a common convention. I think it's fine to also do this in path/constants.ts, even though it's evaluated based on the current platform, as it never changes after this evaluation.
  2. Aligned JSDocs of the deprecated constants with others in the codebase, using @linkcode and @link tags.
  3. Brought the removal version forward to 0.216.0, as this should be an easy change in user code (debatable).

The one thing remaining is moving any internal use of the deprecated constants to the new ones. Are you able to do this?

@lino-levan
Copy link
Contributor Author

Changed the constant names to be uppercase. This is a common convention. I think it's fine to also do this in path/constants.ts, even though it's evaluated based on the current platform, as it never changes after this evaluation.

Had no strong feelings either way. Didn't want to bikeshed on it so just picked one idea and ran with it. SGTM.

Aligned JSDocs of the deprecated constants with others in the codebase, using @linkcode and @link tags.

I really need to learn how those work. Thanks!

Brought the removal version forward to 0.216.0, as this should be an easy change in user code (debatable).

Picked 1.0.0 for same (lack of) reason as number 1. SGTM, thanks.

The one thing remaining is moving any internal use of the deprecated constants to the new ones. Are you able to do this?

Busy tonight, I mentally made a note to do it, but then I forgot to. Will get to it tomorrow if you don't want to do it right now.

@iuioiua
Copy link
Contributor

iuioiua commented Jan 14, 2024

Busy tonight, I mentally made a note to do it, but then I forgot to. Will get to it tomorrow if you don't want to do it right now.

No rush for now 🙂

Copy link
Contributor

@iuioiua iuioiua left a comment

Choose a reason for hiding this comment

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

I've made a couple of tweaks and fixes. Now, LGTM! I'll let Yoshiya do the final review.

export function common(paths: string[], sep: typeof SEP = SEP): string {
export function common(
paths: string[],
sep: string = SEPARATOR,
Copy link
Contributor

@iuioiua iuioiua Jan 17, 2024

Choose a reason for hiding this comment

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

Sidenote: I see no use case for this sep argument. Ditto for the Windows version. Perhaps, it should be deprecated in another separate PR.

Copy link
Contributor Author

@lino-levan lino-levan Jan 18, 2024

Choose a reason for hiding this comment

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

Probably work for another PR, but this makes sense 👍

Copy link
Member

@kt3k kt3k left a comment

Choose a reason for hiding this comment

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

LGTM. Nice work!

@kt3k kt3k merged commit 18d6a0e into denoland:main Jan 18, 2024
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

suggestion(path): introduce delimiter.ts files
3 participants