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

Replace use of deprecated 'numbered' attribute by 'sectnums' #1124

Conversation

abelsromero
Copy link
Member

@abelsromero abelsromero commented Oct 12, 2022

Thank you for opening a pull request and contributing to AsciidoctorJ!

Please take a bit of time giving some details about your pull request:

Kind of change

  • Bug fix
  • New non-breaking feature
  • New breaking feature
  • Documentation update
  • Build improvement
  • Other 👉 maintenance chore

Description

What is the goal of this pull request?

Replace use of deprecated attribute numbered by recommended value sectnums.

How does it achieve that?

Are there any alternative ways to implement this?

No

Are there any implications of this pull request? Anything a user must know?

Only for users comparing the attibute with the internal value will notice. I personally don't consider that a breaking change since constants should be used to replace manually set values and the internal value should not be checked.

  • Theres no impact for users using the constant or AttributesBuilder normally.
  • Conversions setting "numbered" manually will still work since is still supported in the Ruby core.

Issue

If this PR fixes an open issue, please add a line of the form:

Fixes #1120

Release notes

Please add a corresponding entry to the file CHANGELOG.adoc

@abelsromero abelsromero force-pushed the issue-1120-replace-deprecated-numbered-by-sectnums branch from 0780375 to a1815ad Compare October 12, 2022 16:22
@abelsromero abelsromero force-pushed the issue-1120-replace-deprecated-numbered-by-sectnums branch from a1815ad to 4470095 Compare October 12, 2022 16:24
@robertpanzer
Copy link
Member

Thank you!

I wasn't aware that the numbered attribute is deprecated, I found the corresponding comment here:
https://docs.asciidoctor.org/asciidoctor/latest/migrate/asciidoc-py/#updated-and-deprecated-asciidoc-syntax

Since we're changing the value of a constant users should be aware though that they need to recompile their code to use the new value of the constant. In my experience constants that are public static final are usually copied into the class of the referencing site.

@robertpanzer robertpanzer merged commit 5e0955f into asciidoctor:main Oct 15, 2022
@abelsromero
Copy link
Member Author

abelsromero commented Oct 15, 2022

Since we're changing the value of a constant users should be aware though that they need to recompile their code to use the new value of the constant. In my experience constants that are public static final are usually copied into the class of the referencing site.

I have no issue if this needs to go into a major release. To me it's not technically a breaking change, but it's true the compiler embeds the values and that can bring suprises, making it "breaking" in effect. 😞

@robertpanzer
Copy link
Member

I checked that even when setting the attribute numbered a converter or extension would see the attribute sectnums.
I guess it's indeed safe then to consider it as a minor change and pull it into the v2.5.x branch.
I'll take care of that.

@abelsromero abelsromero deleted the issue-1120-replace-deprecated-numbered-by-sectnums branch April 21, 2023 08:25
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.

Replace internal use of numbered attribute by sectnums
2 participants