- Add
phpstan
andecs
code linting - Add
code-analysis.yaml
GitHub action
- Updated docs to use node 20 & a new sitemap plugin
- PHPstan code cleanup
- ECS code cleanup
- Don't log the full exception on a Guzzle error, just log the message
- Fix incorrect
User-Agent
header that could cause an error to be thrown
- Wrap calls to
is_file()
with try/catch, to handle open_basedir restrictions that cause exceptions to be thrown (#73) - Switched documentation system to VitePress
- Move settings from the
composer.json
“extra” to the plugin main class
- Fix
DOCSDEST
path - No longer invalidate caches immediately in local dev, and instead rely on the 1s cache (#67)
- Added buildchain for docs
- Fixed a malformed
User-Agent
header in a request tomix-manifest.json
(#62)
- Catch all errors thrown by Guzzle
- Add a
100ms
delay when requesting the manifest file if using it in hot mode, as a hack to avoid awebpack-dev-server
/ Tailwind CSS JIT race condition (nystudio107/craft#55)
- Use Guzzle for remote file fetches rather than
curl
, for improved performance
- Added a
FileDependency
cache dependency for files loaded from a local path, so things like themanifest.json
will auto-cache bust if the file changes
- Default
devServerBuildType
reverted tomodern
- Default devServerBuildType to
combined
- Ensure that
getHttpResponseCode()
returns a 404 on error
- Fixed an issue where
includeFileFromManifest()
wouldn't properly fall back on non-hot files if the URL returned a 404 with HTML content
- Fixed the
craft.twigpack.includeFileFromManifest()
so that it will use the internaldevServer.publicPath
setting for HMR
- Ensure that a string is always passed to
Template::raw()
- Updated the docs
- Fixed a regression from the
styles.js
error suppression that would cause it to throw an exception if you attempted to load it
- Suppress errors for
styles.js
modules (which is a work-around to a webpack bug)
- Added the ability to pass down an
$attributes
array to functions that generate tags, so you can add arbitrary HTML attributes
- Added
cspNonce
setting to allow for Content Security Policy nonce support for inline CSS/JS
- Switched over to using Yii2's
Html::
helpers for creating various tags
- Make sure
$moduleHash
is never undefined
- Added the config setting
devServerBuildType
to determine which webpack-dev-server bundle is loaded. - Support passing an array of filenames for
errorEntry
- Switched over to using
media="print"
for asynchronously loading a stylesheet as per The Simplest Way to Load CSS Asynchronously - Deprecated
craft.twigpack.includeCssRelPreloadPolyfill()
since it is no longer necessary. It now does nothing
- If this is a dev-server, look for the modern manifest file first
- Added the config setting
useAbsoluteUrl
to control whether module URLs will be forced to be fully qualified aboslute URLs
- If we're in
devMode
invalidate the cache immediately - If an error is reported, and
self::$isHot
istrue
log it as a warning, not an error
- Fixed an issue with
includeFileFromManifest()
not working due to recent changes
- Revert a PR that caused Twigpack to no longer gracefully fall back on locally built assets if the
webpack-dev-server
is not running - Add a short timeout to
file_get_contents
to prevent it from taking too long if the file doesn't exist
- Changed examples to use
’dev’
for local development (instead of’local’
)
- Added
getModuleHash()
function, to grab the hash key of a module
- Fixed an issue where
isHot
was not set before use - Fixed
getFileFromManifest()
to load files from webpack-dev-server
- Added
cacheKeySuffix
to the Settings model
- Clarify expected output with no second param
- Code cleanup
- Fixed an issue where
null
could potentially be passed in toresolveTemplate()
- Fixed a typo in the
twigpack-manifest-cache
cache key - Changed deprecated
\Twig_Markup
to\Twig\Markup
- Elaborated on Twigpack's caching and how to clear it in the
README.md
- Handle the case where there is an error decoding the JSON from the manifest
- Updated the documentation to reflect using
@webroot/
by default for theserver
manifestPath
- Make
includeCriticalCssTags()
andincludeInlineCssTags()
soft errors that do nothing if the file is missing
- Added the ability for Hot Module Replacement (HMR) to work through Twig error template pages via the
errorEntry
setting inconfig.php
- Fixed an issue where if the
manifest.json
was served remotely via https, Twigpack was unable to load it - Made all errors "soft" for missing CSS/JS modules, so a warning will be logged, but life continues on
- Strings passed in to
manifestPath
can now be Yii2 aliases as well - Added
craft.twigpack.includeFile()
- Added
craft.twigpack.includeFileFromManifest()
- Added
craft.twigpack.includeInlineCssTags()
- Added
craft.twigpack.includeCriticalCssTags()
- Check via
empty()
rather than!== null
when checking the manifest for module entries - CSS module loading generates a soft error now, rather than throwing an
NotFoundHttpException
- Added
this.onload=null;
to async CSS link tag - Added
craft.twigpack.includeCssRelPreloadPolyfill()
- Better error reporting if modules don't exist in the manifest
- Allow the
manifestPath
to be a file system path or a URI
- Added
getModuleUri()
function - Added
getManifestFile()
function
- Fixed return types to allow for null
- Code refactoring
- Better error logging if the manifest file can't be found (check
storage/logs/web.log
) - Throw a
NotFoundHttpException
if themanifest.json
cannot be found
- Initial release