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

!!! TASK: Remove deprecated Fusion prototypes #4537

Merged
merged 1 commit into from
Oct 9, 2023

Conversation

mficzel
Copy link
Member

@mficzel mficzel commented Sep 19, 2023

The following Fusion prototypes were deprecated for a long time and have been removed. While the documentation has been removed a section "Removed Fusion Prototypes" is added to the reference that mentions the old names and their replacements.

  • Neos.Fusion:Array has been removed in favor of Neos.Fusion:Join
  • Neos.Fusion:RawArray has been removed in favor of Neos.Fusion:DataStructure
  • Neos.Fusion:Collection has been removed in favor of Neos.Fusion:Loop
  • Neos.Fusion:RawCollection has been removed in favor of Neos.Fusion:Map
  • Neos.Fusion:Attributes as been removed in favor of the property attributes in Neos.Fusion:Tag

The prototype Neos.Fusion:UriBuilder is deprecated aswell but not as long as the others. The fusion file was moved to the deprecated folder and the documentation was moved to the deprecated section.

Resolves: #4538

Upgrade instructions

The following prototypes have to be replaced as mentioned.

  • Neos.Fusion:Array replace with Neos.Fusion:Join
  • Neos.Fusion:RawArray replaced with Neos.Fusion:DataStructure
  • Neos.Fusion:Collection replaced with Neos.Fusion:Loop and the property children has to be renamed to items
  • Neos.Fusion:RawCollection replaced with Neos.Fusion:Map and the property children has to be renamed to items
  • Neos.Fusion:Attributes replaced by the property attributes in Neos.Fusion:Tag

The prototype Neos.Fusion:UriBuilder should be replaced with Neos.Fusion:ActionUri but will
still work for now.

Since renaming of children to items may not always be obvious in cases where inheritance is used the following line
can add a fallback from items to children:

prototype(Neos.Fusion:Map) {
    items = ${this.children}
}
prototype(Neos.Fusion:Loop) {
    items = ${this.children}
}

Review instructions

Checklist

  • Code follows the PSR-2 coding style
  • Tests have been created, run and adjusted as needed
  • The PR is created against the lowest maintained branch
  • Reviewer - PR Title is brief but complete and starts with FEATURE|TASK|BUGFIX
  • Reviewer - The first section explains the change briefly for change-logs
  • Reviewer - Breaking Changes are marked with !!! and have upgrade-instructions

@mficzel mficzel changed the title TASK: Remove deprecated fusion prototypes TASK: Remove deprecated Fusion prototypes Sep 19, 2023
@mficzel mficzel force-pushed the task/removeDeprecatedFusionPrototypes branch from 142fa0b to 2b7896d Compare September 19, 2023 15:43
@mficzel mficzel marked this pull request as ready for review September 19, 2023 15:49
@mficzel mficzel force-pushed the task/removeDeprecatedFusionPrototypes branch 2 times, most recently from 2e681bc to 665039a Compare September 19, 2023 16:01
@mficzel
Copy link
Member Author

mficzel commented Sep 19, 2023

Maybe we should add a migration to do the basic renaming. The change from Collection -> children to Loop -> items cannot be migrated easyly but everything else could.

Question would be rector or classic code migration.

@mhsdesign
Copy link
Member

@mficzel i might have an idea to do a full migration of all the prototypes correctly including "collection" to "items" ... but i want to discuss this with you first ;)

@mficzel
Copy link
Member Author

mficzel commented Sep 20, 2023

i might have an idea

I like and am curious. If this would be a rector based solution it should not stop this pr from beeing merged.
Also it would imho be fine to migrate

test = Neos.Fusion:RawCollection {
   ... 
}

to

# @todo the key `children` has to be renamed to `items` which cannot be done automatically
test = Neos.Fusion:Map {
   ... 
}

@mhsdesign
Copy link
Member

On the other hand even in the biggest client project i only have around 80 matches when looking for the legacy "collection" fusion key.

i used this regex to ignore ${this.collection} and {props.collection} in the results:

(?<!\$?\{.*)\bcollection\b

of course there are many false positives that need to be ignored (because some component uses the collection prop itself, but id say its way safer and more pragmatic to migrate those cases by hand. (same for children to items ...)

My suggested automated way would throw away all fusion comments and reformat the code ... or we first have to adjust the parsing ...

@mficzel
Copy link
Member Author

mficzel commented Sep 20, 2023

In here it makes sense mostly to decide wether we want a rector migration or not as this would be a separate pr with room for discussion. In here we could only add classic code-migrations.

@mficzel mficzel force-pushed the task/removeDeprecatedFusionPrototypes branch from 665039a to 2d4f16b Compare September 20, 2023 20:57
Copy link
Member

@jonnitto jonnitto left a comment

Choose a reason for hiding this comment

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

So much code has been deleted. I like

@manuelmeister
Copy link
Contributor

Will look at the updated documentation for this, to ensure everything is beginner friendly (with keeping in mind that legacy code examples are floating around the web)

Copy link
Member

@mhsdesign mhsdesign 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!

I couldnt find any left overs in the codebase.

@mhsdesign mhsdesign mentioned this pull request Sep 23, 2023
7 tasks
@mhsdesign
Copy link
Member

Found some old fusion inside the neos ui e2e tests which needs to be adjusted ^^ https://github.com/neos/neos-ui/tree/9.0/Tests/IntegrationTests/TestDistribution/DistributionPackages

Copy link
Contributor

@manuelmeister manuelmeister left a comment

Choose a reason for hiding this comment

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

I think the Fusion Reference should be rewritten as well. Currently there are several places where references to old prototypes are made. The wording for DataStructure may profit from mentioning that this is probably the "real" array type someone might be looking for.

Neos.Neos/Documentation/References/NeosFusionReference.rst Outdated Show resolved Hide resolved
@mficzel mficzel force-pushed the task/removeDeprecatedFusionPrototypes branch from 2d4f16b to 32eab19 Compare October 5, 2023 07:24
The following Fusion prototypes are deprecated for a long time and have been removed. While the documentation has been removed a section "Removed Fusion Prototypes" is added to the reference that mentions the old names and their replacements.

* `Neos.Fusion:Array` has been removed in favor of `Neos.Fusion:Join`
* `Neos.Fusion:RawArray` has been removed in favor of `Neos.Fusion:DataStructure`
* `Neos.Fusion:Collection` has been removed in favor of `Neos.Fusion:Loop`
* `Neos.Fusion:RawCollection` has been removed in favor of `Neos.Fusion:Map`
* `Neos.Fusion:Attributes` as been removed in favor of the property `attributes` in `Neos.Fusion:Tag`

The prototype `Neos.Fusion:UriBuilder` is deprecated aswell but not as long as the others. The fusion file was moved to the deprecated folder and the documentation was moved to the deprecated section.
@mficzel mficzel force-pushed the task/removeDeprecatedFusionPrototypes branch from 32eab19 to 300ca7b Compare October 5, 2023 07:27
@mhsdesign mhsdesign merged commit e76f05d into 9.0 Oct 9, 2023
5 checks passed
@mhsdesign mhsdesign deleted the task/removeDeprecatedFusionPrototypes branch October 9, 2023 07:59
@mficzel mficzel changed the title TASK: Remove deprecated Fusion prototypes !!! TASK: Remove deprecated Fusion prototypes Oct 9, 2023
manuelmeister added a commit to manuelmeister/neos-development-collection that referenced this pull request Oct 26, 2023
ahaeslich added a commit to ahaeslich/neos-development-collection that referenced this pull request Nov 6, 2023
…Component

The NodeType fusion renderer is now pure fusion, the behavior including attributes is kept.

Relates: neos#4537
Relates: neos#4705
ahaeslich added a commit to ahaeslich/neos-development-collection that referenced this pull request Nov 6, 2023
…is now a ContentComponent

The NodeType fusion renderer is now pure fusion, the behavior including attributes is kept.

Relates: neos#4537
Relates: neos#4705
ahaeslich added a commit to ahaeslich/neos-development-collection that referenced this pull request Nov 6, 2023
…onent

The NodeType fusion renderer is now pure fusion, the behavior including attributes is kept.

Relates: neos#4537
Relates: neos#4705
ahaeslich added a commit to ahaeslich/neos-development-collection that referenced this pull request Nov 6, 2023
…ents

The NodeType fusion renderer is now pure fusion, the behavior including attributes is kept.

Relates: neos#4537
Relates: neos#4705
ahaeslich added a commit to ahaeslich/neos-development-collection that referenced this pull request Nov 6, 2023
The NodeType fusion renderer is now pure fusion, the behavior including attributes is kept.

Relates: neos#4537
Relates: neos#4705
ahaeslich added a commit to ahaeslich/neos-development-collection that referenced this pull request Nov 6, 2023
The NodeType fusion renderer is now pure fusion, the behavior including attributes is kept.

Relates: neos#4537
Relates: neos#4705
ahaeslich added a commit to ahaeslich/neos-development-collection that referenced this pull request Nov 9, 2023
Adjust rendering to match previous fluid based output. Remove unused fluid template.

Relates: neos#4537
Relates: neos#4623
ahaeslich added a commit to ahaeslich/neos-development-collection that referenced this pull request Nov 9, 2023
Use `Neos.Fusion:Template` to render only the fluid form via old template file.

Relates: neos#4537
Relates: neos#4705
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.

TASK: Remove deprecated Fusion prototypes
5 participants