Skip to content

Commit

Permalink
Switch to SASS Embedded Host (Fix: #327) - PR#371 from glenn2223
Browse files Browse the repository at this point in the history
### Breaking Changes

-   We have moved to the quicker `sass-embedded`. Closes [#327](#327)  
    This uses the latest compiler, but drops these settings:
    -   `liveSassCompile.settings.formats[].linefeed`
    -   `liveSassCompile.settings.formats[].indentType`
    -   `liveSassCompile.settings.formats[].indentWidth`  
        _Note: these 3 would've been dropped for SASS 2.0 anyway_
    -   `liveSassCompile.settings.useNewCompiler`

### Changed

-   Switched from `[email protected]` to `[email protected]` - as mentioned above

### Updated

-   `autoprefixer` to `10.4.20` [Changelog][cl:fd]
-   `fdir` to `6.3.0` [Changelog][cl:fd]
-   `picomatch` to `4.0.2` [Changelog][cl:pm]
-   `postcss` to `8.4.47` [Changelog][cl:pc]
-   Various dev dependency updates _(nothing user facing)_

[cl:ap]: https://github.com/postcss/autoprefixer/blob/main/CHANGELOG.md
[cl:fd]: https://github.com/thecodrr/fdir/releases
[cl:pc]: https://github.com/postcss/postcss/blob/main/CHANGELOG.md
[cl:pm]: https://github.com/micromatch/picomatch/blob/master/CHANGELOG.md
  • Loading branch information
glenn2223 authored Sep 21, 2024
2 parents a44ef47 + 91422ac commit 87b33f5
Show file tree
Hide file tree
Showing 24 changed files with 2,067 additions and 1,088 deletions.
4 changes: 4 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"tabWidth": 4,
"useTabs": false
}
16 changes: 10 additions & 6 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,13 @@
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": ["--extensionDevelopmentPath=${workspaceRoot}"],
"stopOnEntry": false,
"args": [
"--extensionDevelopmentPath=${workspaceRoot}"
],
"sourceMaps": true,
"outFiles": ["${workspaceRoot}/out/src/**/*.js"],
"outFiles": [
"${workspaceRoot}/out/src/**/*.js"
],
"preLaunchTask": "pack"
},
{
Expand All @@ -23,10 +26,11 @@
"--extensionTestsPath=${workspaceRoot}/out/test/index",
"./assets/"
],
"stopOnEntry": false,
"sourceMaps": true,
"outFiles": ["${workspaceRoot}/out/test/**/*.js"],
"outFiles": [
"${workspaceRoot}/out/test/**/*.js"
],
"preLaunchTask": "npm: pretest"
}
]
}
}
24 changes: 24 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,30 @@ Types of changes

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

## Unreleased

### Breaking Changes

- We have moved to the quicker `sass-embedded`. Closes [#327](https://github.com/glenn2223/vscode-live-sass-compiler/issues/327)
This uses the latest compiler, but drops these settings:
- `liveSassCompile.settings.formats[].linefeed`
- `liveSassCompile.settings.formats[].indentType`
- `liveSassCompile.settings.formats[].indentWidth`
_Note: these 3 would've been dropped for SASS 2.0 anyway_
- `liveSassCompile.settings.useNewCompiler`

### Changed

- Switched from `[email protected]` to `[email protected]` - as mentioned above

### Updated

- `autoprefixer` to `10.4.20` [Changelog][cl:fd]
- `fdir` to `6.3.0` [Changelog][cl:fd]
- `picomatch` to `4.0.2` [Changelog][cl:pm]
- `postcss` to `8.4.47` [Changelog][cl:pc]
- Various dev dependency updates _(nothing user facing)_

## [6.1.2] - 2023-11-22

<small>[Compare to previous release][comp:6.1.2]</small>
Expand Down
11 changes: 6 additions & 5 deletions docs/faqs.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Here's some of the most important changes:

- We now require VS Code version 1.74
- We are no longer dependant on `ritwickdey.LiveServer`. You can manually add this package to VS Code, if you need it
- We are using a quicker type of SASS
- Some settings have been changed
- `formats[]`:
- `format` only accepts `compressed` or `expanded`
Expand All @@ -31,18 +32,15 @@ Here's some of the most important changes:
- `formats[]`:
- `savePathReplacementPairs`: replace segments in the output path
- `generateMap`: generate map files at a format level (overwriting the top-tier setting of the same name)
- `linefeed`: control the line terminator used
- `indentType`: control whether indents are spaces or tabs
- `indentWidth`: control the width of the indentation
- `watchOnLaunch`: state whether you want to watch files upon launch
- `compileOnWatch`: state if files should be compiled upon watching
- `forceBaseDirectory`: state the base directory of all you SASS files. Aids in reducing wasted resources while searching for files
- `partialsList`: specify what files are actually partials (or which folders contain them)
- `useNewCompiler`: use the latest version of the JS SASS compiler. It's quicker, and addresses some issues; but mainly, IT'S QUICKER!

Here are some things you probably won't care about as much

- The extension has had a massive overhaul. Performance optimisation, and new features!
- The quicker SASS package is `sass-embedded`. This utilises DartSass directly - rather than a JS interpreted version
- We abandoned `glob` (the package, not the patterns) and we now use `fdir` which is blazingly fast
- New commands!
- `liveSass.command.compileCurrentSass`: perform a one-time compilation of the current SASS file
Expand Down Expand Up @@ -79,7 +77,10 @@ Open the `settings.json` file and type following key-value pairs. _By the way, y
"savePath": "/dist/css"
}
],
"liveSassCompile.settings.excludeList": ["**/node_modules/**", ".vscode/**"],
"liveSassCompile.settings.excludeList": [
"**/node_modules/**",
".vscode/**"
],
"liveSassCompile.settings.generateMap": true,
"liveSassCompile.settings.autoprefix": ["defaults"]
}
Expand Down
37 changes: 7 additions & 30 deletions docs/settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,13 @@
An array of formats. Allows you save to multiple locations, with a customisable format and extension for each

| Properties | Type | Default | Notes |
| ------------------------- | -------------------------------- | ---------- | -------------------------------------------------------------------- |
| format | `expanded` OR `compressed` | `expanded` | The output style of the generated file |
| extensionName | `string` | `.css` | The extension suffix added to the output file (must end with `.css`) |
| savePath | `string?` | `null` | See [save path notes] |
| savePathReplacementPairs | `Record<string, string>?` | `null` | See [save path notes] |
| generateMap | `boolean?` | `null` | Choose to output maps at a format level instead |
| <sup>Ŧ</sup>_linefeed_ | `cr` OR `crlf` OR `lf` OR `lfcr` | `lf` | The linefeed terminator to use |
| <sup>Ŧ</sup>_indentType_ | `space` OR `tab` | `space` | The indentation to use for the `expanded` format |
| <sup>Ŧ</sup>_indentWidth_ | `number` | `2` | The indentation width used for the `expanded` format |

<small><sup>Ŧ</sup> These will be removed in SASS v2.0 and are currently unavailable when `liveSassCompile.settings.useNewCompiler` is `true`</small>
| Properties | Type | Default | Notes |
| ------------------------ | -------------------------- | ---------- | -------------------------------------------------------------------- |
| format | `expanded` OR `compressed` | `expanded` | The output style of the generated file |
| extensionName | `string` | `.css` | The extension suffix added to the output file (must end with `.css`) |
| savePath | `string?` | `null` | See [save path notes] |
| savePathReplacementPairs | `Record<string, string>?` | `null` | See [save path notes] |
| generateMap | `boolean?` | `null` | Choose to output maps at a format level instead |

<details>
<summary>Examples</summary>
Expand Down Expand Up @@ -314,24 +309,6 @@ Tells the compiler that a leading slash is relative to the workspace root rather
---
## liveSassCompile.settings.useNewCompiler
> ℹ This setting can vary between workspace folders - [read more][multi-rootfaq]
SASS have introduced a new entry point in their JS API. This new API is designed to be more performant than the old one. Go on, kick the tyres on this new entry point (before it comes mandatory in SASS 2.0).
> **Warning**
> This method does not apply any of the following settings (and never will <sup>[[ref]](https://github.com/sass/dart-sass/issues/1585#issuecomment-1005184692)</sup>)
>
> - `liveSassCompile.settings.formats[].linefeed`
> - `liveSassCompile.settings.formats[].indentType`
> - `liveSassCompile.settings.formats[].indentWidth`
**Type:** `boolean`
**Default:** `false`
---
## liveSassCompile.settings.showAnnouncements
Stop announcements each time a new version is installed.
Expand Down
Loading

0 comments on commit 87b33f5

Please sign in to comment.