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

PageLayout: add @deprecated notice to PageLayout.Pane position prop #3597

Closed
wants to merge 5 commits into from

Conversation

siddharthkp
Copy link
Member

@siddharthkp siddharthkp commented Aug 7, 2023

UPDATED DESCRIPTION: We are only adding @deprecated TS annotation to the position prop in this PR due to the reasons mentioned below. We also updated the docs accordingly to encourage to drop the usage of the position prop.



Reasons for revert, copied from #3589:

production (before) upgrade branch (after)
Sidebar in hyperlist is on the left Sidebar in hyperlist is on the left Sidebar in hyperlist is on the right Sidebar in hyperlist is on the right

We would need to bring this change back in a way that it allows new behaviour without breaking existing behaviour.

Important: It seems like the same pull request number is also merged in next-major? Link to next-major release tracking That seems very fishy? Was this not supposed to be in main at all?

@changeset-bot
Copy link

changeset-bot bot commented Aug 7, 2023

🦋 Changeset detected

Latest commit: bb09614

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@primer/react Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions
Copy link
Contributor

github-actions bot commented Aug 7, 2023

size-limit report 📦

Path Size
dist/browser.esm.js 104.66 KB (0%)
dist/browser.umd.js 105.21 KB (0%)

@siddharthkp siddharthkp changed the title Bring back #3389 + #3545 PageLayout.Pane: Undo deprecation for position prop + Remove warning for the deprecated position prop Bring back #3389 (PageLayout.Pane: Undo deprecation for position prop) + #3545 (Remove warning for the deprecated position prop) Aug 7, 2023
@siddharthkp siddharthkp temporarily deployed to github-pages August 7, 2023 13:25 — with GitHub Actions Inactive
@github-actions github-actions bot temporarily deployed to storybook-preview-3597 August 7, 2023 13:25 Inactive
@broccolinisoup
Copy link
Member

@siddharthkp should we take the implementation changes back (everything on PageLayout.tsx except the deprecation notice) and can tackle how to introduce the actual deprecation in a follow up PR? Reasons for that proposal:

  1. The issue seems to be opened last year, we should stop folks using the position prop at least with the deprecation notice and docs update to prevent further inaccessible usage.
  2. Seems like we will eventually need to fix the usages (re-order the Pane correctly after removing the position prop) at dotcom anyway to keep the UI same. So we can buy sometime by releasing the deprecation notice and see how to introduce the changes to dotcom

Thoughts?? cc @radglob

@broccolinisoup
Copy link
Member

Oh funny thing is that I just saw that we have a task to re-order the PageLayout.Pane if position is in used in v36 issue https://github.com/github/primer/issues/2516 we can just deprecate and handle it as a v36 follow up?

@radglob radglob self-requested a review August 9, 2023 13:32
@radglob
Copy link
Contributor

radglob commented Aug 9, 2023

@siddharthkp should we take the implementation changes back (everything on PageLayout.tsx except the deprecation notice) and can tackle how to introduce the actual deprecation in a follow up PR? Reasons for that proposal:

  1. The issue seems to be opened last year, we should stop folks using the position prop at least with the deprecation notice and docs update to prevent further inaccessible usage.
  2. Seems like we will eventually need to fix the usages (re-order the Pane correctly after removing the position prop) at dotcom anyway to keep the UI same. So we can buy sometime by releasing the deprecation notice and see how to introduce the changes to dotcom

Thoughts?? cc @radglob

Since warnings break in dotcom, we need another way to communicate that these changes need to be made. There's a PR merged into next-major that completely removes support for position. The change that was reverted in this was intended to still respond to the position prop if present. I had tested that in storybook, but I must have missed some detail.

@broccolinisoup

This comment was marked as duplicate.

broccolinisoup

This comment was marked as outdated.

@broccolinisoup broccolinisoup self-requested a review August 14, 2023 04:59
Copy link
Member

@broccolinisoup broccolinisoup left a comment

Choose a reason for hiding this comment

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

accidently approved the changes - I only wanted to leave comment. So taking it back! Sorry.

@broccolinisoup broccolinisoup self-requested a review August 14, 2023 05:00
Copy link
Member

@broccolinisoup broccolinisoup left a comment

Choose a reason for hiding this comment

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

No worries @radglob! We removed the warnings as well because they were breaking as you said (#3545) but without the warnings, it still breaks dotcom. (Reference is the screenshot in the description and the pane moved to the right side but supposed to be on the left)

There's a PR merged into next-major that completely removes support for position.

This is great!

Since warnings break in dotcom, we need another way to communicate that these changes need to be made.

We have TS @deprecated annotation and this should be a good way to communicate the deprecation.

I feel like there is really not much else to do here. (Unless I am missing something). We can only release the @deprecated annotation in this PR and worry about the rest of the changes in the major release but seems like we already have a branch to merged to next-major to remove the support for position so maybe we are all good?

@radglob
Copy link
Contributor

radglob commented Aug 14, 2023

No worries @radglob! We removed the warnings as well because they were breaking as you said (#3545) but without the warnings, it still breaks dotcom. (Reference is the screenshot in the description and the pane moved to the right side but supposed to be on the left)

There's a PR merged into next-major that completely removes support for position.

This is great!

Since warnings break in dotcom, we need another way to communicate that these changes need to be made.

We have TS @deprecated annotation and this should be a good way to communicate the deprecation.

I feel like there is really not much else to do here. (Unless I am missing something). We can only release the @deprecated annotation in this PR and worry about the rest of the changes in the major release but seems like we already have a branch to merged to next-major to remove the support for position so maybe we are all good?

Yeah, that makes sense to me.

@@ -530,7 +564,7 @@ const Pane = React.forwardRef<HTMLDivElement, React.PropsWithChildren<PageLayout
{
'aria-label': label,
'aria-labelledby': labelledBy,
position: responsivePosition = 'end',
position: responsivePosition = undefined,
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we should drop these changes for handling an undefined position prop. It adds extra complexity, and "end" is a reasonable default since everything should just flow as it would by source position alone.

The TS deprecation warning is enough to get the point across until next-major is merged in (which fully removes support for this).

Copy link
Member

Choose a reason for hiding this comment

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

Agreed! I also think we won't need the other implementation changes in this minor PR since we are only introducing a deprecation notice. Am I missing anything? I pushed a commit to take all them back and leave only the docs and deprecation notice but let me know what you think and if the other changes needed as well! @radglob

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, that sounds right to me.

@broccolinisoup broccolinisoup temporarily deployed to github-pages August 15, 2023 09:11 — with GitHub Actions Inactive
@github-actions github-actions bot temporarily deployed to storybook-preview-3597 August 15, 2023 09:11 Inactive
@broccolinisoup broccolinisoup force-pushed the revert-3589-revert-3389 branch from 55b51a2 to f3f56d3 Compare August 15, 2023 09:14
@broccolinisoup broccolinisoup temporarily deployed to github-pages August 15, 2023 09:20 — with GitHub Actions Inactive
@github-actions github-actions bot temporarily deployed to storybook-preview-3597 August 15, 2023 09:20 Inactive
@broccolinisoup broccolinisoup requested a review from radglob August 17, 2023 06:05
@broccolinisoup broccolinisoup marked this pull request as ready for review August 17, 2023 06:05
@broccolinisoup broccolinisoup requested a review from a team August 17, 2023 06:05
@broccolinisoup
Copy link
Member

@radglob great! We can merge this once I clear the integration issues due to #3561

@siddharthkp siddharthkp marked this pull request as draft August 17, 2023 15:25
@broccolinisoup broccolinisoup changed the title Bring back #3389 (PageLayout.Pane: Undo deprecation for position prop) + #3545 (Remove warning for the deprecated position prop) PageLayout: add @deprecated notice to PageLayout.Pane position prop Aug 24, 2023
@broccolinisoup broccolinisoup temporarily deployed to github-pages August 24, 2023 06:45 — with GitHub Actions Inactive
@github-actions github-actions bot temporarily deployed to storybook-preview-3597 August 24, 2023 06:46 Inactive
@github-actions
Copy link
Contributor

Hi! This pull request has been marked as stale because it has been open with no activity for 60 days. You can comment on the pull request or remove the stale label to keep it open. If you do nothing, this pull request will be closed in 7 days.

@github-actions github-actions bot added the Stale label Oct 27, 2023
@lesliecdubs
Copy link
Member

Bump, is this something we want to revive or should we close? @broccolinisoup what do you think?

@github-actions github-actions bot removed the Stale label Oct 28, 2023
@broccolinisoup
Copy link
Member

Thanks @lesliecdubs for the ping! This was supposed to be realised in a minor version until we remove the position prop in v36.

@joshblack Do you think it still worths to release the @deprecated prop in the meantime or if there is a chance/risk that we might not be able to include this change in v36? We can act depend on how the position prop changes are going in v36.

@broccolinisoup
Copy link
Member

Just had a chat with @joshblack and it is better to close this PR because removing the position prop couldn't make its way to v36 due to roll out complications. We can add a @deprecated notice when we have a roll out strategy for removing the position prop 🔥

@broccolinisoup broccolinisoup deleted the revert-3589-revert-3389 branch November 7, 2023 06:37
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