Skip to content

Commit

Permalink
Disregard asset bundles before appending HTML
Browse files Browse the repository at this point in the history
  • Loading branch information
bencroker committed Aug 12, 2024
1 parent e9011bc commit fcc79f5
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Release Notes for Sprig Core

## 3.3.2 - 2024-08-12

### Fixed

- Fixed a bug in which asset bundles were being registered and rendered in control panel Sprig requests ([#383](https://github.com/putyourlightson/craft-sprig/issues/383)).

## 3.3.1 - 2024-08-08

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "putyourlightson/craft-sprig-core",
"description": "A reactive Twig component framework for Craft.",
"version": "3.3.1",
"version": "3.3.2",
"type": "craft-module",
"license": "mit",
"require": {
Expand Down
4 changes: 3 additions & 1 deletion src/controllers/ComponentsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,9 @@ public function actionRender(): Response
// Remove flashes after rendering, so they don’t appear on subsequent requests.
Craft::$app->getSession()->removeAllFlashes();

// Append queued HTML to the content.
// Append queued HTML to the content, disregarding any asset bundles.
// https://github.com/putyourlightson/craft-sprig/issues/383
Craft::$app->getView()->assetBundles = [];
$content .= Craft::$app->getView()->getBodyHtml();

$response = Craft::$app->getResponse();
Expand Down
2 changes: 1 addition & 1 deletion src/variables/SprigVariable.php
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ public function triggerRefreshOnLoad(string $selector = ''): void
}

/**
* Registers JavaScript code to be executed. This method takes care of registering the code depending on whether it is part of an include or a request.
* Registers JavaScript code to be executed. This method takes care of registering the code in the appropriate way depending on whether it is part of an include or a request.
*
* @since 2.10.0
*/
Expand Down

0 comments on commit fcc79f5

Please sign in to comment.