Skip to content

Commit

Permalink
revert renderSlotTemplate function
Browse files Browse the repository at this point in the history
  • Loading branch information
MoustaphaDev committed Jan 11, 2024
1 parent c30b24f commit a4fffd8
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 76 deletions.
6 changes: 3 additions & 3 deletions internal/printer/print-to-js.go
Original file line number Diff line number Diff line change
Expand Up @@ -564,7 +564,7 @@ func render1(p *printer, n *Node, opts RenderOptions) {
case n.CustomElement:
p.print(`,({`)
p.print(fmt.Sprintf(`"%s": () => `, "default"))
p.printSlotTemplateLiteralOpen()
p.printTemplateLiteralOpen()
for c := n.FirstChild; c != nil; c = c.NextSibling {
render1(p, c, RenderOptions{
isRoot: false,
Expand Down Expand Up @@ -807,7 +807,7 @@ func handleSlots(p *printer, n *Node, opts RenderOptions, depth int) {
p.print(fmt.Sprintf(`%s: () => `, slotProp))
}

p.printSlotTemplateLiteralOpen()
p.printTemplateLiteralOpen()
for _, child := range children {
render1(p, child, RenderOptions{
isRoot: false,
Expand Down Expand Up @@ -872,7 +872,7 @@ func renderNestedSlotChild(p *printer, nestedSlotChild *NestedSlotChild, isFirst
})

// print the nested slotted children
p.printSlotTemplateLiteralOpen()
p.printTemplateLiteralOpen()
for _, child := range nestedSlotChild.Children {
render1(p, child, RenderOptions{
isRoot: false,
Expand Down
8 changes: 0 additions & 8 deletions internal/printer/printer.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ var RENDER_HEAD = "$$renderHead"
var MAYBE_RENDER_HEAD = "$$maybeRenderHead"
var UNESCAPE_HTML = "$$unescapeHTML"
var RENDER_SLOT = "$$renderSlot"
var SLOT_TEMPLATE_TAG = "$$renderSlotTemplate"
var MERGE_SLOTS = "$$mergeSlots"
var ADD_ATTRIBUTE = "$$addAttribute"
var RENDER_TRANSITION = "$$renderTransition"
Expand Down Expand Up @@ -125,8 +124,6 @@ func (p *printer) printInternalImports(importSpecifier string, opts *RenderOptio
p.addNilSourceMapping()
p.print("renderSlot as " + RENDER_SLOT + ",\n ")
p.addNilSourceMapping()
p.print("renderSlotTemplate as " + SLOT_TEMPLATE_TAG + ",\n ")
p.addNilSourceMapping()
p.print("mergeSlots as " + MERGE_SLOTS + ",\n ")
p.addNilSourceMapping()
p.print("addAttribute as " + ADD_ATTRIBUTE + ",\n ")
Expand Down Expand Up @@ -200,11 +197,6 @@ func (p *printer) printTemplateLiteralOpen() {
p.print(fmt.Sprintf("%s%s", TEMPLATE_TAG, BACKTICK))
}

func (p *printer) printSlotTemplateLiteralOpen() {
p.addNilSourceMapping()
p.print(fmt.Sprintf("%s%s", SLOT_TEMPLATE_TAG, BACKTICK))
}

func (p *printer) printTemplateLiteralClose() {
p.addNilSourceMapping()
p.print(BACKTICK)
Expand Down
Loading

0 comments on commit a4fffd8

Please sign in to comment.