packagefactory / atomicfusion-jscomponents
Augment Fusion components to ease initialization with JavaScript
Installs: 2 948
Dependents: 0
Suggesters: 0
Security: 0
Stars: 2
Watchers: 1
Forks: 0
Open Issues: 0
Type:neos-package
Requires
- neos/flow: *
- neos/fusion: ^4.0 || dev-master
This package is not auto-updated.
Last update: 2020-01-24 17:42:30 UTC
README
Augment Fusion components to ease initialization with JavaScript
Why?
TBD.
Usage
TBD.
Example Runtime
TBD.
Discovery of JavaScript files
Fusion actually holds no information about the file a prototype is defined in. So, to enable the discovery of files put alongside those component *.fusion files, we need to configure a lookup pattern:
PackageFactory: AtomicFusion: JsComponents: tryFiles: - resource://{packageKey}/Private/Fusion/{componentPath}.js
With the above configuration the JS file for the prototype prototype(Vendor.Site:MyAwesomeComponent)
will be assumed as resource://Vendor.Site/Private/Fusion/MyAwesomeComponent.js
.
{packageKey}
and {componentPath}
are variables that will be replaced with runtime information of the respective fusion prototype.
The following variables are considered:
{prototypeName}
- The entire prototype name{packageKey}
- The part of the prototype name before the:
{componentName}
- The part of the prototype name after the:
{componentBaseName}
- The last part of the componentName, if seperated by dots (forVendor.Site:Atom.Button
that would be:Button
){componentPath}
- Similar to{componentName}
with all dots being replaced by Directory Separators.
By default, the package looks at the following patterns:
resource://{packageKey}/Private/Fusion/{componentPath}.js
resource://{packageKey}/Private/Fusion/{componentPath}/{componentBaseName}.js
resource://{packageKey}/Private/Fusion/{componentPath}/index.js
resource://{packageKey}/Private/Fusion/{componentPath}/Index.js
resource://{packageKey}/Private/Fusion/{componentPath}/component.js
resource://{packageKey}/Private/Fusion/{componentPath}/Component.js
Caveats
Recently, the native component prototype Neos.Fusion:Component
has arrived in the Neos.Fusion core. Unfortunately, this package won't work with this new prototype and relies on PackageFactory.AtomicFusion:Component
to be present.
This will likely change in the future, either through this package or a PR to Neos.Fusion.
If you still want to use this package with an existing code base, that relies on Neos.Fusion:Component
, you could replace the Neos.Fusion:Component
standard implementation with the one for PackageFactory.AtomicFusion:Component
:
prototype(Neos.Fusion:Component) {
@class = 'PackageFactory\\AtomicFusion\\FusionObjects\\ComponentImplementation'
}
PackageFactory.AtomicFusion:Component
is fully compatible to Neos.Fusion:Component
, but you should be nonetheless aware:
THIS IS NOT THE JEDI WAY!
License
see LICENSE.md