Skip to content

Commit

Permalink
docs: simplify menu (#4593)
Browse files Browse the repository at this point in the history
  • Loading branch information
manucorporat committed Jun 25, 2023
1 parent be5f66c commit ff4a154
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 23 deletions.
20 changes: 17 additions & 3 deletions packages/docs/src/routes/docs/(qwik)/deprecated-features/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,16 @@ contributors:
- nsdonato
---

# Deprecated Features for Qwik
# Deprecated features

These features were deprecated in the preparation of Qwik for its stable release.

If you happened to come across one of them and don't know what its replacement is, we quickly mention them in this table with the link to their new documentation ✨.

#### Deprecated functions and their replacements
## Qwik

### Deprecated functions and their replacements

----

| Deprecated | Replacements |
Expand All @@ -23,4 +26,15 @@ If you happened to come across one of them and don't know what its replacement i
| `useBrowserVisibleTask` - `useBrowserVisibleTaskQrl` | [useVisibleTask$](https://qwik.builder.io/docs/route-loader/#routeloader) |
| `useEnvData` | [useServerData](https://qwik.builder.io/api/qwik/#useserverdata) |
| `useRef` | [useSignal](https://qwik.builder.io/docs/components/state/#usesignal) |
| `createContext` | [createContextId](https://qwik.builder.io/docs/components/context/#createcontextid) |
| `createContext` | [createContextId](https://qwik.builder.io/docs/components/context/#createcontextid) |

## Qwik City

### Deprecated functions and their replacements
----

| Deprecated | Replacements
| :-------- | :-------
| `useEndpoint ` | [routeLoader$](https://qwik.builder.io/docs/route-loader/#routeloader)
| `loader$` - `loaderQrl` | [routeLoader$](https://qwik.builder.io/docs/route-loader/#routeloader)
| `action$` - `actionQrl` | [routeLoader$](https://qwik.builder.io/docs/route-loader/#routeloader)
21 changes: 10 additions & 11 deletions packages/docs/src/routes/docs/menu.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
- [Slots](/docs/(qwik)/components/slots/index.mdx)
- [Rendering](/docs/(qwik)/components/rendering/index.mdx)
- [Styling](/docs/(qwik)/components/styles/index.mdx)
- [Deprecated Features](/docs/(qwik)/deprecated-features/index.mdx)

## Qwik City

Expand All @@ -33,13 +32,6 @@
- [Caching](/docs/(qwikcity)/caching/index.mdx)
- [Env variables](/docs/(qwikcity)/env-variables/index.mdx)
- [API reference](/docs/(qwikcity)/api/index.mdx)
- [Deprecated Features](/docs/(qwikcity)/qwikcity-deprecated-features/index.mdx)

## Qwik Labs 🧪

- [Overview](/docs/labs/index.mdx)
- [Insights](/docs/labs/insights/index.mdx)
- [Typed Routes](/docs/labs/typed-routes/index.mdx)

## Integrations

Expand All @@ -49,7 +41,7 @@
- [Cypress](integrations/cypress/index.mdx)
- [Icons](integrations/icons/index.mdx)
- [Image Optimization](integrations/image-optimization/index.mdx)
- [Internationalization](integrations/i18n/index.mdx)
- [i18n](integrations/i18n/index.mdx)
- [Modular Forms](integrations/modular-forms/index.mdx)
- [Nx Monorepos](integrations/nx/index.mdx)
- [Panda CSS](integrations/panda-css/index.mdx)
Expand Down Expand Up @@ -98,11 +90,11 @@
- [The $ dollar sign](/docs/(qwik)/advanced/dollar/index.mdx)
- [Containers](/docs/(qwik)/advanced/containers/index.mdx)
- [QRL](/docs/(qwik)/advanced/qrl/index.mdx)
- [Library](/docs/(qwik)/advanced/library/index.mdx)
- [Library mode](/docs/(qwik)/advanced/library/index.mdx)
- [Qwikloader](/docs/(qwik)/advanced/qwikloader/index.mdx)
- [Optimizer](/docs/(qwik)/advanced/optimizer/index.mdx)
- [Prefetching](/docs/(qwik)/advanced/prefetching/index.mdx)
- [Custom Build Directory](/docs/(qwik)/advanced/custom-build-dir/index.mdx)
- [Build Directory](/docs/(qwik)/advanced/custom-build-dir/index.mdx)
- [Vite](/docs/(qwik)/advanced/vite/index.mdx)
- [Advanced Routing](/docs/(qwikcity)/advanced/routing/index.mdx)
- [Speculative Module Fetching](/docs/(qwikcity)/advanced/speculative-module-fetching/index.mdx)
Expand All @@ -115,6 +107,13 @@
## Reference

- [API Reference](/api/)
- [Deprecated Features](/docs/(qwik)/deprecated-features/index.mdx)

## Qwik Labs 🧪

- [Overview](/docs/labs/index.mdx)
- [Insights](/docs/labs/insights/index.mdx)
- [Typed Routes](/docs/labs/typed-routes/index.mdx)

## Community

Expand Down
6 changes: 2 additions & 4 deletions packages/qwik-city/runtime/src/service-worker/cached-fetch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ export const cachedFetch = (
cache: Cache,
fetch: Fetch,
awaitingRequests: AwaitingRequests,
request: Request,
preloadResponse?: Promise<Response> | undefined
request: Request
) =>
new Promise<Response>((promiseResolve, promiseReject) => {
const url = request.url;
Expand Down Expand Up @@ -60,8 +59,7 @@ export const cachedFetch = (
} else {
// no cached response found or user didn't want to use the cache
// do a full network request
const responsePromise = preloadResponse ? preloadResponse : fetch(request);
return responsePromise.then(async (networkResponse) => {
return fetch(request).then(async (networkResponse) => {
if (networkResponse.ok) {
// network response was good, let's cache it
await cache.put(url, networkResponse.clone());
Expand Down
7 changes: 2 additions & 5 deletions packages/qwik-city/runtime/src/service-worker/setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export const setupServiceWorkerScope = (
ev.respondWith(
swScope.caches.open(qBuildCacheName).then((qBuildCache) => {
prefetchWaterfall(appBundles, qBuildCache, swFetch, url);
return cachedFetch(qBuildCache, swFetch, awaitingRequests, request, ev.preloadResponse);
return cachedFetch(qBuildCache, swFetch, awaitingRequests, request);
})
);
}
Expand Down Expand Up @@ -63,10 +63,7 @@ export const setupServiceWorkerScope = (
}
});

swScope.addEventListener('activate', (event) => {
// if (self.registration.navigationPreload) {
// event.waitUntil(self.registration.navigationPreload.enable());
// }
swScope.addEventListener('activate', () => {
(async () => {
try {
const qBuildCache = await swScope.caches.open(qBuildCacheName);
Expand Down

0 comments on commit ff4a154

Please sign in to comment.