Skip to content

Commit

Permalink
Merge pull request #759 from trheyi/main
Browse files Browse the repository at this point in the history
fix sui dynamic components import bug
  • Loading branch information
trheyi committed Sep 30, 2024
2 parents 6ec63f4 + 369d6cc commit dc43296
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
8 changes: 8 additions & 0 deletions sui/core/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,14 @@ func (page *Page) parseDynamics(ctx *BuildContext, sel *goquery.Selection) {
return
}
ctx.addJitComponent(route)

// This is a temprary solution, we will refactor this later

Check failure on line 288 in sui/core/build.go

View workflow job for this annotation

GitHub Actions / unit-test (1.20.0, MySQL8.0, 5, 6.0)

"temprary" is a misspelling of "temporary"

Check failure on line 288 in sui/core/build.go

View workflow job for this annotation

GitHub Actions / unit-test (1.20.0, MySQL8.0, 4, 6.0)

"temprary" is a misspelling of "temporary"

Check failure on line 288 in sui/core/build.go

View workflow job for this annotation

GitHub Actions / unit-test (1.21.1, MySQL8.0, 4, 6.0)

"temprary" is a misspelling of "temporary"

Check failure on line 288 in sui/core/build.go

View workflow job for this annotation

GitHub Actions / unit-test (1.21.1, SQLite3, 6, 6.0)

"temprary" is a misspelling of "temporary"

Check failure on line 288 in sui/core/build.go

View workflow job for this annotation

GitHub Actions / unit-test (1.21.1, SQLite3, 4, 6.0)

"temprary" is a misspelling of "temporary"

Check failure on line 288 in sui/core/build.go

View workflow job for this annotation

GitHub Actions / unit-test (1.21.1, MySQL8.0, 5, 6.0)

"temprary" is a misspelling of "temporary"

Check failure on line 288 in sui/core/build.go

View workflow job for this annotation

GitHub Actions / UnitTest (1.20.0, SQLite3, 5, 6.0)

"temprary" is a misspelling of "temporary"

Check failure on line 288 in sui/core/build.go

View workflow job for this annotation

GitHub Actions / UnitTest (1.20.0, MySQL8.0, 5, 6.0)

"temprary" is a misspelling of "temporary"

Check failure on line 288 in sui/core/build.go

View workflow job for this annotation

GitHub Actions / UnitTest (1.20.0, SQLite3, 6, 6.0)

"temprary" is a misspelling of "temporary"

Check failure on line 288 in sui/core/build.go

View workflow job for this annotation

GitHub Actions / UnitTest (1.20.0, SQLite3, 4, 6.0)

"temprary" is a misspelling of "temporary"

Check failure on line 288 in sui/core/build.go

View workflow job for this annotation

GitHub Actions / unit-test (1.20.0, MySQL5.7, 4, 6.0)

"temprary" is a misspelling of "temporary"

Check failure on line 288 in sui/core/build.go

View workflow job for this annotation

GitHub Actions / unit-test (1.20.0, SQLite3, 4, 6.0)

"temprary" is a misspelling of "temporary"

Check failure on line 288 in sui/core/build.go

View workflow job for this annotation

GitHub Actions / UnitTest (1.21.1, MySQL8.0, 4, 6.0)

"temprary" is a misspelling of "temporary"

Check failure on line 288 in sui/core/build.go

View workflow job for this annotation

GitHub Actions / unit-test (1.21.1, MySQL5.7, 6, 6.0)

"temprary" is a misspelling of "temporary"

Check failure on line 288 in sui/core/build.go

View workflow job for this annotation

GitHub Actions / UnitTest (1.21.1, MySQL8.0, 5, 6.0)

"temprary" is a misspelling of "temporary"

Check failure on line 288 in sui/core/build.go

View workflow job for this annotation

GitHub Actions / UnitTest (1.21.1, SQLite3, 6, 6.0)

"temprary" is a misspelling of "temporary"

Check failure on line 288 in sui/core/build.go

View workflow job for this annotation

GitHub Actions / unit-test (1.20.0, MySQL5.7, 5, 6.0)

"temprary" is a misspelling of "temporary"

Check failure on line 288 in sui/core/build.go

View workflow job for this annotation

GitHub Actions / unit-test (1.20.0, SQLite3, 6, 6.0)

"temprary" is a misspelling of "temporary"

Check failure on line 288 in sui/core/build.go

View workflow job for this annotation

GitHub Actions / UnitTest (1.20.0, MySQL5.7, 6, 6.0)

"temprary" is a misspelling of "temporary"

Check failure on line 288 in sui/core/build.go

View workflow job for this annotation

GitHub Actions / UnitTest (1.21.1, MySQL8.0, 6, 6.0)

"temprary" is a misspelling of "temporary"

Check failure on line 288 in sui/core/build.go

View workflow job for this annotation

GitHub Actions / UnitTest (1.20.0, MySQL5.7, 4, 6.0)

"temprary" is a misspelling of "temporary"

Check failure on line 288 in sui/core/build.go

View workflow job for this annotation

GitHub Actions / UnitTest (1.21.1, MySQL5.7, 5, 6.0)

"temprary" is a misspelling of "temporary"

Check failure on line 288 in sui/core/build.go

View workflow job for this annotation

GitHub Actions / UnitTest (1.21.1, MySQL5.7, 4, 6.0)

"temprary" is a misspelling of "temporary"
// Some components are not used in the page, but they are used in the script
// So we need to add them to the components
// But this solution is not perfect, it will cause import the unnecessary components, just ignore it.
// Add to the imports
name := fmt.Sprintf("comp_%s", strings.ReplaceAll(route, "/", "_"))
ctx.components[name] = route
})
}

Expand Down
1 change: 1 addition & 0 deletions sui/core/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -901,6 +901,7 @@ func (parser *TemplateParser) show(sel *goquery.Selection) {
// sel.SetAttr("style", style)
}

// Tidy the template by removing the parsed attributes
func (parser *TemplateParser) Tidy(s *goquery.Selection) {

s.Contents().Each(func(i int, child *goquery.Selection) {
Expand Down

0 comments on commit dc43296

Please sign in to comment.