Skip to content

Commit

Permalink
Merge pull request #233 from remix-pwa/dev
Browse files Browse the repository at this point in the history
Pushing patches upstream
  • Loading branch information
ShafSpecs committed May 20, 2024
2 parents a7e3188 + 955e0b2 commit 48c22f6
Show file tree
Hide file tree
Showing 11 changed files with 107 additions and 479 deletions.
3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
<h1 align='center'>Remix PWA</h1>

> 💻 Huge thanks to [Jacob Ebey](https://github.com/jacob-ebey) for the idea and
> [original implementation](https://github.com/jacob-ebey/remix-pwa) of PWA in Remix.
Remix PWA is a collection of JavaScript libraries and utilities that make it easy to build [Progressive Web Apps (PWAs)](https://developer.mozilla.org/en-US/docs/Web/Progressive_web_apps) with Remix.

*💻 Huge thanks to [Jacob Ebey](https://github.com/jacob-ebey) for the idea and [original implementation](https://github.com/jacob-ebey/remix-pwa) of PWA in Remix.*
Expand Down
536 changes: 79 additions & 457 deletions package-lock.json

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions packages/sw/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
## @remix-pwa/sw 3.0.7-dev.1 (2024-05-20)


### Bug Fixes

* **sw:** re-fixing opaque response patch f0530fc

## @remix-pwa/sw 3.0.6 (2024-05-20)


Expand Down
2 changes: 1 addition & 1 deletion packages/sw/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@remix-pwa/sw",
"version": "3.0.6",
"version": "3.0.7-dev.1",
"description": "Service Worker APIs and utilities for Remix PWA",
"repository": {
"type": "git",
Expand Down
8 changes: 2 additions & 6 deletions packages/sw/src/cache/CacheFirst.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,9 @@ export class CacheFirst extends BaseStrategy {
}

private async validateResponse(response: Response): Promise<boolean> {
if (!this.cacheableResponse) {
return true;
}
if (this.isOpaqueResponse(response)) return false;

if (this.isOpaqueResponse(response)) {
return false;
}
if (!this.cacheableResponse) return true;

const { headers = {}, statuses = [] } = this.cacheableResponse;

Expand Down
2 changes: 1 addition & 1 deletion packages/sw/src/cache/CacheOnly.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { isHttpRequest } from '../utils/utils.js';
import { BaseStrategy, CACHE_TIMESTAMP_HEADER } from './BaseStrategy.js';
import { BaseStrategy } from './BaseStrategy.js';
import type { CacheFriendlyOptions, CacheOptions } from './types.js';
import { mergeHeaders } from './utils.js';

Expand Down
8 changes: 2 additions & 6 deletions packages/sw/src/cache/NetworkFirst.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,9 @@ export class NetworkFirst extends BaseStrategy {
}

private async validateResponse(response: Response): Promise<boolean> {
if (!this.cacheableResponse) {
return true;
}
if (this.isOpaqueResponse(response)) return false;

if (this.isOpaqueResponse(response)) {
return false;
}
if (!this.cacheableResponse) return true;

const { headers = {}, statuses = [] } = this.cacheableResponse;

Expand Down
2 changes: 1 addition & 1 deletion packages/sw/src/cache/StaleWhileRevalidate.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { isHttpRequest } from '../utils/utils.js';
import { BaseStrategy, CACHE_TIMESTAMP_HEADER } from './BaseStrategy.js';
import { BaseStrategy } from './BaseStrategy.js';
import type { CacheOptions, SWROptions } from './types.js';
import { mergeHeaders } from './utils.js';

Expand Down
10 changes: 10 additions & 0 deletions packages/sync/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
## @remix-pwa/sync 3.0.2-dev.1 (2024-05-20)





### Dependencies

* **@remix-pwa/sw:** upgraded to 3.0.7-dev.1

## @remix-pwa/sync 3.0.1 (2024-05-20)


Expand Down
4 changes: 2 additions & 2 deletions packages/sync/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@remix-pwa/sync",
"version": "3.0.1",
"version": "3.0.2-dev.1",
"description": "A Background Sync addon for Remix PWA",
"repository": {
"type": "git",
Expand Down Expand Up @@ -34,7 +34,7 @@
"rimraf": "^5.0.5"
},
"dependencies": {
"@remix-pwa/sw": "^3.0.6",
"@remix-pwa/sw": "^3.0.7-dev.1",
"idb": "^8.0.0"
}
}
4 changes: 2 additions & 2 deletions playground/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
"dependencies": {
"@remix-pwa/client": "3.0.4",
"@remix-pwa/push": "2.10.1",
"@remix-pwa/sw": "3.0.5",
"@remix-pwa/sync": "3.0.0",
"@remix-pwa/sw": "3.0.6",
"@remix-pwa/sync": "3.0.1",
"@remix-pwa/worker-runtime": "2.1.2",
"@remix-run/node": "^2.8.1",
"@remix-run/react": "^2.8.1",
Expand Down

0 comments on commit 48c22f6

Please sign in to comment.