Changelog
0.2.x
0.2.5
Install/upgrade:
shnpm install --save @eastsideco/salvo-ts@0.2.5 @eastsideco/salvo-ts-build@0.2.5
shnpm install --save @eastsideco/salvo-ts@0.2.5 @eastsideco/salvo-ts-build@0.2.5
- Bugfixes:
- Fix component CSS injection issues where CSS included octal escape strings.
- Removed unnecessary
reflect-metadatadependency.
0.2.4
Install/upgrade:
shnpm install --save @eastsideco/salvo-ts@0.2.4 @eastsideco/salvo-ts-build@0.2.4
shnpm install --save @eastsideco/salvo-ts@0.2.4 @eastsideco/salvo-ts-build@0.2.4
- Critical CSS only output: For easier development and troubleshooting of critical styles, you can now compile your theme with only your critical styles (docs)
- SALVO CLI: salvo-ts-build now incorporates CLI commands for certain theme prep tasks (docs)
- Improvements:
- Themes built in dev mode now refuse to render when published. Stop releasing themes built in dev mode. (docs)
- Compiler will now warn when the theme is specifying dependencies in package.json shared by salvo-ts, which are known to cause version conflicts
- Cleaned up internal console logs and fixed a bug which caused certain log levels to bypass log level filtering - production builds will now be much quieter by default (docs)
- The schema for
salvo.config.jsis now published under@eastsideco/salvo-ts-build/schemas/config, allowing for type checking in supported editors (docs)
- Docs:
- Updated optimization to add dev mode reminder details.
- Updated configuration - added new options.
- Added SALVO CLI.
- Fixed and updated various examples throughout the docs to be accurate and up-to-date.
- Gave the docs a fresh coat of paint.
Add salvo to your package.json (in scripts):
package.jsonjson"scripts": {"dev": "cross-env NODE_ENV=development node node_modules/@eastsideco/salvo-ts-build/src/index.js --config ./salvo.config.js","prod": "cross-env NODE_ENV=production node node_modules/@eastsideco/salvo-ts-build/src/index.js --config ./salvo.config.js""prod": "cross-env NODE_ENV=production node node_modules/@eastsideco/salvo-ts-build/src/index.js --config ./salvo.config.js","salvo": "node node_modules/@eastsideco/salvo-ts-build/src/cli.js --config ./salvo.config.js"},
package.jsonjson"scripts": {"dev": "cross-env NODE_ENV=development node node_modules/@eastsideco/salvo-ts-build/src/index.js --config ./salvo.config.js","prod": "cross-env NODE_ENV=production node node_modules/@eastsideco/salvo-ts-build/src/index.js --config ./salvo.config.js""prod": "cross-env NODE_ENV=production node node_modules/@eastsideco/salvo-ts-build/src/index.js --config ./salvo.config.js","salvo": "node node_modules/@eastsideco/salvo-ts-build/src/cli.js --config ./salvo.config.js"},
Change these lines in your salvo.config.js to enable type checking:
salvo.config.jsts// @ts-checkconst path = require('path');module.exports = {// ... options ...};const config = { /** @type {import('@eastsideco/salvo-ts-build/schema/config').SalvoConfig} */// ... options ...};module.exports = config;
salvo.config.jsts// @ts-checkconst path = require('path');module.exports = {// ... options ...};const config = { /** @type {import('@eastsideco/salvo-ts-build/schema/config').SalvoConfig} */// ... options ...};module.exports = config;
0.2.3
Install/upgrade:
npm install --save @eastsideco/salvo-ts@0.2.3 @eastsideco/salvo-ts-build@0.2.3
npm install --save @eastsideco/salvo-ts@0.2.3 @eastsideco/salvo-ts-build@0.2.3
- Bugfixes
- Fix output filenames incorrect for nested static files.
0.2.2
Install/upgrade:
npm install --save @eastsideco/salvo-ts@0.2.2 @eastsideco/salvo-ts-build@0.2.2
npm install --save @eastsideco/salvo-ts@0.2.2 @eastsideco/salvo-ts-build@0.2.2
- SVG icon asset support: SVGs can now be added under
assets/icons/and rendered using{! icon 'foo' !}[#57] (docs) - CWV overlay: A new overlay is now enabled by default on non-published themes which helps you optimize critical styles and troubleshoot Core Web Vitals issues [#63] (docs)
- Improvements:
- Minification is now enabled by default in production (configure via
salvoConfig.optimization.minify) [#62] - Compiler now validates subfolder structures for static files and components [#53]
- Improved compiler error reporting and fixed certain error details being omitted when running in dev mode [#58]
- Improved component loading to remove dependency on the Reflect API (avoids compatibility issue with TikTok analytics) [#60]
- Handle
preloader: 'blank'better when JS is disabled [#61] - Removed the "
window.exportspatch" to avoid compatibility issues [#56] - General performance improvements.
- Minification is now enabled by default in production (configure via
- Bugfixes:
- Fixed compiler not noticing new or deleted files for certain folders/filetypes [#54]
- Fixed code-splitting issues related to
__vite-browser-external[#42] - Fixed
cssBuildMode: inlinenot respectingcssInlineLimit[#46] - Fixed
Invalid JSONwhen passingprop="0"where@Prop({ default: null }) prop!: number|null[#40] - Fixed generated
importmapincluding unneeded references to non-compiled JS files [#55]
- Docs
- Added file structure - covers overall structure and file nesting rules (previously missing from 0.2.x docs).
- Added component basics - covers the basics of props, refs, and component decorators (previously missing from 0.2.x docs).
- Added component styles - covers basics of component styling.
- Rewrote static files - now includes a list of available compiler macros, and some basic details about escaping conventions.
- Updated configuration - added new options, indicated deprecated/discouraged options.
- Added svg icons.
- Updated optimization.
- Improved the display of code samples and directory listings through the docs.
- Subfolder validation
- Decorators
- `exports` not defined
Themes with invalid file/folder structures which were previously accepted may see errors after upgrading. Follow the instructions to resolve the errors.
Subfolder/file naming rules:
- Components:
- The filename must start with the subfolder path (relative to
src/components/), with no separators.
- The filename must start with the subfolder path (relative to
- Sections, snippets, assets:
- The filename must start with the subfolder path (relative to
static/sections/etc.), with_as the path separator.
- The filename must start with the subfolder path (relative to
Examples:
| Valid | Invalid |
|---|---|
src/components/Product/ProductForm.ts | src/components/Products/ProductForm.ts |
src/components/Customer/Account/CustomerAccountOrders.ts | src/components/Customer/Account/Orders.ts |
static/snippets/global/global_apps.liquid | static/snippets/global_apps.liquid |
static/sections/product/main/product_main_form.liquid | static/sections/product/main/product_main-form.liquid |
Decorators other than Component, Ref, and Prop are no longer allowed inside of component files.
If your theme contains use of decorators which are not allowed you will receive a compiler error showing the affected file.
If you are using custom decorators rewrite your components to avoid using them, for example by moving the logic to not require decorators, or moving the usage of the decorator into another (non-component) file.
Instructions for replacing common disallowed decorators:
@Watch- previously allowed you to listen to a class property and call a method when it is changed.Resolution: Rewrite the property as a getter/setter and call the method in the setter.
Example:
Beforets@Componentclass ExampleComponent extends ThemeComponent {public shouldIncludeGift: boolean;@Watch('shouldIncludeGift')public updateCart() {// ...}}Beforets@Componentclass ExampleComponent extends ThemeComponent {public shouldIncludeGift: boolean;@Watch('shouldIncludeGift')public updateCart() {// ...}}Afterts@Componentclass ExampleComponent extends ThemeComponent {private _shouldIncludeGift: boolean;public get shouldIncludeGift(): boolean {return this._shouldIncludeGift;}public set shouldIncludeGift(v: boolean) {this._shouldIncludeGift = v;this.updateCart();}public updateCart() {// ...}}Afterts@Componentclass ExampleComponent extends ThemeComponent {private _shouldIncludeGift: boolean;public get shouldIncludeGift(): boolean {return this._shouldIncludeGift;}public set shouldIncludeGift(v: boolean) {this._shouldIncludeGift = v;this.updateCart();}public updateCart() {// ...}}
@Observable- previously allowed you to run a callback whenever a class property was changed.- Resolution: Rewrite the property as a getter/setter and run the logic in the setter.
- ExampleBeforets@Componentclass ExampleComponent extends ThemeComponent {@Observable({callback: (v) => {console.log(`Hello ${v}!`);}})public customerName: string;}Beforets@Componentclass ExampleComponent extends ThemeComponent {@Observable({callback: (v) => {console.log(`Hello ${v}!`);}})public customerName: string;}Afterts@Componentclass ExampleComponent extends ThemeComponent {private _customerName: string;public get customerName(): string {return this._customerName;}public set customerName(v: string) {this._customerName = v;console.log(`Hello ${v}!`);}}Afterts@Componentclass ExampleComponent extends ThemeComponent {private _customerName: string;public get customerName(): string {return this._customerName;}public set customerName(v: string) {this._customerName = v;console.log(`Hello ${v}!`);}}
If you notice 'exports' not defined errors in your browser console, your build may have been reliant on the "window.exports patch" which was removed in this update. Reach out for support.
0.2.1
Install/upgrade:
npm install --save @eastsideco/salvo-ts@0.2.1 @eastsideco/salvo-ts-build@0.2.1
npm install --save @eastsideco/salvo-ts@0.2.1 @eastsideco/salvo-ts-build@0.2.1
- Fixed Shopify caching issues with component CSS when loaded async [#43]
- Added missing built-in functions for
cart.queryItems[#44] - Fixed critical styles being added without the appropriate style tag [#45]
- Fixed incorrect prop type resolution for unions of primitive types (i.e.
'A'|'B') [#47] - Fixed manual preload components being loaded by the wrong path [#48]
- Fixed changes to component templates and static assets not triggering re-build in dev mode [#50]
- Fixed critical styles disappearing in watch mode [#51]
- Added support for metaobject templates under
templates/metaobject/(...).json[#52]
0.2.0
Install/upgrade: Refer to Installation or Migrating from 0.1.x.
- Overhauled compiler. The compiler is now built on top of Rollup and Vite. It runs faster, behaves better with other tools, and is more stable.
- Async component loading. Components are now loaded on-demand, reducing bundle sizes and improving performance. Defining components to pre-load (or using the experimental auto-preload feature) ensures critical components are ready immediately.
- Critical CSS authoring. Custom media queries for defining critical CSS make it easier to keep critical CSS up-to-date.
- Added
optimizations.previewBarto hide/customize the Shopify theme preview bar. - Updated to Typescript 5.1.
- Updated to Sass 1.63.
0.1.x
0.1.53
Install/upgrade:
npm install --save @eastsideco/salvo-ts@0.1.53 @eastsideco/salvo-ts-build@0.1.53
npm install --save @eastsideco/salvo-ts@0.1.53 @eastsideco/salvo-ts-build@0.1.53
- Fixed issue where build variant would be included in the automatically generated section classname, leading to a validation error.
0.1.52
Install/upgrade:
npm install --save @eastsideco/salvo-ts@0.1.52 @eastsideco/salvo-ts-build@0.1.52
npm install --save @eastsideco/salvo-ts@0.1.52 @eastsideco/salvo-ts-build@0.1.52
- Build variants are now supported for
@importdirectives in SCSS files. The import must be suffixed with~if a default-build-variant (unsuffixed filename) version of the file exists (https://github.com/sass/dart-sass/issues/574)
0.1.51
Install/upgrade:
npm install --save @eastsideco/salvo-ts@0.1.51 @eastsideco/salvo-ts-build@0.1.51
npm install --save @eastsideco/salvo-ts@0.1.51 @eastsideco/salvo-ts-build@0.1.51
- Build variants are now supported for
@importdirectives in SCSS files.
0.1.50
Install/upgrade:
npm install --save @eastsideco/salvo-ts@0.1.50 @eastsideco/salvo-ts-build@0.1.50
npm install --save @eastsideco/salvo-ts@0.1.50 @eastsideco/salvo-ts-build@0.1.50
- Build variants are now supported for
static/assets.
0.1.49
Install/upgrade:
npm install --save @eastsideco/salvo-ts@0.1.49 @eastsideco/salvo-ts-build@0.1.49
npm install --save @eastsideco/salvo-ts@0.1.49 @eastsideco/salvo-ts-build@0.1.49
- Added support for build variants (docs pending).
- Add
buildVariant: nullin your project'ssalvo.config.js. - Change the
registerComponentscall insrc/main.tstoregisterComponents(require.context('./components/', true), process.env.SALVO_BUILD_VARIANT);
0.1.48
Install/upgrade:
npm install --save @eastsideco/salvo-ts@0.1.48 @eastsideco/salvo-ts-build@0.1.48
npm install --save @eastsideco/salvo-ts@0.1.48 @eastsideco/salvo-ts-build@0.1.48
- Re-enable prod minification.
- Add warning when
output.themeJssetting ends in only.js(rather than.min.js) to help avoid theme JS being mangled by Shopify.
- Change
output.themeJsfromtheme.jstotheme.min.jsin your project'ssalvo.config.js.
0.1.47
Install/upgrade:
npm install --save @eastsideco/salvo-ts@0.1.47 @eastsideco/salvo-ts-build@0.1.47
npm install --save @eastsideco/salvo-ts@0.1.47 @eastsideco/salvo-ts-build@0.1.47
- Temporarily disable minification in prod builds.
0.1.46
Install/upgrade:
npm install --save @eastsideco/salvo-ts@0.1.46 @eastsideco/salvo-ts-build@0.1.46
npm install --save @eastsideco/salvo-ts@0.1.46 @eastsideco/salvo-ts-build@0.1.46
- Disabled all symbol mangling in production builds to workaround unwanted component class name mangling.
0.1.45
Install/upgrade:
npm install --save @eastsideco/salvo-ts@0.1.45 @eastsideco/salvo-ts-build@0.1.45
npm install --save @eastsideco/salvo-ts@0.1.45 @eastsideco/salvo-ts-build@0.1.45
- Fix Liquid schema error when a section's schema tags are formatted unusually.
0.1.44
Install/upgrade:
npm install --save @eastsideco/salvo-ts@0.1.44 @eastsideco/salvo-ts-build@0.1.44
npm install --save @eastsideco/salvo-ts@0.1.44 @eastsideco/salvo-ts-build@0.1.44
- Fix Liquid schema error when a section has a schema which doesn't define a class.
0.1.43
Install/upgrade:
npm install --save @eastsideco/salvo-ts@0.1.43 @eastsideco/salvo-ts-build@0.1.43
npm install --save @eastsideco/salvo-ts@0.1.43 @eastsideco/salvo-ts-build@0.1.43
- Fixed webpack schema error when running
npm run prod.
0.1.40 - 0.1.42
Versions skipped.
0.1.39
Install/upgrade:
npm install --save @eastsideco/salvo-ts@0.1.39 @eastsideco/salvo-ts-build@0.1.39
npm install --save @eastsideco/salvo-ts@0.1.39 @eastsideco/salvo-ts-build@0.1.39
- Added experimental locale auditing. Use
npm run dev -- --audit-localesto opt-in. - Fixed section metadata classes.
0.1.38
Install/upgrade:
npm install --save @eastsideco/salvo-ts@0.1.38 @eastsideco/salvo-ts-build@0.1.38
npm install --save @eastsideco/salvo-ts@0.1.38 @eastsideco/salvo-ts-build@0.1.38
- Temporarily disable section metadata classes due to Shopify errors.
0.1.37
Install/upgrade:
npm install --save @eastsideco/salvo-ts@0.1.37 @eastsideco/salvo-ts-build@0.1.37
npm install --save @eastsideco/salvo-ts@0.1.37 @eastsideco/salvo-ts-build@0.1.37
- Added
featured_imagetoShopify.Liquid.Variant. - Fixed links in docs.
0.1.36
Install/upgrade:
npm install --save @eastsideco/salvo-ts@0.1.36 @eastsideco/salvo-ts-build@0.1.36
npm install --save @eastsideco/salvo-ts@0.1.36 @eastsideco/salvo-ts-build@0.1.36
- Added auto-generated typings for Shopify Liquid objects (docs).
0.1.35
Install/upgrade:
npm install --save @eastsideco/salvo-ts@0.1.35 @eastsideco/salvo-ts-build@0.1.35npm install --save typescript@4.5
npm install --save @eastsideco/salvo-ts@0.1.35 @eastsideco/salvo-ts-build@0.1.35npm install --save typescript@4.5
- Updated Typescript to 4.5 (from 4.3). More details:
- Added more linting rules based on eslint/typescript-eslint recommendations.
- Fixed unintentional generation of
dist/tmp_src/...files.
- Some changes may be required to support Typescript 4.5. Note that if you use VSCode's typescript support it's possibly that your editor was already making suggestions based on 4.5 rules, so you may have already made this changes.
- Many of the new linting rules are auto-fix, but some changes may be required to your code for some of the rules. (Suggestion: If you are unsure how to resolve a lint error, google the error name and look at the description of the rule. There will usually be example solutions provided.)
0.1.34
Install/upgrade:
npm install --save @eastsideco/salvo-ts@0.1.34 @eastsideco/salvo-ts-build@0.1.34
npm install --save @eastsideco/salvo-ts@0.1.34 @eastsideco/salvo-ts-build@0.1.34
- Added --noclear option for debugging fatal compiler errors.
- Expose error messages when fatal compiler errors occur.
0.1.33
Install/upgrade:
npm install --save @eastsideco/salvo-ts@0.1.33 @eastsideco/salvo-ts-build@0.1.33
npm install --save @eastsideco/salvo-ts@0.1.33 @eastsideco/salvo-ts-build@0.1.33
- Improve error messages for project config validation errors.
0.1.32
Install/upgrade:
npm install --save @eastsideco/salvo-ts@0.1.32 @eastsideco/salvo-ts-build@0.1.32
npm install --save @eastsideco/salvo-ts@0.1.32 @eastsideco/salvo-ts-build@0.1.32
- Fixed "module not found" errors during manifest generation when importing (s)css files.
- Updated docs, improved docs homepage.
0.1.30 - 0.1.31
Versions skipped.
0.1.29
Install/upgrade:
npm install --save @eastsideco/salvo-ts@0.1.29 @eastsideco/salvo-ts-build@0.1.29
npm install --save @eastsideco/salvo-ts@0.1.29 @eastsideco/salvo-ts-build@0.1.29
- Added changelog.
0.1.28
Install/upgrade:
npm install --save @eastsideco/salvo-ts@0.1.28 @eastsideco/salvo-ts-build@0.1.28
npm install --save @eastsideco/salvo-ts@0.1.28 @eastsideco/salvo-ts-build@0.1.28
- Your
salvo.config.jsis now validated andnpm run devwill throw validation errors if it doesn't match the expected structure. - The compiler will now validate that the versions of
@eastsideco/salvo-tsand@eastsideco/salvo-ts-buildyou have installed match. If they don't,npm run devwill throw an error and give you a command to run to upgrade.
0.1.23 - 0.1.27
Versions skipped.
0.1.22
Install/upgrade:
npm install --save @eastsideco/salvo-ts@0.1.22 @eastsideco/salvo-ts-build@0.1.22
npm install --save @eastsideco/salvo-ts@0.1.22 @eastsideco/salvo-ts-build@0.1.22
- Removed manifest polyfill for
document. - Added ability to exclude specified packages from manifest generation. By adding a package to
manifest.ignorePackages, it will be replaced withmodule.exports = {}when manifest generation happens. This should allow you to effectively avoid manifest generation errors related to using browser-only packages (as long as your module doesn't have side-effects that touch it, which is discouraged anyway.)
To clarify the limitation regarding using an ignored package in a module with side-effects (and how it relates to decorators especially):
Assuming that 'foo' is in your manifest.ignoredPackages, these are okay:
tsimport { doFoo } from 'foo'export class MyComponent extends ThemeComponent {init() {doFoo();}}orimport { doFoo } from 'foo';export function helpfulUtilityFunction() {// do a bunch of thingsdoFoo();}
tsimport { doFoo } from 'foo'export class MyComponent extends ThemeComponent {init() {doFoo();}}orimport { doFoo } from 'foo';export function helpfulUtilityFunction() {// do a bunch of thingsdoFoo();}
When you import either of these modules, doFoo from foo is never actually touched, only when those classes/functions are used.
These would NOT be okay:
tsimport { doFoo } from 'foo';export class MyComponent extends ThemeComponent {@Prop({ default: doFoo() }) thing: string;}orimport { doFoo } from 'foo';doFoo();
tsimport { doFoo } from 'foo';export class MyComponent extends ThemeComponent {@Prop({ default: doFoo() }) thing: string;}orimport { doFoo } from 'foo';doFoo();
Because in both of these cases, doFoo from foo is touched immediately when these modules are imported. When the manifest generation is running, foo will be replaced with an empty module, so doFoo won't exist and this will throw an error. (Reminder: Prop and other decorators are evaluated when your class is defined [i.e. on import], not when it's used, which is why using it in a decorator argument is problematic.)
- Add the following section to your
salvo.config.js(inside themodule.exports = {...}):
jsmanifest: {// Packages added here will be replaced with a no-op module during manifest generation.// Add any misbehaving packages which expect a browser environment to be available on import.ignorePackages: []},
jsmanifest: {// Packages added here will be replaced with a no-op module during manifest generation.// Add any misbehaving packages which expect a browser environment to be available on import.ignorePackages: []},
- Add the name of any packages which depended on the document polyfill to
manifest.ignorePackageslike this:
jsmanifest: {ignorePackages: ['plyr',]},
jsmanifest: {ignorePackages: ['plyr',]},
0.1.21
Install/upgrade:
npm install --save @eastsideco/salvo-ts@0.1.21 @eastsideco/salvo-ts-build@0.1.21
npm install --save @eastsideco/salvo-ts@0.1.21 @eastsideco/salvo-ts-build@0.1.21
- Fix: Added minimal polyfill for
window.documentduring manifest generation.
0.1.20
Install/upgrade:
npm install --save @eastsideco/salvo-ts@0.1.20 @eastsideco/salvo-ts-build@0.1.20
npm install --save @eastsideco/salvo-ts@0.1.20 @eastsideco/salvo-ts-build@0.1.20
- Added minimal polyfill for
window.documentduring manifest generation.
0.1.19
Install/upgrade:
npm install --save @eastsideco/salvo-ts@0.1.19 @eastsideco/salvo-ts-build@0.1.19
npm install --save @eastsideco/salvo-ts@0.1.19 @eastsideco/salvo-ts-build@0.1.19
- Resolved
booleanProp values always resolving totrue
0.1.18
Install/upgrade:
npm install --save @eastsideco/salvo-ts@0.1.18 @eastsideco/salvo-ts-build@0.1.18
npm install --save @eastsideco/salvo-ts@0.1.18 @eastsideco/salvo-ts-build@0.1.18
- variables.scss will now be included in all Component SCSS files automatically by the compiler (it will update your source files to include it if missing.) (This can be configured in
salvo.config.js) [#7]
- Add the following section to your
salvo.config.js(inside themodule.exports = {...}):
jscomponents: {sass: {// These imports will be added to every Component SCSS filedefaultImports: ['./assets/styles/variables.scss',],},},
jscomponents: {sass: {// These imports will be added to every Component SCSS filedefaultImports: ['./assets/styles/variables.scss',],},},
- Add a
assets/styles/variables.scssfile to your project.
0.1.17
Install/upgrade:
npm install --save @eastsideco/salvo-ts@0.1.17 @eastsideco/salvo-ts-build@0.1.17
npm install --save @eastsideco/salvo-ts@0.1.17 @eastsideco/salvo-ts-build@0.1.17
- Multiple Component SCSS files in the same directory will no longer cause a compile error. [#13])
0.1.16
Install/upgrade:
npm install --save @eastsideco/salvo-ts@0.1.16 @eastsideco/salvo-ts-build@0.1.16
npm install --save @eastsideco/salvo-ts@0.1.16 @eastsideco/salvo-ts-build@0.1.16
requiredis no longer allowed in@Prop({})options. Usedefaultinstead. Any prop with adefaultspecified is non-required.defaultmay be any value of the appropriate type, exceptundefined(usedefault: nullfor a 'value not set' default instead.) [#2]- Incorrect validation messages will no longer be shown in these situations:
booleanprops; props with multiple words in name; falsey prop values other thanundefined. [#1]