Skip to content

Commit

Permalink
Merge branch 'release/1.0.34' into v1
Browse files Browse the repository at this point in the history
  • Loading branch information
khalwat committed Mar 2, 2024
2 parents a3f35c8 + e0c1e23 commit 74e2b45
Show file tree
Hide file tree
Showing 8 changed files with 464 additions and 357 deletions.
1 change: 0 additions & 1 deletion .craftplugin

This file was deleted.

26 changes: 17 additions & 9 deletions .github/workflows/code-analysis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,20 @@ jobs:
name: ${{ matrix.actions.name }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# see https://github.com/shivammathur/setup-php
- uses: shivammathur/setup-php@v2
with:
php-version: 8.2
coverage: none
# composer install cache - https://github.com/ramsey/composer-install
- uses: "ramsey/composer-install@v2"
- run: ${{ matrix.actions.run }}
- uses: actions/checkout@v4
- name: Cache Composer dependencies
uses: actions/cache@v4
with:
path: /tmp/composer-cache
key: ${{ runner.os }}-${{ hashFiles('**/composer.lock') }}
- name: Setup PHP
id: setup-php
uses: shivammathur/setup-php@v2
with:
php-version: 8.2
extensions: 'ctype,curl,dom,iconv,imagick,intl,json,mbstring,openssl,pcre,pdo,reflection,spl,zip'
ini-values: post_max_size=256M, max_execution_time=180, memory_limit=512M
tools: composer:v2
- name: Install Composer dependencies
run: composer install --no-interaction --no-ansi --no-progress
- run: ${{ matrix.actions.run }}
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

All notable changes to this project will be documented in this file.

## 1.0.34 - 2024.03.02
### Fixed
* Fixed an issue where the wrong CSS hash would be returned if you were using Vite 3 or earlier ([#80](https://github.com/nystudio107/craft-vite/issues/80))
* Fixed an issue where `craft.vite.entry()` would fail if you were using Vite 5 or later, due to the `ManifestHelper::fileNameWithoutHash()` function not working correctly ([#24](https://github.com/nystudio107/craft-plugin-vite/issues/24))

## 1.0.33 - 2024.01.30
### Added
* If the `devServer` is running, the `ViteService::fetch()` method will try to use the `devServerInternal` URL first, falling back on the `devServerPublic` so that `craft.vite.inline()` can pull from the `devServer` if it is running ([#22](https://github.com/nystudio107/craft-plugin-vite/issues/22))
Expand Down
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "nystudio107/craft-vite",
"description": "Allows the use of the Vite.js next generation frontend tooling with Craft CMS",
"type": "craft-plugin",
"version": "1.0.33",
"version": "1.0.34",
"keywords": [
"craft",
"cms",
Expand All @@ -23,15 +23,15 @@
],
"require": {
"craftcms/cms": "^3.0.0",
"nystudio107/craft-plugin-vite": "^1.0.33"
"nystudio107/craft-plugin-vite": "^1.0.34"
},
"require-dev": {
"craftcms/ecs": "dev-main",
"craftcms/phpstan": "dev-main",
"craftcms/rector": "dev-main"
},
"scripts": {
"phpstan": "vendor/bin/phpstan --ansi --memory-limit=1G",
"phpstan": "phpstan --ansi --memory-limit=1G",
"check-cs": "ecs check --ansi",
"fix-cs": "ecs check --fix --ansi"
},
Expand Down
27 changes: 13 additions & 14 deletions docs/docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -359,8 +359,8 @@ services:
expose:
- '3000'
environment:
- HTTP_EXPOSE=${DDEV_ROUTER_HTTP_PORT}:80,${DDEV_MAILHOG_PORT}:8025,3001:3000
- HTTPS_EXPOSE=${DDEV_ROUTER_HTTPS_PORT}:80,${DDEV_MAILHOG_HTTPS_PORT}:8025,3000:3000
- HTTP_EXPOSE=${DDEV_ROUTER_HTTP_PORT}:80,${DDEV_MAILPIT_PORT}:8025,3001:3000
- HTTPS_EXPOSE=${DDEV_ROUTER_HTTPS_PORT}:80,${DDEV_MAILPIT_HTTPS_PORT}:8025,3000:3000
```
In your `vite.config.js`, the `server.host` should to be set to `0.0.0.0`, and `server.port` set to `3000`:
Expand Down Expand Up @@ -501,8 +501,16 @@ JavaScript file via Twig in a `<script>` tag, you instead do:
{{ craft.vite.script("src/js/app.ts") }}
```
Note that Vite automatically also supports the direct linking to TypeScript (as in the above example), JSX, and other
files via plugins. You just link directly to them, that’s it.
Vite automatically supports the direct linking to TypeScript (as in the above example), JavaScript, JSX, and other
files formats via plugins. You just link directly to them, that’s it.
::: tip CSS is Asynchronous by default
By default, the Vite plugin will load your [CSS asynchronously](https://www.filamentgroup.com/lab/load-css-simpler/). If you are **not** using Critical CSS, you'll want to change that to avoid Flash Of Unstyled Content (FOUC) by setting the setting the second argument to `false`:
```twig
{{ craft.vite.script("src/js/app.ts", false) }}
```
See the **[Other Options](#other-options)** section below for details
:::
##### Development
Expand Down Expand Up @@ -586,16 +594,7 @@ import '/src/css/app.pcss';
The Vite plugin will take care of automatically generating the `<link rel="stylesheet">` tag for you in production.
By default, it loads the [CSS asynchronously](https://www.filamentgroup.com/lab/load-css-simpler/), but you can
configure this. See the **Other Options** section.
#### Polyfills
To work properly, you must also import the [Vite Polyfill](https://vitejs.dev/config/#build-polyfilldynamicimport) in
your `build.input` JavaScript file entries listed in the `vite.config.js`, for example:
```js
import "vite/dynamic-import-polyfill";
```
configure this. See the **[Other Options](#other-options)** section.
#### Legacy
Expand Down
Loading

0 comments on commit 74e2b45

Please sign in to comment.