-
Notifications
You must be signed in to change notification settings - Fork 27k
Closed
Labels
area: service-workerIssues related to the @angular/service-worker packageIssues related to the @angular/service-worker packagefeatureIssue that requests a new featureIssue that requests a new featurehelp wantedAn issue that is suitable for a community contributor (based on its complexity/scope).An issue that is suitable for a community contributor (based on its complexity/scope).
Milestone
Description
Which @angular/* package(s) are relevant/related to the feature request?
service-worker
Description
The option refreshAheadMs is not copied to the the ngsw.json in this code:
angular/packages/service-worker/config/src/generator.ts
Lines 89 to 103 in 3a60063
| private processDataGroups(config: Config): Object[] { | |
| return (config.dataGroups || []).map(group => { | |
| return { | |
| name: group.name, | |
| patterns: group.urls.map(url => urlToRegex(url, this.baseHref, true)), | |
| strategy: group.cacheConfig.strategy || 'performance', | |
| maxSize: group.cacheConfig.maxSize, | |
| maxAge: parseDurationToMs(group.cacheConfig.maxAge), | |
| timeoutMs: group.cacheConfig.timeout && parseDurationToMs(group.cacheConfig.timeout), | |
| cacheOpaqueResponses: group.cacheConfig.cacheOpaqueResponses, | |
| cacheQueryOptions: buildCacheQueryOptions(group.cacheQueryOptions), | |
| version: group.version !== undefined ? group.version : 1, | |
| }; | |
| }); | |
| } |
Proposed solution
Add it there and the schema https://github.com/angular/angular/blob/253ac15ae89755f6830f3cf567c80de20d013663/packages/service-worker/config/schema.json
Alternatives considered
Have a block that is copied as is or have fields modified without recreating the config to avoid issues when new features are added to the service worker config. ie: clone the object before modifying it (calling parseDurationToMs...) to avoid loosing options... and have a looser schema
samuelfernandez
Metadata
Metadata
Assignees
Labels
area: service-workerIssues related to the @angular/service-worker packageIssues related to the @angular/service-worker packagefeatureIssue that requests a new featureIssue that requests a new featurehelp wantedAn issue that is suitable for a community contributor (based on its complexity/scope).An issue that is suitable for a community contributor (based on its complexity/scope).