quasarframework / quasar

Quasar Framework - Build high-performance VueJS user interfaces in record time
https://quasar.dev
MIT License
25.97k stars 3.52k forks source link

Upgrade to newer esbuild #17220

Closed smoores-dev closed 4 months ago

smoores-dev commented 5 months ago

What happened?

When attempting to use the satisfies operator from Typescript 4.9, @quasar/app-vite failed with a Transform failed ... Expected ";" but found "satisfies" error.

What did you expect to happen?

Quasar/esbuild should successfully handle modern Typescript syntax

Reproduction URL

https://stackblitz.com/edit/quasarframework-b9u6h7?file=src%2Fcomponents%2FEssentialLink.vue

How to reproduce?

Run the StackBlitz in the reproduction link. It will immediately fail.

Flavour

Quasar CLI with Vite (@quasar/cli | @quasar/app-vite)

Areas

Quasar CLI Commands/Configuration (@quasar/cli | @quasar/app-webpack | @quasar/app-vite)

Platforms/Browsers

Firefox, Chrome, Safari, Microsoft Edge, iOS, Android, Electron

Quasar info output

Operating System - Linux(6.8.9-300.fc40.x86_64) - linux/x64
NodeJs - 20.12.2

Global packages
  NPM - 10.5.0
  yarn - 4.2.1
  @quasar/cli - undefined
  @quasar/icongenie - Not installed
  cordova - Not installed

Important local packages
  quasar - 2.16.0 -- Build high-performance VueJS user interfaces (SPA, PWA, SSR, Mobile and Desktop) in record time
  @quasar/app-vite - 1.9.1 -- Quasar Framework App CLI with Vite
  @quasar/extras - 1.16.11 -- Quasar Framework fonts, icons and animations
  eslint-plugin-quasar - Not installed
  vue - 3.4.26 -- The progressive JavaScript framework for building modern web UI.
  vue-router - 4.3.2
  pinia - 2.1.7 -- Intuitive, type safe and flexible Store for Vue
  vuex - Not installed
  vite - 5.2.11 -- Native-ESM powered web dev build tool
  eslint - 8.57.0 -- An AST-based pattern checker for JavaScript.
  electron - Not installed
  electron-packager - Not installed
  @electron/packager - Not installed
  electron-builder - Not installed
  register-service-worker - 1.7.2 -- Script for registering service worker, with hooks
  @capacitor/core - Not installed
  @capacitor/cli - Not installed
  @capacitor/android - Not installed
  @capacitor/ios - Not installed

Quasar App Extensions
  *None installed*

Networking
  Host - smooreswork
  wlp166s0 - 10.98.57.57
  docker0 - 172.17.0.1

Relevant log output

[plugin:vite:vue] Transform failed with 1 error:
/home/projects/quasarframework-b9u6h7/src/components/EssentialLink.vue:4:17: ERROR: Expected ";" but found "satisfies"

/home/projects/quasarframework-b9u6h7/src/components/EssentialLink.vue:4:17

Expected ";" but found "satisfies"
2  |  import { defineComponent } from 'vue';
3  |  
4  |  const test = 'a' satisfies string;
   |                   ^
5  |  
6  |  const _sfc_main = defineComponent({

Additional context

This is due to @quasar/app-vite depending on a pinned, old version of esbuild that doesn't yet have support for the satisfies operator. Support was added in v0.15.13.

smoores-dev commented 5 months ago

I'm just seeing that it looks like this may have been resolved in @quasar/app-vite@2.0.0-beta; is it possible to backport this upgrade to the stable v1.9.x releases, or was there a breaking change that makes that infeasible? Sorry for the noise if this has already been discussed and addressed!

rstoenescu commented 5 months ago

It's best if you use the new q/app betas instead. Will try to figure out if we can upgrade esbuild in the old q/app too, but without breaking changes.

rstoenescu commented 4 months ago

Upgraded esbuild will be available only for the q/app betas.