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

Allow using for Flow applications, not Neos applications only #109

Open
skurfuerst opened this issue Aug 2, 2019 · 5 comments
Open

Allow using for Flow applications, not Neos applications only #109

skurfuerst opened this issue Aug 2, 2019 · 5 comments
Assignees

Comments

@skurfuerst
Copy link

skurfuerst commented Aug 2, 2019

With https://docs.neos.io/cms/manual/extending-neos-with-php-flow/creating-afx-based-applications-backend-modules, it is easily possible to use Flow together with AFX.

Now, it would be AWESOME to also use Monocle there.

I did a quick experiment code-wise. The main challenge is replacing the FusionService, which extends the Neos FusionService - and we get a class loading error if Neos is not installed.

Currently I see the following options:

do not extend NodeService, but instead use ObjectAccess::getProperty(..., true)

separate Monocle into a neos-agnostic Core and a Neos-specific part.

"somehow" sketch out an official API in fusion to use

Continuing

I'd love to pursue this further; but we should first discuss a) if you'd like to support this and b) how :)

All the best,
Sebastian

@mficzel
Copy link
Member

mficzel commented Aug 5, 2019

@skurfuerst The main reason for using on the NeosFusionService as a base was to easily get the autoinclude behavior (include Root.fusion of current site plus all fusion includes from Settings). This was a bit simplistic and it totally makes sense to extend it and remove the hard Neos-dependency.

There is also another use case that monocle currently does not support yet ("FEATURE: Allow to preview non-site packages" #101 ).

I think a good approach would be to threat the current behavior as a default but allow to configure additional "packages" where different fusion loading patterns are used.

How about doing it like this:

Sitegeist:
  Monocle:
  
    # 
  	# by default all site packages are present others have to be 
  	# configured explicitly
  	#  	
    packages:
    
      #
      # default case for site packages, probably not in configuration but fallback via code
      # 
      'default'
      	label: ${package.name}
      	fusion:
      		pathPatterns: ${package.path + '/Resources/Private/Fusion/Root.fusion'}
      		autoinclude: true
      		
      #
      # special configuration for non-site pakages like flow-apps or component libraries
      #		
      'Vendor.Package':
      	label: "Special Package"
      	fusion:
      		pathPatterns:
      			- 'resource://Vendor.Package/Resources/Private/Fusion/Root.fusion'

@skurfuerst
Copy link
Author

Hey :)

Thanks so much for your comment - very good idea!

This week I won't be able to work on this, but hopefully next week etc.

All the best,
Sebastian

@mficzel
Copy link
Member

mficzel commented Jun 7, 2021

I got an even better idea. If we check the type of the package selected we can adjust the fusion autoloading behavior accordingly. So we "only" need a way to configure the additional packages.

@mficzel
Copy link
Member

mficzel commented Jun 10, 2021

@skurfuerst can you check out pr #151 for this feature request. I think this should cover your case.

@mficzel
Copy link
Member

mficzel commented Jun 24, 2021

FYI: With 7.5.0 Monocle supports non site packages if the keys are configured. Removing the Neos dependency entirely will need more work and splitting Monocle up into two packages.

  • Sitegeist.Monocle.Styleguide (Styleguide Application)
  • Sitegeist.Monocle (Neos.Adapter)

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

No branches or pull requests

2 participants