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

Deprecate all JavaScript instance properties the except init method #3499

Merged
merged 4 commits into from
Apr 13, 2023

Conversation

36degrees
Copy link
Contributor

We'll be clarifying our public API in v5, which means we will either not support or prevent access to some of the properties currently available on our components.

Deprecate everything except the init method to make people aware of this ahead of time to give them as much time as possible to anticipate the change.

Closes #3473.

We'll be clarifying our public API in v5, which means we will either not support or prevent access to some of the properties currently available on our components.

Deprecate everything except the `init` method to make people aware of this ahead of time to give them as much time as possible to anticipate the change.
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-pr-3499 April 12, 2023 12:20 Inactive
@36degrees 36degrees changed the title Mark all JS methods except ‘init’ as deprecated Deprecate all JavaScript API methods except ‘init’ Apr 12, 2023
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-pr-3499 April 12, 2023 12:27 Inactive
@36degrees 36degrees changed the title Deprecate all JavaScript API methods except ‘init’ Deprecate all JavaScript API methods except init Apr 12, 2023
@36degrees 36degrees marked this pull request as ready for review April 12, 2023 12:33
CHANGELOG.md Outdated

All JavaScript methods in the API for our JavaScript components except `init` are now deprecated, and will be made private in v5.0.

If you're calling a method other than `init`, [please tell us by filling in this form](https://docs.google.com/forms/d/e/1FAIpQLSfmH2AitMeouXqB0FWC5p5e6y1TSiFCjmJ8DrVuwfmpRGCaWw/viewform?usp=sf_link). We'll use this information when prioritising future additions to the public API.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Please review the content and structure of the linked Google Form as well. I've pinged @claireashworth to get her thoughts on it too.

@36degrees 36degrees changed the title Deprecate all JavaScript API methods except init Deprecate all JavaScript API methods and instance properties except init Apr 12, 2023
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-pr-3499 April 12, 2023 14:06 Inactive
@36degrees 36degrees changed the title Deprecate all JavaScript API methods and instance properties except init Deprecate all JavaScript instance properties the except init method Apr 12, 2023
@36degrees 36degrees force-pushed the deprecate-js-methods branch from 90577be to c84b53c Compare April 12, 2023 14:29
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-pr-3499 April 12, 2023 14:30 Inactive
CHANGELOG.md Outdated
@@ -64,6 +64,14 @@ This was added in [pull request #2230: Add extra letter spacing modifier for inp

### Deprecated features

#### Stop using JavaScript API properties other than the `init` method

All JavaScript properties in the API for our JavaScript components except for the `init` method are now deprecated, and will be made private in v5.0.
Copy link
Contributor

@claireashworth claireashworth Apr 12, 2023

Choose a reason for hiding this comment

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

Suggested change
All JavaScript properties in the API for our JavaScript components except for the `init` method are now deprecated, and will be made private in v5.0.
We have deprecated all of the JavaScript properties in the API. The exception to this is the init method for each component, which remains public. We will make all the deprecated JavaScript properties private in v5.0.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

What about this, to avoid some of the repetition? (Especially 'JavaScript' which was already in there twice…)

We have deprecated all of the JavaScript properties in the API except for the init method. We will make them private in v5.0.

Copy link
Contributor

Choose a reason for hiding this comment

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

I repeated as the last thing mentioned in the previous sentence in the init method, which means grammatically 'them' would refer to the init method. I shall shuffle things...

Copy link
Contributor

Choose a reason for hiding this comment

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

I've amended my suggestion - does that work?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think the version with the repetition was better – this one seems to slightly contradict itself. What about:

We have deprecated all of the JavaScript properties in the API, except for the init method for each component. We will make all the deprecated JavaScript properties private in v5.0.

Copy link
Contributor

Choose a reason for hiding this comment

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

Sold! Just needs an extra comma after '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.

Trying to break it down:

  • We have deprecated all of the JavaScript properties in the API.
  • The exception to this is the init method for each component, which remains public.

With the additional comma I think it would read as:

  • We have deprecated all of the JavaScript properties in the API for every component.
  • The exception to this is the init method, which remains public.

Which isn't quite right – every component has an init method, which will remain public; and there are also parts of the API that aren't part of any component.

Copy link
Contributor

Choose a reason for hiding this comment

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

So I've changed the suggestion to your 3 sentences.

@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-pr-3499 April 12, 2023 14:44 Inactive
@36degrees 36degrees force-pushed the deprecate-js-methods branch from efb9c42 to 9b8c313 Compare April 12, 2023 14:49
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-pr-3499 April 12, 2023 14:49 Inactive
@colinrotherham colinrotherham self-requested a review April 12, 2023 14:54
Copy link
Contributor

@colinrotherham colinrotherham left a comment

Choose a reason for hiding this comment

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

Approving but feel free to find more things to deprecate 😊

Copy link
Member

@romaricpascal romaricpascal left a comment

Choose a reason for hiding this comment

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

Looks good to me as well (both code and form), thanks for going through all these files Ollie 🙌🏻

@36degrees 36degrees force-pushed the deprecate-js-methods branch from 9b8c313 to 21e0ac5 Compare April 13, 2023 14:26
@govuk-design-system-ci govuk-design-system-ci temporarily deployed to govuk-frontend-pr-3499 April 13, 2023 14:26 Inactive
@36degrees 36degrees merged commit a728223 into main Apr 13, 2023
@36degrees 36degrees deleted the deprecate-js-methods branch April 13, 2023 14:31
@romaricpascal romaricpascal mentioned this pull request Apr 20, 2023
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.

Deprecate properties that will no longer be part of the public API
5 participants