Skip to content

Commit 26f5251

Browse files
committed
Use CacheFirst strategy for docs sw.
1 parent d25f1ff commit 26f5251

File tree

4 files changed

+35
-3
lines changed

4 files changed

+35
-3
lines changed

.circleci/config.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ jobs:
5252
- run:
5353
name: Predeploy demo
5454
command: |
55-
yarn --cwd packages/react-renderer-demo/ create-deploy-files
55+
yarn --cwd packages/react-renderer-demo/ build
5656
- persist_to_workspace:
5757
root: ~/react-forms
5858
paths:

packages/pf3-component-mapper/src/tests/__snapshots__/form-fields.test.js.snap

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -502,6 +502,7 @@ exports[`FormFields <Slider /> should render correctly 1`] = `
502502
onBlur={[Function]}
503503
onChange={[Function]}
504504
onFocus={[Function]}
505+
onFormatChange={[Function]}
505506
onSlide={[Function]}
506507
orientation="horizontal"
507508
sliderClass={null}
@@ -527,6 +528,7 @@ exports[`FormFields <Slider /> should render correctly 1`] = `
527528
onBlur={[Function]}
528529
onChange={[Function]}
529530
onFocus={[Function]}
531+
onFormatChange={[Function]}
530532
onSlide={[Function]}
531533
orientation="horizontal"
532534
reversed={false}
@@ -547,6 +549,7 @@ exports[`FormFields <Slider /> should render correctly 1`] = `
547549
onBlur={[Function]}
548550
onChange={[Function]}
549551
onFocus={[Function]}
552+
onFormatChange={[Function]}
550553
onSlide={[Function]}
551554
orientation="horizontal"
552555
sliderClass={null}
@@ -579,6 +582,7 @@ exports[`FormFields <Slider /> should render correctly 1`] = `
579582
onBlur={[Function]}
580583
onChange={[Function]}
581584
onFocus={[Function]}
585+
onFormatChange={[Function]}
582586
onSlide={[Function]}
583587
orientation="horizontal"
584588
sliderClass={null}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"projects": {
3-
"default": "debug-functions"
3+
"default": "data-driven-forms"
44
}
55
}

packages/react-renderer-demo/src/next.config.js

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,35 @@ module.exports = withBundleAnalyzer(
1313
withOffline(
1414
withMDX({
1515
workboxOpts: {
16-
swDest: '../public/service-worker.js'
16+
swDest: '../public/service-worker.js',
17+
runtimeCaching: [
18+
{
19+
urlPattern: /^https?.*/,
20+
handler: 'CacheFirst',
21+
options: {
22+
cacheName: 'offlineCache',
23+
expiration: {
24+
maxEntries: 200
25+
}
26+
}
27+
},
28+
{
29+
urlPattern: /.png$/,
30+
handler: 'CacheFirst'
31+
},
32+
{
33+
urlPattern: /data-driven-forms.firebaseio.com/,
34+
handler: 'NetworkFirst',
35+
options: {
36+
cacheableResponse: {
37+
statuses: [0, 200],
38+
headers: {
39+
'x-test': 'true'
40+
}
41+
}
42+
}
43+
}
44+
]
1745
},
1846
crossOrigin: 'anonymous',
1947
pageExtensions: ['js', 'jsx', 'md', 'mdx'],

0 commit comments

Comments
 (0)