Change8

@qwik.dev/core@2.0.0-beta.38

Breaking Changes
📦 qwikView on GitHub →
1 breaking4 features🐛 25 fixes1 deprecations🔧 45 symbols

Summary

This release introduces a new `useComputed$` hook that supports async functions and improves client resume responsiveness by splitting processing tasks. It also includes numerous bug fixes related to SSR, client-side rendering, and state management.

⚠️ Breaking Changes

  • The `build.assetsDir` handling has been removed. Built assets are now relocated using `output.assetFileNames`. If you were relying on `build.assetsDir`, you will need to update your build configuration to use `output.assetFileNames` instead.

Migration Steps

  1. Update build configurations to use `output.assetFileNames` instead of `build.assetsDir`.
  2. Replace usages of `useAsync$`, `createAsync$`, and `AsyncSignal` with the new `useComputed$` that accepts async functions and `track()`.

✨ New Features

  • Introduced `useComputed$` which now accepts async functions and provides a compute context with `track()`.
  • Improved client resume responsiveness by splitting startup DOM processing into smaller tasks.
  • Improved client resume responsiveness by splitting state processing into smaller tasks.
  • Added experimental `Show` control-flow component with `when$`, `then$`, and optional `else$` branches.

🐛 Bug Fixes

  • Computed$ errors are now synced to `.error` and rethrown on `.value` read.
  • Deferred attribute values are now preserved during server rendering.
  • Camelcase HTML attributes are now preserved after client resume.
  • Element names are now validated during server rendering.
  • Element keys are now preserved during server rendering.
  • ClientOnly async signals now resume on pages without other serialized state.
  • ClientOnly option on useComputed$ now skips SSR computation.
  • Deduplicated the ssr already-streamed-chore dev warning to once per host.
  • The built-in dev-time eslint linter now targets es2022.
  • Dev-mode QRL segments now resolve even when their parent module was never loaded in the requesting Vite server.
  • Fixed SSR in-order streaming not flushing before awaiting a component-body promise.
  • Pending store state is now released after failed deserialization.
  • Duplicate projected element children when a component throws a promise on first render have been fixed.
  • Multiple SSR containers on the same page can now be resumed.
  • Serialized object data is now validated before restoration.
  • Malformed byte arrays are now rejected before allocating deserialized data.
  • Callable properties are now filtered while restoring errors.
  • Slot names are now preserved during server rendering.
  • Component props are now resumed when the statePrewarm option is enabled.
  • SSG build no longer overwrites the deployed server entry with a broken re-export.
  • Invalid serialized Promise dependencies are now rejected.
  • Component rerenders are reduced when props are the same.
  • Failed container resume is now surfaced, reporting the error and unblocking `whenContainerDataReady` waiters, instead of swallowing the error into a silent hang.
  • Failed vnode-data resume is now surfaced, reporting the error and unblocking `whenVNodeDataReady` waiters, instead of swallowing the error into a silent hang.
  • Large updates spanning multiple frames will no longer restart incorrectly and miss pending UI changes.

Affected Symbols

⚡ Deprecations

  • `useAsync$`, `createAsync$`, and `AsyncSignal` are deprecated and should be replaced with the new `useComputed$` which now accepts async functions and provides a compute context with `track()`.