Skip to content

Commit

Permalink
Fix: Work around for strange bug in Fusion
Browse files Browse the repository at this point in the history
  • Loading branch information
jonnitto committed Sep 4, 2022
1 parent f84dabc commit b316854
Show file tree
Hide file tree
Showing 10 changed files with 22 additions and 23 deletions.
2 changes: 1 addition & 1 deletion Resources/Private/Fusion/External/Case.fusion
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ prototype(Carbon.IncludeAssets:Case) < prototype(Neos.Fusion:Component) {
alwaysInclude = ${PropTypes.boolean}
}

mixin = null
mixin = ${null}
document = ${this.mixin}
content = ${this.mixin}
appendFilter = ''
Expand Down
4 changes: 2 additions & 2 deletions Resources/Private/Fusion/External/Collection.fusion
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ prototype(Carbon.IncludeAssets:Collection) < prototype(Neos.Fusion:Component) {
}

collection = ${[]}
assetPackage = null
assetPackage = ${null}
cacheBuster = ${Configuration.setting('Carbon.IncludeAssets.Default.CacheBuster')}
disableCacheBusterForPreloadAsset = ${Configuration.setting('Carbon.IncludeAssets.Default.DisableCacheBusterForPreloadAsset')}
paths = ${Configuration.setting('Carbon.IncludeAssets.Default.Path')}
wrapper = null
wrapper = ${null}

@if.hasAssetPackage = ${this.assetPackage && Type.isArray(this.collection) && Array.length(this.collection)}

Expand Down
6 changes: 3 additions & 3 deletions Resources/Private/Fusion/External/File.fusion
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ prototype(Carbon.IncludeAssets:File) < prototype(Neos.Fusion:Component) {
wrapper = ${PropTypes.string}
}

file = null
file = ${null}
assetPackage = ${node.context.currentSite.siteResourcesPackageKey}
cacheBuster = ${Configuration.setting('Carbon.IncludeAssets.Default.CacheBuster')}
disableCacheBusterForPreloadAsset = ${Configuration.setting('Carbon.IncludeAssets.Default.DisableCacheBusterForPreloadAsset')}
assetPath = null
wrapper = null
assetPath = ${null}
wrapper = ${null}

// This is a internal variable, please use `assetPath` for an single file
paths = ${Configuration.setting('Carbon.IncludeAssets.Default.Path')}
Expand Down
15 changes: 7 additions & 8 deletions Resources/Private/Fusion/External/ResourceHints.fusion
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ prototype(Carbon.IncludeAssets:ResourceHints) < prototype(Neos.Fusion:Component)
modulePreload = ${Configuration.setting('Carbon.IncludeAssets.ResourceHints.ModulePreload')}

// Pass documentNodes who should be preloaded (Array, FlowQuery or a single node)
preloadNodes = null
preloadNodes = ${null}
// Pass documentNodes who should be prerendererd (Array, FlowQuery or a single node)
prerenderNodes = null
prerenderNodes = ${null}

renderer = afx`
<Carbon.IncludeAssets:ResourceHints.Items @key='dnsPrefetch' items={props.dnsPrefetch} rel='dns-prefetch' />
Expand All @@ -54,8 +54,8 @@ prototype(Carbon.IncludeAssets:ResourceHints.Items) < prototype(Neos.Fusion:Comp
type = ${PropTypes.oneOf(['modulepreload', 'resourcehint'])}
}

items = null
rel = null
items = ${null}
rel = ${null}
type = ${this.rel == 'modulepreload' ? 'modulepreload' : 'resourcehint'}


Expand All @@ -80,9 +80,9 @@ prototype(Carbon.IncludeAssets:ResourceHints.Nodes) < prototype(Neos.Fusion:Comp
type = ${PropTypes.string}
}

items = null
rel = null
as = null
items = ${null}
rel = ${null}
as = ${null}

// Internal
items.@process {
Expand All @@ -106,4 +106,3 @@ prototype(Carbon.IncludeAssets:ResourceHints.Nodes) < prototype(Neos.Fusion:Comp
`
}
}

2 changes: 1 addition & 1 deletion Resources/Private/Fusion/Internal/Assets.fusion
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

prototype(Carbon.IncludeAssets:Internal.Assets) < prototype(Neos.Fusion:Component) {
// Body || Head || BodyStart || HeadStart
location = null
location = ${null}

loadJSforCSSAsynchron = ${Configuration.setting('Carbon.IncludeAssets.LoadJSforCSSAsynchron') && this.location == 'Head'}
packages = ${Configuration.setting('Carbon.IncludeAssets.Packages')}
Expand Down
4 changes: 2 additions & 2 deletions Resources/Private/Fusion/Internal/InlineFile.fusion
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
prototype(Carbon.IncludeAssets:Internal.InlineFile) < prototype(Carbon.IncludeAssets:Internal.TypeCase) {
@if.set = ${this.path && this.type && this.content}

path = null
type = null
path = ${null}
type = ${null}
attributes = ''
content = ${String.trim(Carbon.FileContent.path(this.path))}
css = ${'<style' + this.attributes +'>' + this.content + '</style>'}
Expand Down
2 changes: 1 addition & 1 deletion Resources/Private/Fusion/Internal/Package.fusion
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

prototype(Carbon.IncludeAssets:Internal.Package) < prototype(Neos.Fusion:Component) {
// Body || Head || BodyStart || HeadStart
location = null
location = ${null}
// The config for the package
config = Neos.Fusion:DataStructure

Expand Down
6 changes: 3 additions & 3 deletions Resources/Private/Fusion/Internal/Tag.fusion
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
prototype(Carbon.IncludeAssets:Internal.Tag) < prototype(Neos.Fusion:Component) {
path = null
fileObject = null
path = ${null}
fileObject = ${null}
cacheBuster = false
async = ${this.fileObject.async}
external = ${this.fileObject.external}
Expand Down Expand Up @@ -30,7 +30,7 @@ prototype(Carbon.IncludeAssets:Internal.Tag) < prototype(Neos.Fusion:Component)

prototype(Carbon.IncludeAssets:Internal.Tag.ResourceHint) < prototype(Carbon.IncludeAssets:Internal.Tag) {
async = false
rel = null
rel = ${null}
disableCacheBusterForPreloadAsset = true
[email protected] = ${this.disableCacheBusterForPreloadAsset && this.fileObject && this.fileObject.type == 'PRELOADASSET' ? false : value}
@if.hasRel = ${this.rel}
Expand Down
2 changes: 1 addition & 1 deletion Resources/Private/Fusion/Internal/TypeCase.fusion
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*/

prototype(Carbon.IncludeAssets:Internal.TypeCase) < prototype(Neos.Fusion:Component) {
type = null
type = ${null}
html = ''
js = ''
css = ''
Expand Down
2 changes: 1 addition & 1 deletion Resources/Private/Fusion/Internal/Wrapper.fusion
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
prototype(Carbon.IncludeAssets:Internal.Wrapper) < prototype(Neos.Fusion:Value) {
content = ${value}
wrapper = null
wrapper = ${null}
[email protected] = ${this.content}
[email protected] = ${value && Type.isString(value) ? String.split(value, '{content}') : null}
nl = ${String.chr(10)}
Expand Down

0 comments on commit b316854

Please sign in to comment.