@jsenv/core 24.3.2 → 24.4.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser_runtime/asset-manifest.json +3 -0
- package/dist/browser_runtime/{browser_runtime-fbd309a1.js → browser_runtime-015d0fc5.js} +94 -1
- package/dist/browser_runtime/{browser_runtime-fbd309a1.js.map → browser_runtime-015d0fc5.js.map} +11 -3
- package/dist/build_manifest.js +5 -5
- package/dist/compile_proxy/asset-manifest.json +4 -0
- package/dist/compile_proxy/assets/{s.js-749702e8.map → s.js-55849eca.map} +14 -4
- package/dist/compile_proxy/{compile_proxy-405777e6.html → compile_proxy-2eabd1f7.html} +99 -4
- package/dist/compile_proxy/{compile_proxy.html__inline__20-39c0801c.js.map → compile_proxy.html__inline__20-672ba17c.js.map} +0 -0
- package/dist/event_source_client/asset-manifest.json +3 -0
- package/dist/redirector/asset-manifest.json +4 -0
- package/dist/{toolbar/assets/s.js-749702e8.map → redirector/assets/s.js-55849eca.map} +14 -4
- package/dist/redirector/{redirector-237cd168.html → redirector-3029c4d3.html} +99 -4
- package/dist/redirector/{redirector.html__inline__15-33acb0b9.js.map → redirector.html__inline__15-4d453af0.js.map} +0 -0
- package/dist/toolbar/asset-manifest.json +13 -0
- package/dist/{redirector/assets/s.js-749702e8.map → toolbar/assets/s.js-55849eca.map} +14 -4
- package/dist/toolbar/{toolbar-d3d98c2e.html → toolbar-40bcd3a0.html} +104 -10
- package/dist/toolbar/{toolbar.main-cab36c15.js.map → toolbar.main-53e1ab2b.js.map} +2 -2
- package/dist/toolbar_injector/asset-manifest.json +4 -0
- package/dist/toolbar_injector/{toolbar_injector-01f71ce3.js → toolbar_injector-0a9d5d4c.js} +5 -3
- package/dist/toolbar_injector/{toolbar_injector-01f71ce3.js.map → toolbar_injector-0a9d5d4c.js.map} +3 -3
- package/package.json +10 -18
- package/src/executeTestPlan.js +7 -1
- package/src/internal/browser_launcher/from_playwright.js +314 -0
- package/src/internal/building/buildUsingRollup.js +2 -2
- package/src/internal/building/createJsenvRollupPlugin.js +67 -41
- package/src/internal/building/css/parseCssRessource.js +4 -1
- package/src/internal/building/html/parseHtmlRessource.js +16 -3
- package/src/internal/building/js/parseJsRessource.js +2 -0
- package/src/internal/building/ressource_builder.js +27 -37
- package/src/internal/building/ressource_builder_util.js +10 -137
- package/src/internal/building/svg/parseSvgRessource.js +2 -0
- package/src/internal/building/url_loader.js +3 -1
- package/src/internal/building/webmanifest/parseWebmanifestRessource.js +2 -1
- package/src/internal/dev_server/toolbar/toolbar.injector.js +3 -1
- package/src/internal/dev_server/toolbar/toolbar.main.js +7 -6
- package/src/internal/executing/executeConcurrently.js +15 -9
- package/src/internal/executing/executePlan.js +2 -0
- package/src/internal/runtime/s.js +83 -1
- package/src/launchBrowser.js +33 -501
- package/dist/browser_system/browser_system-29eda202.js +0 -5160
- package/dist/browser_system/browser_system-29eda202.js.map +0 -1065
- package/src/internal/browser_launcher/createSharing.js +0 -70
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
export const createSharing = ({ argsToId = argsToIdFallback } = {}) => {
|
|
2
|
-
const tokenMap = {}
|
|
3
|
-
|
|
4
|
-
const getSharingToken = (...args) => {
|
|
5
|
-
const id = argsToId(args)
|
|
6
|
-
|
|
7
|
-
if (id in tokenMap) {
|
|
8
|
-
return tokenMap[id]
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
const sharingToken = createSharingToken({
|
|
12
|
-
unusedCallback: () => {
|
|
13
|
-
delete tokenMap[id]
|
|
14
|
-
},
|
|
15
|
-
})
|
|
16
|
-
tokenMap[id] = sharingToken
|
|
17
|
-
return sharingToken
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
const getUniqueSharingToken = () => {
|
|
21
|
-
return createSharingToken()
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
return { getSharingToken, getUniqueSharingToken }
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
const createSharingToken = ({ unusedCallback = () => {} } = {}) => {
|
|
28
|
-
let useCount = 0
|
|
29
|
-
let sharedValue
|
|
30
|
-
let cleanup
|
|
31
|
-
const sharingToken = {
|
|
32
|
-
isUsed: () => useCount > 0,
|
|
33
|
-
|
|
34
|
-
setSharedValue: (value, cleanupFunction = () => {}) => {
|
|
35
|
-
sharedValue = value
|
|
36
|
-
cleanup = cleanupFunction
|
|
37
|
-
},
|
|
38
|
-
|
|
39
|
-
useSharedValue: () => {
|
|
40
|
-
useCount++
|
|
41
|
-
|
|
42
|
-
let stopped = false
|
|
43
|
-
let stopUsingReturnValue
|
|
44
|
-
const stopUsing = () => {
|
|
45
|
-
// ensure if stopUsing is called many times
|
|
46
|
-
// it returns the same value and does not decrement useCount more than once
|
|
47
|
-
if (stopped) {
|
|
48
|
-
return stopUsingReturnValue
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
stopped = true
|
|
52
|
-
useCount--
|
|
53
|
-
if (useCount === 0) {
|
|
54
|
-
unusedCallback()
|
|
55
|
-
sharedValue = undefined
|
|
56
|
-
stopUsingReturnValue = cleanup()
|
|
57
|
-
} else {
|
|
58
|
-
stopUsingReturnValue = undefined
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
return stopUsingReturnValue
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
return [sharedValue, stopUsing]
|
|
65
|
-
},
|
|
66
|
-
}
|
|
67
|
-
return sharingToken
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
const argsToIdFallback = (args) => JSON.stringify(args)
|