Skip to content

TASK: Introduce global getConfiguration() and cleanup configuration provider#4012

Merged
mhsdesign merged 23 commits intoneos:9.0from
mhsdesign:task/introduce-neos-ui-configuration-package-and-cleanup-configuration-provider
Nov 11, 2025
Merged

TASK: Introduce global getConfiguration() and cleanup configuration provider#4012
mhsdesign merged 23 commits intoneos:9.0from
mhsdesign:task/introduce-neos-ui-configuration-package-and-cleanup-configuration-provider

Conversation

@mhsdesign
Copy link
Copy Markdown
Member

@mhsdesign mhsdesign commented Oct 14, 2025

Depends on #4011 and introduces e2e tests for it.

1.) Move editPreviewModes to actual neos ui "configuration" instead of "frontendConfiguration"

Now that the "configuration" is cleaned up an only contains real configuration - no state, no endpoints - the question is how does it differ to the "frontendConfiguration" and shouldnt the one be part of the other?

From what git tells me it was like this:

The "configuration" in the bootstrap existed but specifically to pipe the "editPreviewModes" to javascript the "Neos.Neos.Ui.frontendConfiguration" settings was created. This was sorely home to the "editPreviewModes" key and its options which were made available from the original location in Neos.Neos.userInterface. To access these in javascript a new "editPreviewModes" registry was created which was filled by the items in frontendConfiguration.editPreviewModes. -> change 2016 #425

One year later it was discussed in slack how to make settings overall available from plugins to the ui (https://neos-project.slack.com/archives/C0U0KEGDQ/p1507709786000036)
The "frontendConfiguration" stuck out as option in the settings with the potential to easily do this. The change 15afda4 replaced the dedicated "editPreviewModes" registry with a "frontendConfiguration" where all settings from the "frontendConfiguration" were made available to.

Now today we end up with the configuration and frontendConfiguration where the former is not extensible. As we alias the editPreviewMode configuration in the "frontendConfiguration" and dont define it there and as this value is an integral part or neos it makes now more sense to put it into the "configuration" and thus get rid of the odd RenderingMode helper - in hindsight this is quiet ironic as the frontendConfiguration was initially made for the rendering modes and now we end up almost not using it anymore.

Future of the "frontendConfiguration"

The neos ui only uses this setting for the "hotkeys" but they are odd and broken so actually we dont rely on that much.

For plugins the frontendConfiguration is still the (only) place to add custom values.

Now an alternate future of the "frontendConfiguration" would be to host everything including the editPreviewModes and the nodeTree loading depth but these values are configured in "Neos.Neos.userInterface" and will probably stay there and should not be replaced by an alternative like "Neos.Neos.Ui.frontendConfiguration" (especially as the "editPreviewModes" are so deep integrated in Neos.Neos that they will need to stay configured there)

2.) Separate state from configuration -> move the allowedTargetWorkspaces into the redux store

previously these options where fully static and part of the "configuration".
But this is misleading, the information depends on other workspaces and thus the database. It is not configuration.

Now they will also be updated when const {getWorkspaceInfo} = backend.get().endpoints; is invoked.

During changes only the totalNumberOfChanges are recalculated but not all the allowedTargetWorkspaces

3.) Remove endpoints from initialData configuration by using <link tag and prefetch for node type schema endpoint

this approach was already started for translations via #3804 and now the second endpoint is gone as well.

4.) E2E tests for extensibility API

Introduces automatic e2e test to ensure the newest adjustments to our extensibility api are tested before we even publish those to npm.

For that the e2e test distribution now ships a plugin which is build using the extensibility api from the project via yarn workspace.

To build them use

yarn workspace @neos-project/neos-ui-extensibility run build
yarn workspace @neos-project/neos-ui-test-plugin run build

Which builds the extensibility api and then for Neos.TestNodeTypes compiles an example dummy plugin.

Testcafe then boots the real Neos Ui with plugin and uses an exposed global variable neosUiTestPlugin to interact with the plugin. In a later step the plugin could also be used to test that certain container extension points work or that a custom ck plugin can be written.

 - Manifest boot
 - Create and access custom registry
 - Neos Ui Configuration Access
 - Frontend Configuration Access
 √ Extensibility Plugin Api - Check plugin status via developer api (console)

What I did

How I did it

How to verify it

@mhsdesign mhsdesign force-pushed the task/introduce-neos-ui-configuration-package-and-cleanup-configuration-provider branch 3 times, most recently from aeddd1a to 9ffb1da Compare October 19, 2025 11:09
@mhsdesign mhsdesign force-pushed the task/introduce-neos-ui-configuration-package-and-cleanup-configuration-provider branch 3 times, most recently from 74d5c25 to 041462a Compare October 28, 2025 21:11
@mhsdesign mhsdesign marked this pull request as ready for review October 28, 2025 21:18
mhsdesign added a commit that referenced this pull request Oct 28, 2025
This allows us to build an example test plugin in the test distribution and have installed later via composer

required for #4012
fixup #4022
@mhsdesign mhsdesign force-pushed the task/introduce-neos-ui-configuration-package-and-cleanup-configuration-provider branch 2 times, most recently from 97e38f8 to a2364d6 Compare October 28, 2025 22:27
@mhsdesign
Copy link
Copy Markdown
Member Author

mhsdesign commented Oct 30, 2025

@Sebobo following (internal) changes have been made

As we do not have a strict guideline as to how a plugin should behave to be supported across patch,minor or major versions its never easy to judge an internal change like this. Many parts of the Neos Ui carry a warning in code with them if someone extends those but thats just warnings. As most packages are exposed via the extensibility api I with my knowledge could build a plugin which could observe every detail what changed here but that is only because of my deep knowledge of the ui. None of these changes should matter to a Neos Ui plugin as they are core details:

  • the endpoints translations and nodeTypeSchema no longer reside under configuration.endpoints
  • the frontendConfiguration no longer carries the editPreviewModes setting and does not use the internal (new) helper Neos.Ui.RenderingMode.findAllSorted()
  • redux sagas no longer receive the {configuration} as parameter
  • when using the @neos() decorator neos.configuration is no longer available
  • the state information configuration.allowedTargetWorkspaces is no longer stored as configuration but in the redux store

@mhsdesign mhsdesign force-pushed the task/introduce-neos-ui-configuration-package-and-cleanup-configuration-provider branch from a2364d6 to c6c9294 Compare October 30, 2025 12:29
Copy link
Copy Markdown
Member

@Sebobo Sebobo 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, thx

Copy link
Copy Markdown
Member

@Sebobo Sebobo left a comment

Choose a reason for hiding this comment

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

Like this, it's breaking extensibility without supporting the previous ways of accessing the frontendConfiguration.

@mhsdesign mhsdesign force-pushed the task/introduce-neos-ui-configuration-package-and-cleanup-configuration-provider branch from 1db58b1 to cf5e11c Compare November 10, 2025 18:03
@mhsdesign mhsdesign requested a review from Sebobo November 10, 2025 19:20
Copy link
Copy Markdown
Member

@Sebobo Sebobo 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, just a variable name change would be nice.

…from boot time

see updateCsrfTokenAndWorkThroughQueue which is run after relogin
…a `"@neos-project/neos-ui-configuration"`

The System/index.js file was moved to the new package.
The side effects were removed from the file and are now part of the neos-ui index:

fetchWithErrorHandling.setCsrfToken
initializeJsAPI
…nk` tag and prefetch for node type schema endpoint

this approach was already started for translations via neos#3804 and now the second endpoint is gone as well.
…kspaces` into the redux store

previously these options where fully static and part of the "configuration".
But this is misleading, the information depends on other workspaces and thus the database. It is not configuration.

Now they will also be updated when `const {getWorkspaceInfo} = backend.get().endpoints;` is invoked.

During changes only the totalNumberOfChanges are recalculated but not all the allowedTargetWorkspaces
…roviderInterface

it does not make sense to build these routes in two different places -> but as the ones are rendered via `<link` tag and fetched immediately they are a little different thus a new method
…ad of "frontendConfiguration"

Now that the "configuration" is cleaned up an only contains real configuration - no state, no endpoints - the question is how does it differ to the "frontendConfiguration" and shouldnt the one be part of the other?

From what git tells me it was like this:

The "configuration" in the bootstrap existed but specifically to pipe the "editPreviewModes" to javascript the "Neos.Neos.Ui.frontendConfiguration" settings was created. This was sorely home to the "editPreviewModes" key and its options which were made available from the original location in Neos.Neos.userInterface. To access these in javascript a new "editPreviewModes" registry was created which was filled by the items in frontendConfiguration.editPreviewModes. -> change 2016 neos#425

One year later it was discussed in slack how to make settings overall available from plugins to the ui (https://neos-project.slack.com/archives/C0U0KEGDQ/p1507709786000036)
The "frontendConfiguration" stuck out as option in the settings with the potential to easily do this. The change neos@15afda4 replaced the dedicated "editPreviewModes" registry with a "frontendConfiguration" where all settings from the "frontendConfiguration" were made available to.

Now today we end up with the configuration and frontendConfiguration where the former is not extensible. As we alias the editPreviewMode configuration in the "frontendConfiguration" and dont define it there and as this value is an integral part or neos it makes now more sense to put it into the "configuration" and thus get rid of the odd RenderingMode helper - in hindsight this is quiet ironic as the frontendConfiguration was initially made for the rendering modes and now we end up almost not using it anymore.

Future of the "frontendConfiguration"

The neos ui only uses this setting for the "hotkeys" but they are odd and broken so actually we dont rely on that much.

For plugins the frontendConfiguration is still the (only) place to add custom values.

Now an alternate future of the "frontendConfiguration" would be to host everything including the editPreviewModes and the nodeTree loading depth but these values are configured in "Neos.Neos.userInterface" and will probably stay there and should not be replaced by an alternative like "Neos.Neos.Ui.frontendConfiguration" (especially as the "editPreviewModes" are so deep integrated in Neos.Neos that they will need to stay configured there)
…ing to use the registry or {frontendConfiguration} parameter and exposes `@neos-project/neos-ui-configuration"` via extensibility
Also move appContainer
          csrfToken
          systemEnv back to the Ui as no good abstraction was found.
as to due to the changes on the files it might be lost during upmerge.
In the test distribution this change adds a test plugin wich is also registered as yarn workspace so we can use esbuild and more importantly the neos-ui-extensibility to test.

via

```
yarn workspace @neos-project/neos-ui-test-plugin run build
```

this plugin is build and the esbuild.js script ensures with a custom analysis that we only bundle files from the source and from the extensibility shims but not any other node_modules

An e2e test run via testcafe ensures that the plugin is correctly registered via yaml and initialised. A client function access values from the plugin that were exposed on the window.
…pi for plugins but preserver compatibility with `SynchronousRegistry` legacy import
…Roles"

nodeTypes are infact not carried here
@mhsdesign mhsdesign force-pushed the task/introduce-neos-ui-configuration-package-and-cleanup-configuration-provider branch from cf5e11c to 92932b2 Compare November 11, 2025 08:55
@mhsdesign mhsdesign merged commit e5629bd into neos:9.0 Nov 11, 2025
7 checks passed
@mhsdesign mhsdesign deleted the task/introduce-neos-ui-configuration-package-and-cleanup-configuration-provider branch November 11, 2025 12:46
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.

2 participants