Skip to content

globalRegistry.get('frontendConfiguration') doesnt work in plugin/manifest bootstrap #3098

@mhsdesign

Description

@mhsdesign

Description

when one registers a new plugin in the manifest and tries to call globalRegistry.get('frontendConfiguration') null is returned.

Steps to Reproduce

  1. Write a manifest like:
import manifest from '@neos-project/neos-ui-extensibility';
manifest('Fooo', {}, (globalRegistry) => {
    console.log(globalRegistry.get('frontendConfiguration'))
}

Expected behavior

to get the actual FrontendConfigurationSynchronousRegistry

Actual behavior

we log null

What actually happened

the FrontendConfigurationSynchronousRegistry is not initialized, when the bootstraps are called.

the manifests are booted here in line 76

.forEach(({bootstrap}) => bootstrap(globalRegistry, {store, frontendConfiguration, configuration, routes}));

but only in line 121

const frontendConfigurationRegistry = globalRegistry.get('frontendConfiguration');
Object.keys(frontendConfiguration).forEach(key => {
frontendConfigurationRegistry.set(key, {
...frontendConfiguration[key]
});
});

the raw yaml / php-array frontendConfiguration array is transferred to a SynchronousRegistry

... Sure we can get hold of the frontendConfiguration in another way:

  1. Write a manifest like:
manifest('Fooo', {}, (globalRegistry, { frontendConfiguration }) => {
    console.log(frontendConfiguration)
}

now it works, but note that this is the raw yaml / php-array and not a SynchronousRegistry so frontendConfiguration.get('My.Package')
doesnt work (one needs to use normal array access like frontendConfiguration['My.Package']) - but it does other places (when you actually have the FrontendConfigurationSynchronousRegistry)

Outcome

is there a reason, why the FrontendConfigurationSynchronousRegistry is not initialized before boot and passed?
im now used to this but i find this behavior odd - and would like to have at all places a FrontendConfigurationSynchronousRegistry available.

Affected Versions

UI: Since ever

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions