Skip to content

Commit 82fbfeb

Browse files
committed
refactor(bcd): split forceKeepAlive
1 parent 05cbd93 commit 82fbfeb

2 files changed

Lines changed: 172 additions & 172 deletions

File tree

src/build/bcd.ts

Lines changed: 1 addition & 172 deletions
Original file line numberDiff line numberDiff line change
@@ -8,178 +8,7 @@ import {
88
import { camelToHyphenCase } from "./utils/css.js";
99
import { filterMapRecord, isEmptyRecord } from "./utils/record.js";
1010
import { mapDefined } from "./helpers.js";
11-
12-
const forceKeepAlive: Record<string, string[]> = {
13-
// Things that are incorrectly reported as unsupported.
14-
// These should be filed to https://github.com/mdn/browser-compat-data/issues
15-
BeforeUnloadEvent: ["returnValue"],
16-
console: [
17-
"assert",
18-
"clear",
19-
"count",
20-
"countReset",
21-
"debug",
22-
"dir",
23-
"dirxml",
24-
"error",
25-
"group",
26-
"groupCollapsed",
27-
"groupEnd",
28-
"info",
29-
"log",
30-
"profile",
31-
"profileEnd",
32-
"table",
33-
"time",
34-
"timeEnd",
35-
"timeLog",
36-
"timeStamp",
37-
"trace",
38-
"warn",
39-
],
40-
CSSConditionRule: ["conditionText"],
41-
CSSGroupingRule: ["cssRules", "deleteRule", "insertRule"],
42-
CSSStyleDeclaration: [
43-
"alignContent",
44-
"alignItems",
45-
"alignSelf",
46-
"alignmentBaseline",
47-
"baselineShift",
48-
"breakAfter",
49-
"breakBefore",
50-
"breakInside",
51-
"clipRule",
52-
"colorInterpolation",
53-
"colorInterpolationFilters",
54-
"columnGap",
55-
"dominantBaseline",
56-
"fill",
57-
"fillOpacity",
58-
"fillRule",
59-
"floodColor",
60-
"floodOpacity",
61-
"fontSizeAdjust",
62-
"fontVariantPosition",
63-
"gap",
64-
"gridColumnGap",
65-
"gridGap",
66-
"gridRowGap",
67-
"justifyContent",
68-
"justifyItems",
69-
"justifySelf",
70-
"lightingColor",
71-
"marker",
72-
"markerEnd",
73-
"markerMid",
74-
"markerStart",
75-
"placeContent",
76-
"placeItems",
77-
"placeSelf",
78-
"rotate",
79-
"rowGap",
80-
"scale",
81-
"shapeRendering",
82-
"stopColor",
83-
"stopOpacity",
84-
"stroke",
85-
"strokeDasharray",
86-
"strokeDashoffset",
87-
"strokeLinecap",
88-
"strokeLinejoin",
89-
"strokeMiterlimit",
90-
"strokeOpacity",
91-
"strokeWidth",
92-
"textAnchor",
93-
"translate",
94-
"webkitAlignContent",
95-
"webkitAlignItems",
96-
"webkitAlignSelf",
97-
"webkitJustifyContent",
98-
"webkitMaskBoxImageOutset",
99-
"webkitMaskBoxImageRepeat",
100-
"webkitMaskBoxImageSlice",
101-
"webkitMaskBoxImageSource",
102-
"webkitMaskBoxImageWidth",
103-
"wordWrap", // TODO: Support for alternative names
104-
],
105-
CloseEvent: ["code", "reason", "wasClean"],
106-
DOMRectList: ["item", "length"],
107-
DOMMatrix: ["fromFloat32Array", "fromFloat64Array", "fromMatrix"],
108-
DOMPoint: ["fromPoint"],
109-
DOMRect: ["fromRect"],
110-
Document: ["charset", "inputEncoding"],
111-
Element: ["webkitMatchesSelector"],
112-
ExtendableMessageEvent: ["lastEventId", "origin", "ports", "source"],
113-
FileReader: ["onloadstart"],
114-
Gamepad: ["hapticActuators"],
115-
HTMLIFrameElement: ["allowPaymentRequest"],
116-
KeyframeEffect: ["iterationComposite"],
117-
LinkStyle: ["sheet"],
118-
MediaCapabilities: ["encodingInfo"],
119-
MutationEvent: [
120-
"attrChange",
121-
"attrName",
122-
"newValue",
123-
"prevValue",
124-
"relatedNode",
125-
"initMutationEvent",
126-
"ADDITION",
127-
"MODIFICATION",
128-
"REMOVAL",
129-
],
130-
OfflineAudioContext: ["resume"],
131-
PaymentRequest: ["shippingAddress"],
132-
PictureInPictureWindow: [
133-
"requestPictureInPicture",
134-
"onenterpictureinpicture",
135-
"onleavepictureinpicture",
136-
"autoPictureInPicture",
137-
"disablePictureInPicture",
138-
],
139-
Request: ["keepalive"],
140-
ResizeObserverSize: ["blockSize", "inlineSize"],
141-
RTCDtlsTransport: ["onstatechange", "state"],
142-
RTCPeerConnection: ["canTrickleIceCandidates"],
143-
ServiceWorkerGlobalScope: ["onmessageerror"],
144-
SVGAnimatedTransformList: ["animVal", "baseVal"],
145-
SVGElement: ["ownerSVGElement", "viewportElement"],
146-
SVGTransformList: [
147-
"numberOfItems",
148-
"appendItem",
149-
"clear",
150-
"consolidate",
151-
"createSVGTransformFromMatrix",
152-
"getItem",
153-
"initialize",
154-
"insertItemBefore",
155-
"removeItem",
156-
"replaceItem",
157-
],
158-
SpeechSynthesisEvent: ["charLength"],
159-
WebAssembly: [
160-
"compile",
161-
"compileStreaming",
162-
"instantiate",
163-
"instantiateStreaming",
164-
"validate",
165-
],
166-
WindowEventHandlers: ["onmessage"],
167-
WorkerGlobalScope: ["onrejectionhandled", "onunhandledrejection"],
168-
WorkletGlobalScope: [],
169-
// (WebAssembly namespace members)
170-
// TODO: Shouldn't these be inside "WebAssembly"?
171-
Instance: ["exports"],
172-
Global: ["value", "valueOf"],
173-
Memory: ["buffer", "grow"],
174-
Module: ["customSections", "exports", "imports"],
175-
Table: ["length", "get", "grow", "set"],
176-
177-
// Widely supported but without being correctly exposed to global
178-
ReadableStreamDefaultReader: ["closed", "cancel", "read", "releaseLock"],
179-
ReadableStreamDefaultController: ["desiredSize", "close", "enqueue", "error"],
180-
WebGLVertexArrayObjectOES: [],
181-
WritableStreamDefaultController: ["error"],
182-
};
11+
import { forceKeepAlive } from "./bcd/keep-alive.js";
18312

18413
function hasMultipleImplementations(support: SupportBlock, prefix?: string) {
18514
function hasStableImplementation(

src/build/bcd/keep-alive.ts

Lines changed: 171 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,171 @@
1+
export const forceKeepAlive: Record<string, string[]> = {
2+
// Things that are incorrectly reported as unsupported.
3+
// These should be filed to https://github.com/mdn/browser-compat-data/issues
4+
BeforeUnloadEvent: ["returnValue"],
5+
console: [
6+
"assert",
7+
"clear",
8+
"count",
9+
"countReset",
10+
"debug",
11+
"dir",
12+
"dirxml",
13+
"error",
14+
"group",
15+
"groupCollapsed",
16+
"groupEnd",
17+
"info",
18+
"log",
19+
"profile",
20+
"profileEnd",
21+
"table",
22+
"time",
23+
"timeEnd",
24+
"timeLog",
25+
"timeStamp",
26+
"trace",
27+
"warn",
28+
],
29+
CSSConditionRule: ["conditionText"],
30+
CSSGroupingRule: ["cssRules", "deleteRule", "insertRule"],
31+
CSSStyleDeclaration: [
32+
"alignContent",
33+
"alignItems",
34+
"alignSelf",
35+
"alignmentBaseline",
36+
"baselineShift",
37+
"breakAfter",
38+
"breakBefore",
39+
"breakInside",
40+
"clipRule",
41+
"colorInterpolation",
42+
"colorInterpolationFilters",
43+
"columnGap",
44+
"dominantBaseline",
45+
"fill",
46+
"fillOpacity",
47+
"fillRule",
48+
"floodColor",
49+
"floodOpacity",
50+
"fontSizeAdjust",
51+
"fontVariantPosition",
52+
"gap",
53+
"gridColumnGap",
54+
"gridGap",
55+
"gridRowGap",
56+
"justifyContent",
57+
"justifyItems",
58+
"justifySelf",
59+
"lightingColor",
60+
"marker",
61+
"markerEnd",
62+
"markerMid",
63+
"markerStart",
64+
"placeContent",
65+
"placeItems",
66+
"placeSelf",
67+
"rotate",
68+
"rowGap",
69+
"scale",
70+
"shapeRendering",
71+
"stopColor",
72+
"stopOpacity",
73+
"stroke",
74+
"strokeDasharray",
75+
"strokeDashoffset",
76+
"strokeLinecap",
77+
"strokeLinejoin",
78+
"strokeMiterlimit",
79+
"strokeOpacity",
80+
"strokeWidth",
81+
"textAnchor",
82+
"translate",
83+
"webkitAlignContent",
84+
"webkitAlignItems",
85+
"webkitAlignSelf",
86+
"webkitJustifyContent",
87+
"webkitMaskBoxImageOutset",
88+
"webkitMaskBoxImageRepeat",
89+
"webkitMaskBoxImageSlice",
90+
"webkitMaskBoxImageSource",
91+
"webkitMaskBoxImageWidth",
92+
"wordWrap", // TODO: Support for alternative names
93+
],
94+
CloseEvent: ["code", "reason", "wasClean"],
95+
DOMRectList: ["item", "length"],
96+
DOMMatrix: ["fromFloat32Array", "fromFloat64Array", "fromMatrix"],
97+
DOMPoint: ["fromPoint"],
98+
DOMRect: ["fromRect"],
99+
Document: ["charset", "inputEncoding"],
100+
Element: ["webkitMatchesSelector"],
101+
ExtendableMessageEvent: ["lastEventId", "origin", "ports", "source"],
102+
FileReader: ["onloadstart"],
103+
Gamepad: ["hapticActuators"],
104+
HTMLIFrameElement: ["allowPaymentRequest"],
105+
KeyframeEffect: ["iterationComposite"],
106+
LinkStyle: ["sheet"],
107+
MediaCapabilities: ["encodingInfo"],
108+
MutationEvent: [
109+
"attrChange",
110+
"attrName",
111+
"newValue",
112+
"prevValue",
113+
"relatedNode",
114+
"initMutationEvent",
115+
"ADDITION",
116+
"MODIFICATION",
117+
"REMOVAL",
118+
],
119+
OfflineAudioContext: ["resume"],
120+
PaymentRequest: ["shippingAddress"],
121+
PictureInPictureWindow: [
122+
"requestPictureInPicture",
123+
"onenterpictureinpicture",
124+
"onleavepictureinpicture",
125+
"autoPictureInPicture",
126+
"disablePictureInPicture",
127+
],
128+
Request: ["keepalive"],
129+
ResizeObserverSize: ["blockSize", "inlineSize"],
130+
RTCDtlsTransport: ["onstatechange", "state"],
131+
RTCPeerConnection: ["canTrickleIceCandidates"],
132+
ServiceWorkerGlobalScope: ["onmessageerror"],
133+
SVGAnimatedTransformList: ["animVal", "baseVal"],
134+
SVGElement: ["ownerSVGElement", "viewportElement"],
135+
SVGTransformList: [
136+
"numberOfItems",
137+
"appendItem",
138+
"clear",
139+
"consolidate",
140+
"createSVGTransformFromMatrix",
141+
"getItem",
142+
"initialize",
143+
"insertItemBefore",
144+
"removeItem",
145+
"replaceItem",
146+
],
147+
SpeechSynthesisEvent: ["charLength"],
148+
WebAssembly: [
149+
"compile",
150+
"compileStreaming",
151+
"instantiate",
152+
"instantiateStreaming",
153+
"validate",
154+
],
155+
WindowEventHandlers: ["onmessage"],
156+
WorkerGlobalScope: ["onrejectionhandled", "onunhandledrejection"],
157+
WorkletGlobalScope: [],
158+
// (WebAssembly namespace members)
159+
// TODO: Shouldn't these be inside "WebAssembly"?
160+
Instance: ["exports"],
161+
Global: ["value", "valueOf"],
162+
Memory: ["buffer", "grow"],
163+
Module: ["customSections", "exports", "imports"],
164+
Table: ["length", "get", "grow", "set"],
165+
166+
// Widely supported but without being correctly exposed to global
167+
ReadableStreamDefaultReader: ["closed", "cancel", "read", "releaseLock"],
168+
ReadableStreamDefaultController: ["desiredSize", "close", "enqueue", "error"],
169+
WebGLVertexArrayObjectOES: [],
170+
WritableStreamDefaultController: ["error"],
171+
};

0 commit comments

Comments
 (0)