-
-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add support for content stacks
- Loading branch information
1 parent
7adbb0c
commit 5714054
Showing
138 changed files
with
1,320 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
let out = ""; | ||
let $lineNumber = 1; | ||
let $filename = "{{__dirname}}index.edge"; | ||
try { | ||
out += template.stacks.create('js'); | ||
out += "\n"; | ||
$lineNumber = 2; | ||
out += template.stacks.create('css'); | ||
} catch (error) { | ||
template.reThrow(error, $filename, $lineNumber); | ||
} | ||
return out; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
@stack('js') | ||
@stack('css') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"username": "virk" | ||
} |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
let out = ""; | ||
let $lineNumber = 1; | ||
let $filename = "{{__dirname}}index.edge"; | ||
try { | ||
out += template.stacks.create('js'); | ||
out += "\n"; | ||
$lineNumber = 2; | ||
out += await template.compilePartial('push_once_to/script')(template,state,$context); | ||
out += "\n"; | ||
$lineNumber = 3; | ||
out += await template.compilePartial('push_once_to/script')(template,state,$context); | ||
out += "\n"; | ||
$lineNumber = 4; | ||
out += await template.compilePartial('push_once_to/script')(template,state,$context); | ||
} catch (error) { | ||
template.reThrow(error, $filename, $lineNumber); | ||
} | ||
return out; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
@stack('js') | ||
@include('push_once_to/script') | ||
@include('push_once_to/script') | ||
@include('push_once_to/script') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"username": "virk" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<script> | ||
var a = require('a') | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
@pushOnceTo('js') | ||
<script> | ||
var a = require('a') | ||
</script> | ||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
let out = ""; | ||
let $lineNumber = 1; | ||
let $filename = "{{__dirname}}index.edge"; | ||
try { | ||
out += template.stacks.create(state.stackName); | ||
out += "\n"; | ||
$lineNumber = 2; | ||
out += await template.compilePartial('push_once_to_using_variables/script')(template,state,$context); | ||
out += "\n"; | ||
$lineNumber = 3; | ||
out += await template.compilePartial('push_once_to_using_variables/script')(template,state,$context); | ||
out += "\n"; | ||
$lineNumber = 4; | ||
out += await template.compilePartial('push_once_to_using_variables/script')(template,state,$context); | ||
} catch (error) { | ||
template.reThrow(error, $filename, $lineNumber); | ||
} | ||
return out; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
@stack(stackName) | ||
@include('push_once_to_using_variables/script') | ||
@include('push_once_to_using_variables/script') | ||
@include('push_once_to_using_variables/script') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"stackName": "js" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<script> | ||
var a = require('a') | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
@pushOnceTo(stackName) | ||
<script> | ||
var a = require('a') | ||
</script> | ||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
let out = ""; | ||
let $lineNumber = 1; | ||
let $filename = "{{__dirname}}index.edge"; | ||
try { | ||
out += template.stacks.create('js'); | ||
out += "\n"; | ||
$lineNumber = 2; | ||
out += await template.compileComponent('push_once_to_via_components/script')(template, template.getComponentState({}, { $context: Object.assign({}, $context), main: function () { return "" } }, { filename: $filename, line: $lineNumber, col: 0 }), $context); | ||
out += "\n"; | ||
$lineNumber = 3; | ||
out += await template.compileComponent('push_once_to_via_components/script')(template, template.getComponentState({}, { $context: Object.assign({}, $context), main: function () { return "" } }, { filename: $filename, line: $lineNumber, col: 0 }), $context); | ||
out += "\n"; | ||
$lineNumber = 4; | ||
out += await template.compileComponent('push_once_to_via_components/script')(template, template.getComponentState({}, { $context: Object.assign({}, $context), main: function () { return "" } }, { filename: $filename, line: $lineNumber, col: 0 }), $context); | ||
} catch (error) { | ||
template.reThrow(error, $filename, $lineNumber); | ||
} | ||
return out; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
@stack('js') | ||
@!component('push_once_to_via_components/script') | ||
@!component('push_once_to_via_components/script') | ||
@!component('push_once_to_via_components/script') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"username": "virk" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<script> | ||
var a = require('a') | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
@pushOnceTo('js') | ||
<script> | ||
var a = require('a') | ||
</script> | ||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
let out = ""; | ||
let $lineNumber = 1; | ||
let $filename = "{{__dirname}}index.edge"; | ||
try { | ||
out += template.stacks.create('js'); | ||
out += "\n"; | ||
out += ""; | ||
$lineNumber = 3; | ||
let stack_1 = ""; | ||
stack_1 += " \u003Cscript\u003E"; | ||
stack_1 += "\n"; | ||
stack_1 += " var a = require('a')"; | ||
stack_1 += "\n"; | ||
stack_1 += " \u003C\u002Fscript\u003E"; | ||
template.stacks.pushTo('js', stack_1); | ||
} catch (error) { | ||
template.reThrow(error, $filename, $lineNumber); | ||
} | ||
return out; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
@stack('js') | ||
|
||
@pushTo('js') | ||
<script> | ||
var a = require('a') | ||
</script> | ||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"username": "virk" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<script> | ||
var a = require('a') | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
let out = ""; | ||
let $lineNumber = 1; | ||
let $filename = "{{__dirname}}index.edge"; | ||
try { | ||
out += template.stacks.create('js'); | ||
out += "\n"; | ||
out += ""; | ||
$lineNumber = 3; | ||
if (true) { | ||
out += "\n"; | ||
$lineNumber = 4; | ||
let stack_1 = ""; | ||
stack_1 += " \u003Cscript\u003E"; | ||
stack_1 += "\n"; | ||
stack_1 += " var a = "; | ||
$lineNumber = 6; | ||
stack_1 += `${state.requireFoo}`; | ||
stack_1 += "\n"; | ||
stack_1 += " \u003C\u002Fscript\u003E"; | ||
template.stacks.pushTo('js', stack_1); | ||
} | ||
} catch (error) { | ||
template.reThrow(error, $filename, $lineNumber); | ||
} | ||
return out; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
@stack('js') | ||
|
||
@if(true) | ||
@pushTo('js') | ||
<script> | ||
var a = {{{ requireFoo }}} | ||
</script> | ||
@end | ||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"username": "virk", | ||
"requireFoo": "require('a')" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<script> | ||
var a = require('a') | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
let out = ""; | ||
let $lineNumber = 1; | ||
let $filename = "{{__dirname}}index.edge"; | ||
try { | ||
out += template.stacks.create('js'); | ||
out += "\n"; | ||
out += ""; | ||
$lineNumber = 3; | ||
let stack_1 = ""; | ||
stack_1 += " \u003Cscript\u003E"; | ||
stack_1 += "\n"; | ||
stack_1 += " var a = require('a')"; | ||
stack_1 += "\n"; | ||
stack_1 += " \u003C\u002Fscript\u003E"; | ||
template.stacks.pushTo('js', stack_1); | ||
out += "\n"; | ||
out += ""; | ||
$lineNumber = 9; | ||
let stack_2 = ""; | ||
stack_2 += " \u003Cscript\u003E"; | ||
stack_2 += "\n"; | ||
stack_2 += " var b = require('b')"; | ||
stack_2 += "\n"; | ||
stack_2 += " \u003C\u002Fscript\u003E"; | ||
template.stacks.pushTo('js', stack_2); | ||
} catch (error) { | ||
template.reThrow(error, $filename, $lineNumber); | ||
} | ||
return out; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
@stack('js') | ||
|
||
@pushTo('js') | ||
<script> | ||
var a = require('a') | ||
</script> | ||
@end | ||
|
||
@pushTo('js') | ||
<script> | ||
var b = require('b') | ||
</script> | ||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"username": "virk" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<script> | ||
var a = require('a') | ||
</script> | ||
<script> | ||
var b = require('b') | ||
</script> |
15 changes: 15 additions & 0 deletions
15
async_fixtures/push_to_multiple_via_components/compiled.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
let out = ""; | ||
let $lineNumber = 1; | ||
let $filename = "{{__dirname}}index.edge"; | ||
try { | ||
out += template.stacks.create('js'); | ||
out += "\n"; | ||
$lineNumber = 2; | ||
out += await template.compileComponent('push_to_multiple_via_components/script')(template, template.getComponentState({}, { $context: Object.assign({}, $context), main: function () { return "" } }, { filename: $filename, line: $lineNumber, col: 0 }), $context); | ||
out += "\n"; | ||
$lineNumber = 3; | ||
out += await template.compileComponent('push_to_multiple_via_components/script')(template, template.getComponentState({}, { $context: Object.assign({}, $context), main: function () { return "" } }, { filename: $filename, line: $lineNumber, col: 0 }), $context); | ||
} catch (error) { | ||
template.reThrow(error, $filename, $lineNumber); | ||
} | ||
return out; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
@stack('js') | ||
@!component('push_to_multiple_via_components/script') | ||
@!component('push_to_multiple_via_components/script') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"username": "virk" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<script> | ||
var a = require('a') | ||
</script> | ||
<script> | ||
var a = require('a') | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
@include('push_to_multiple_via_components/script_partial') |
5 changes: 5 additions & 0 deletions
5
async_fixtures/push_to_multiple_via_components/script_partial.edge
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
@pushTo('js') | ||
<script> | ||
var a = require('a') | ||
</script> | ||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
let out = ""; | ||
let $lineNumber = 1; | ||
let $filename = "{{__dirname}}index.edge"; | ||
try { | ||
out += template.stacks.create('js'); | ||
out += "\n"; | ||
$lineNumber = 2; | ||
out += await template.compilePartial('push_to_multiple_via_components/script')(template,state,$context); | ||
out += "\n"; | ||
$lineNumber = 3; | ||
out += await template.compilePartial('push_to_multiple_via_components/script')(template,state,$context); | ||
} catch (error) { | ||
template.reThrow(error, $filename, $lineNumber); | ||
} | ||
return out; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
@stack('js') | ||
@include('push_to_multiple_via_components/script') | ||
@include('push_to_multiple_via_components/script') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"username": "virk" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<script> | ||
var a = require('a') | ||
</script> | ||
<script> | ||
var a = require('a') | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
@pushTo('js') | ||
<script> | ||
var a = require('a') | ||
</script> | ||
@end |
Oops, something went wrong.