-
-
Notifications
You must be signed in to change notification settings - Fork 15
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
Change inline node deprecation and fix deprecations in the codebase #1184
Open
wouterj
wants to merge
5
commits into
phpDocumentor:main
Choose a base branch
from
wouterj:inline-content-deprecation
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
11a5bc2
Cleanup inline node constructors signature
wouterj 69dc8aa
Show deprecations while running tests
wouterj 4b83571
Fix deprecations in the codebase
wouterj 3b2a3c7
Add baseline for indirect deprecations
wouterj 832f346
Fix Twig deprecation
wouterj File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
17 changes: 8 additions & 9 deletions
17
packages/guides-graphs/resources/template/html/body/uml.html.twig
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,8 @@ | ||
{% apply spaceless %} | ||
<figure | ||
class="uml-diagram{% if node.classesString %} {{ node.classesString }}{% endif %}" | ||
{% if node.hasOption('width') %}style="width: {{ node.option('width') }}"{% endif %} | ||
> | ||
{{ uml(node.value) }} | ||
{% if node.caption %}<figcaption>{{ node.caption }}</figcaption>{% endif %} | ||
</figure> | ||
{% endapply %} | ||
<figure class="uml-diagram{% if node.classesString %} {{ node.classesString }}{% endif %}" | ||
{%- if node.hasOption('width') %} style="width: {{ node.option('width') }}"{% endif -%} | ||
> | ||
{{ uml(node.value) }} | ||
{% if node.caption %} | ||
<figcaption>{{ node.caption }}</figcaption> | ||
{% endif %} | ||
</figure> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
packages/guides-theme-rst/resources/template/rst/inline/emphasis.rst.twig
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
*{{- node.value|raw -}}* | ||
*{{- node|plaintext -}}* | ||
6 changes: 3 additions & 3 deletions
6
packages/guides-theme-rst/resources/template/rst/inline/link.rst.twig
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
{%- if node.url -%} | ||
`{{ node.value|raw }} <{{- node.url -}}>`__ | ||
`{{ node|plaintext }} <{{- node.url -}}>`__ | ||
{%- elseif node.targetReference -%} | ||
:doc:`{{ node.value|raw }} <{{- node.targetReference -}}>` | ||
:doc:`{{ node|plaintext }} <{{- node.targetReference -}}>` | ||
{%- else -%} | ||
{{- node.value -}} | ||
{{- node|plaintext -}} | ||
{%- endif -%} |
2 changes: 1 addition & 1 deletion
2
packages/guides-theme-rst/resources/template/rst/inline/strong.rst.twig
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
**{{- node.value|raw -}}** | ||
**{{- node|plaintext -}}** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When I introduced the inline nested nodes I did use the value because that would not require a change in the templates. As templates can be overwritten by consuming projects. I did see that as a backward compatibility issue.
This was the reason to try to be backwards compatible and accept the issues in our pipeline. How do you see that? Bc in templates is a very complex problem as I experienced in the past. But maybe I will try to be too strict about this project?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure I can follow you. The original content still works, but triggers a deprecation. Are you thinking of a case where the user overrides
getValue()
of a node that now has a BC break because it isn't called anymore?You can use
Deprecation::triggerIfCalledFromOutside()
ingetValue()
then (or the Symfony tactic: add a virtual new boolean parameter togetValue()
that determines whether the deprecation should be triggered). This should not produce a deprecation when called from a Guides template, but does when called by a user.In general, deprecations are most useful if all of them can be fixed by a user without upgrading the package triggering the deprecation. If Guides triggers a deprecation from itself, I would never know if I can safely upgrade to 2.0.