@warp-drive/core 5.9.0-beta.1 → 5.9.0-beta.2
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/{unpkg/dev-deprecated/-private-DL4tfrv9.js → -private-BYn1Vh-L.js} +2 -2
- package/dist/{-private-b1g4dhl0.js.map → -private-BYn1Vh-L.js.map} +1 -1
- package/dist/{-private-DMzvF_Q6.js → -private-CyhhcK1a.js} +2 -2
- package/dist/-private-CyhhcK1a.js.map +1 -0
- package/dist/-private-zrP4VGAf.js +3530 -0
- package/dist/-private-zrP4VGAf.js.map +1 -0
- package/{declarations/concepts-LHsLJZMl.d.ts → dist/concepts-DFldVwEM.d.ts} +2 -2
- package/{declarations/concepts-LHsLJZMl.d.ts.map → dist/concepts-DFldVwEM.d.ts.map} +1 -1
- package/dist/configure.js +1 -1
- package/dist/graph/-private.d.ts +2 -0
- package/dist/graph/-private.js +46 -33
- package/dist/graph/-private.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +1 -1
- package/{declarations/internal-Cz-893zD.d.ts → dist/internal-DtWOpxrR.d.ts} +2763 -2271
- package/dist/internal-DtWOpxrR.d.ts.map +1 -0
- package/dist/reactive/-private.d.ts +2 -0
- package/dist/reactive/-private.js +1 -1
- package/dist/reactive.d.ts +2 -0
- package/dist/reactive.js +3 -3
- package/{declarations → dist}/record-D3QQcaIR.d.ts.map +1 -1
- package/dist/{request--vRFALbQ.js → request-7BJFgSu_.js} +2 -2
- package/dist/request-7BJFgSu_.js.map +1 -0
- package/dist/request.d.ts +2 -0
- package/dist/request.js +1 -1
- package/dist/signals/-leaked.d.ts +1060 -0
- package/dist/signals/-leaked.d.ts.map +1 -0
- package/dist/signals/-leaked.js +2 -2
- package/dist/{src-Dex_phWI.js → src-BOAWJH_S.js} +192 -53
- package/dist/src-BOAWJH_S.js.map +1 -0
- package/dist/store/-private.d.ts +2 -0
- package/dist/store/-private.js +1 -1
- package/dist/store-DNF9Rgoh.js.map +1 -1
- package/dist/store.d.ts +2 -0
- package/{declarations → dist}/types/-private.d.ts +1 -1
- package/{declarations → dist}/types/-private.d.ts.map +1 -1
- package/dist/types/-private.js +1 -1
- package/dist/types/cache.d.ts +2 -0
- package/dist/types/record.js.map +1 -1
- package/dist/types/request.d.ts +2 -0
- package/dist/types/request.js +1 -1
- package/dist/types/request.js.map +1 -1
- package/dist/types/runtime.js +1 -1
- package/dist/types/schema/concepts.d.ts +2 -0
- package/dist/types/schema/fields.js.map +1 -1
- package/dist/types/schema/schema-service.d.ts +2 -0
- package/dist/types/symbols.js +1 -1
- package/dist/types/symbols.js.map +1 -1
- package/{declarations → dist}/types.d.ts +1 -1
- package/dist/unpkg/dev/-private-BoSTJwp9.js +3519 -0
- package/dist/unpkg/dev/-private-BoSTJwp9.js.map +1 -0
- package/dist/{-private-b1g4dhl0.js → unpkg/dev/-private-CUkeqUhO.js} +2 -2
- package/dist/unpkg/{dev-deprecated/-private-DL4tfrv9.js.map → dev/-private-CUkeqUhO.js.map} +1 -1
- package/dist/unpkg/{dev-deprecated/-private-2RfQ2761.js → dev/-private-D6Tw25AD.js} +2 -2
- package/dist/unpkg/dev/-private-D6Tw25AD.js.map +1 -0
- package/dist/unpkg/dev/configure.js +1 -1
- package/dist/unpkg/dev/graph/-private.js +46 -33
- package/dist/unpkg/dev/graph/-private.js.map +1 -1
- package/dist/unpkg/dev/index.js +1 -1
- package/dist/unpkg/dev/reactive/-private.js +1 -1
- package/dist/unpkg/dev/reactive.js +3 -3
- package/dist/unpkg/{dev-deprecated/request-DAuXbfYi.js → dev/request-CwjpJB3r.js} +2 -2
- package/dist/unpkg/dev/request-CwjpJB3r.js.map +1 -0
- package/dist/unpkg/dev/request.js +1 -1
- package/dist/unpkg/dev/{runtime-EoVKAhTv.js → runtime-DoDtzXJb.js} +2 -2
- package/dist/unpkg/dev/runtime-DoDtzXJb.js.map +1 -0
- package/dist/unpkg/dev/signals/-leaked.js +2 -2
- package/dist/unpkg/dev/{src-Bxlr_vue.js → src-CP6e_ozt.js} +194 -55
- package/dist/unpkg/dev/src-CP6e_ozt.js.map +1 -0
- package/dist/unpkg/dev/store/-private.js +1 -1
- package/dist/unpkg/{dev-deprecated/store-TcP2H4Af.js → dev/store-DamE3C4y.js} +2 -2
- package/dist/unpkg/dev/store-DamE3C4y.js.map +1 -0
- package/dist/unpkg/dev/store.js +1 -1
- package/dist/unpkg/dev/types/-private.js +1 -1
- package/dist/unpkg/dev/types/record.js.map +1 -1
- package/dist/unpkg/dev/types/request.js +1 -1
- package/dist/unpkg/dev/types/request.js.map +1 -1
- package/dist/unpkg/dev/types/runtime.js +1 -1
- package/dist/unpkg/dev/types/schema/fields.js.map +1 -1
- package/dist/unpkg/dev/types/symbols.js +1 -1
- package/dist/unpkg/dev/types/symbols.js.map +1 -1
- package/dist/unpkg/dev-deprecated/-private-BoSTJwp9.js +3519 -0
- package/dist/unpkg/dev-deprecated/-private-BoSTJwp9.js.map +1 -0
- package/dist/unpkg/{dev/-private-DL4tfrv9.js → dev-deprecated/-private-CUkeqUhO.js} +2 -2
- package/dist/unpkg/{prod/-private-Z9i0icpE.js.map → dev-deprecated/-private-CUkeqUhO.js.map} +1 -1
- package/dist/unpkg/{dev/-private-2RfQ2761.js → dev-deprecated/-private-D6Tw25AD.js} +2 -2
- package/dist/unpkg/dev-deprecated/-private-D6Tw25AD.js.map +1 -0
- package/dist/unpkg/dev-deprecated/configure.js +1 -1
- package/dist/unpkg/dev-deprecated/graph/-private.js +47 -34
- package/dist/unpkg/dev-deprecated/graph/-private.js.map +1 -1
- package/dist/unpkg/dev-deprecated/index.js +1 -1
- package/dist/unpkg/dev-deprecated/reactive/-private.js +1 -1
- package/dist/unpkg/dev-deprecated/reactive.js +3 -3
- package/dist/unpkg/{dev/request-DAuXbfYi.js → dev-deprecated/request-CwjpJB3r.js} +2 -2
- package/dist/unpkg/dev-deprecated/request-CwjpJB3r.js.map +1 -0
- package/dist/unpkg/dev-deprecated/request.js +1 -1
- package/dist/unpkg/dev-deprecated/{runtime-BacZMq1r.js → runtime-CPL2BGgT.js} +2 -2
- package/dist/unpkg/dev-deprecated/runtime-CPL2BGgT.js.map +1 -0
- package/dist/unpkg/dev-deprecated/signals/-leaked.js +2 -2
- package/dist/unpkg/dev-deprecated/{src-DEl2Ca3T.js → src-De8OV58h.js} +195 -56
- package/dist/unpkg/dev-deprecated/src-De8OV58h.js.map +1 -0
- package/dist/unpkg/dev-deprecated/store/-private.js +1 -1
- package/dist/unpkg/{dev/store-DmiFvT1B.js → dev-deprecated/store-Bsdz5mRe.js} +2 -2
- package/dist/unpkg/dev-deprecated/store-Bsdz5mRe.js.map +1 -0
- package/dist/unpkg/dev-deprecated/store.js +1 -1
- package/dist/unpkg/dev-deprecated/types/-private.js +1 -1
- package/dist/unpkg/dev-deprecated/types/record.js.map +1 -1
- package/dist/unpkg/dev-deprecated/types/request.js +1 -1
- package/dist/unpkg/dev-deprecated/types/request.js.map +1 -1
- package/dist/unpkg/dev-deprecated/types/runtime.js +1 -1
- package/dist/unpkg/dev-deprecated/types/schema/fields.js.map +1 -1
- package/dist/unpkg/dev-deprecated/types/symbols.js +1 -1
- package/dist/unpkg/dev-deprecated/types/symbols.js.map +1 -1
- package/dist/unpkg/prod/-private-B36B1ztP.js +22 -0
- package/dist/unpkg/{prod-deprecated/-private-Z9i0icpE.js.map → prod/-private-B36B1ztP.js.map} +1 -1
- package/dist/unpkg/prod/-private-DHco-h0q.js +3294 -0
- package/dist/unpkg/prod/-private-DHco-h0q.js.map +1 -0
- package/dist/unpkg/prod/{-private-BK71-uXR.js → -private-Dhl123OI.js} +2 -2
- package/dist/unpkg/prod/-private-Dhl123OI.js.map +1 -0
- package/dist/unpkg/prod/configure.js +1 -1
- package/dist/unpkg/prod/graph/-private.js +45 -32
- package/dist/unpkg/prod/graph/-private.js.map +1 -1
- package/dist/unpkg/prod/index.js +1 -1
- package/dist/unpkg/prod/reactive/-private.js +1 -1
- package/dist/unpkg/prod/reactive.js +3 -3
- package/dist/unpkg/prod/{request-BcJNzSgv.js → request-BBdC1Sz7.js} +2 -2
- package/dist/unpkg/prod/request-BBdC1Sz7.js.map +1 -0
- package/dist/unpkg/prod/request.js +1 -1
- package/dist/unpkg/prod/signals/-leaked.js +2 -2
- package/dist/unpkg/prod/{src-Dzz-j6pp.js → src-nFHlZgKa.js} +196 -53
- package/dist/unpkg/prod/src-nFHlZgKa.js.map +1 -0
- package/dist/unpkg/prod/store/-private.js +1 -1
- package/dist/unpkg/prod/store-BWhmb7Ob.js.map +1 -1
- package/dist/unpkg/prod/types/-private.js +1 -1
- package/dist/unpkg/prod/types/record.js.map +1 -1
- package/dist/unpkg/prod/types/request.js +1 -1
- package/dist/unpkg/prod/types/request.js.map +1 -1
- package/dist/unpkg/prod/types/runtime.js +1 -1
- package/dist/unpkg/prod/types/schema/fields.js.map +1 -1
- package/dist/unpkg/prod/types/symbols.js +1 -1
- package/dist/unpkg/prod/types/symbols.js.map +1 -1
- package/dist/unpkg/prod-deprecated/{-private-Z9i0icpE.js → -private-B36B1ztP.js} +2 -2
- package/dist/unpkg/{dev/-private-DL4tfrv9.js.map → prod-deprecated/-private-B36B1ztP.js.map} +1 -1
- package/dist/unpkg/prod-deprecated/-private-DHco-h0q.js +3294 -0
- package/dist/unpkg/prod-deprecated/-private-DHco-h0q.js.map +1 -0
- package/dist/unpkg/prod-deprecated/{-private-BK71-uXR.js → -private-Dhl123OI.js} +2 -2
- package/dist/unpkg/prod-deprecated/-private-Dhl123OI.js.map +1 -0
- package/dist/unpkg/prod-deprecated/configure.js +1 -1
- package/dist/unpkg/prod-deprecated/graph/-private.js +46 -35
- package/dist/unpkg/prod-deprecated/graph/-private.js.map +1 -1
- package/dist/unpkg/prod-deprecated/index.js +1 -1
- package/dist/unpkg/prod-deprecated/reactive/-private.js +1 -1
- package/dist/unpkg/prod-deprecated/reactive.js +3 -3
- package/dist/unpkg/prod-deprecated/{request-BcJNzSgv.js → request-BBdC1Sz7.js} +2 -2
- package/dist/unpkg/prod-deprecated/request-BBdC1Sz7.js.map +1 -0
- package/dist/unpkg/prod-deprecated/request.js +1 -1
- package/dist/unpkg/prod-deprecated/signals/-leaked.js +2 -2
- package/dist/unpkg/prod-deprecated/{src-BOifHFQ5.js → src-Cku5ymUJ.js} +197 -54
- package/dist/unpkg/prod-deprecated/src-Cku5ymUJ.js.map +1 -0
- package/dist/unpkg/prod-deprecated/store/-private.js +1 -1
- package/dist/unpkg/prod-deprecated/store-BWhmb7Ob.js.map +1 -1
- package/dist/unpkg/prod-deprecated/types/-private.js +1 -1
- package/dist/unpkg/prod-deprecated/types/record.js.map +1 -1
- package/dist/unpkg/prod-deprecated/types/request.js +1 -1
- package/dist/unpkg/prod-deprecated/types/request.js.map +1 -1
- package/dist/unpkg/prod-deprecated/types/runtime.js +1 -1
- package/dist/unpkg/prod-deprecated/types/schema/fields.js.map +1 -1
- package/dist/unpkg/prod-deprecated/types/symbols.js +1 -1
- package/dist/unpkg/prod-deprecated/types/symbols.js.map +1 -1
- package/package.json +15 -19
- package/declarations/graph/-private.d.ts +0 -2
- package/declarations/index.d.ts +0 -2
- package/declarations/internal-Cz-893zD.d.ts.map +0 -1
- package/declarations/reactive/-private.d.ts +0 -2
- package/declarations/reactive.d.ts +0 -2
- package/declarations/request.d.ts +0 -2
- package/declarations/signals/-leaked.d.ts +0 -63
- package/declarations/signals/-leaked.d.ts.map +0 -1
- package/declarations/store/-private.d.ts +0 -2
- package/declarations/store.d.ts +0 -8358
- package/declarations/store.d.ts.map +0 -1
- package/declarations/types/cache.d.ts +0 -2
- package/declarations/types/request.d.ts +0 -2
- package/declarations/types/schema/concepts.d.ts +0 -2
- package/declarations/types/schema/schema-service.d.ts +0 -2
- package/dist/-private-DMzvF_Q6.js.map +0 -1
- package/dist/-private-HjaQ1wp1.js +0 -1695
- package/dist/-private-HjaQ1wp1.js.map +0 -1
- package/dist/request--vRFALbQ.js.map +0 -1
- package/dist/src-Dex_phWI.js.map +0 -1
- package/dist/unpkg/dev/-private-2RfQ2761.js.map +0 -1
- package/dist/unpkg/dev/-private-CM1zxNws.js +0 -1684
- package/dist/unpkg/dev/-private-CM1zxNws.js.map +0 -1
- package/dist/unpkg/dev/request-DAuXbfYi.js.map +0 -1
- package/dist/unpkg/dev/runtime-EoVKAhTv.js.map +0 -1
- package/dist/unpkg/dev/src-Bxlr_vue.js.map +0 -1
- package/dist/unpkg/dev/store-DmiFvT1B.js.map +0 -1
- package/dist/unpkg/dev-deprecated/-private-2RfQ2761.js.map +0 -1
- package/dist/unpkg/dev-deprecated/-private-CM1zxNws.js +0 -1684
- package/dist/unpkg/dev-deprecated/-private-CM1zxNws.js.map +0 -1
- package/dist/unpkg/dev-deprecated/request-DAuXbfYi.js.map +0 -1
- package/dist/unpkg/dev-deprecated/runtime-BacZMq1r.js.map +0 -1
- package/dist/unpkg/dev-deprecated/src-DEl2Ca3T.js.map +0 -1
- package/dist/unpkg/dev-deprecated/store-TcP2H4Af.js.map +0 -1
- package/dist/unpkg/prod/-private-BK71-uXR.js.map +0 -1
- package/dist/unpkg/prod/-private-TNaS5Piv.js +0 -1494
- package/dist/unpkg/prod/-private-TNaS5Piv.js.map +0 -1
- package/dist/unpkg/prod/-private-Z9i0icpE.js +0 -22
- package/dist/unpkg/prod/request-BcJNzSgv.js.map +0 -1
- package/dist/unpkg/prod/src-Dzz-j6pp.js.map +0 -1
- package/dist/unpkg/prod-deprecated/-private-BK71-uXR.js.map +0 -1
- package/dist/unpkg/prod-deprecated/-private-TNaS5Piv.js +0 -1494
- package/dist/unpkg/prod-deprecated/-private-TNaS5Piv.js.map +0 -1
- package/dist/unpkg/prod-deprecated/request-BcJNzSgv.js.map +0 -1
- package/dist/unpkg/prod-deprecated/src-BOifHFQ5.js.map +0 -1
- /package/{declarations → dist}/aliases-BWYW5EhX.d.ts +0 -0
- /package/{declarations → dist}/aliases-BWYW5EhX.d.ts.map +0 -0
- /package/{declarations → dist}/build-config/babel-macros.d.ts +0 -0
- /package/{declarations → dist}/build-config/canary-features.d.ts +0 -0
- /package/{declarations → dist}/build-config/debugging.d.ts +0 -0
- /package/{declarations → dist}/build-config/deprecations.d.ts +0 -0
- /package/{declarations → dist}/build-config/env.d.ts +0 -0
- /package/{declarations → dist}/build-config/macros.d.ts +0 -0
- /package/{declarations → dist}/build-config.d.ts +0 -0
- /package/{declarations → dist}/change-C7kqv2kW.d.ts +0 -0
- /package/{declarations → dist}/change-C7kqv2kW.d.ts.map +0 -0
- /package/{declarations → dist}/configure-B_F639tN.d.ts +0 -0
- /package/{declarations → dist}/configure-B_F639tN.d.ts.map +0 -0
- /package/{declarations → dist}/configure.d.ts +0 -0
- /package/{declarations → dist}/document-BEn91SwT.d.ts +0 -0
- /package/{declarations → dist}/document-BEn91SwT.d.ts.map +0 -0
- /package/{declarations → dist}/error-50OSEhsF.d.ts +0 -0
- /package/{declarations → dist}/error-50OSEhsF.d.ts.map +0 -0
- /package/{declarations → dist}/fields-FM7peCiM.d.ts +0 -0
- /package/{declarations → dist}/fields-FM7peCiM.d.ts.map +0 -0
- /package/{declarations → dist}/graph-DLqYXP2z.d.ts +0 -0
- /package/{declarations → dist}/graph-DLqYXP2z.d.ts.map +0 -0
- /package/{declarations → dist}/identifier-DQnqOSJK.d.ts +0 -0
- /package/{declarations → dist}/identifier-DQnqOSJK.d.ts.map +0 -0
- /package/{declarations → dist}/json-api-raw-C5APJHHB.d.ts +0 -0
- /package/{declarations → dist}/json-api-raw-C5APJHHB.d.ts.map +0 -0
- /package/{declarations → dist}/mutations-CqtoGB4t.d.ts +0 -0
- /package/{declarations → dist}/mutations-CqtoGB4t.d.ts.map +0 -0
- /package/{declarations → dist}/operations-D1qA6r0_.d.ts +0 -0
- /package/{declarations → dist}/operations-D1qA6r0_.d.ts.map +0 -0
- /package/{declarations → dist}/params-DrEx3bf8.d.ts +0 -0
- /package/{declarations → dist}/params-DrEx3bf8.d.ts.map +0 -0
- /package/{declarations → dist}/raw-D5hnjiq7.d.ts +0 -0
- /package/{declarations → dist}/raw-D5hnjiq7.d.ts.map +0 -0
- /package/{declarations → dist}/record-D3QQcaIR.d.ts +0 -0
- /package/{declarations → dist}/relationship-CmHzMPKf.d.ts +0 -0
- /package/{declarations → dist}/relationship-CmHzMPKf.d.ts.map +0 -0
- /package/{declarations → dist}/symbols-DjRDCeX0.d.ts +0 -0
- /package/{declarations → dist}/symbols-DjRDCeX0.d.ts.map +0 -0
- /package/{declarations → dist}/types/cache/aliases.d.ts +0 -0
- /package/{declarations → dist}/types/cache/change.d.ts +0 -0
- /package/{declarations → dist}/types/cache/mutations.d.ts +0 -0
- /package/{declarations → dist}/types/cache/operations.d.ts +0 -0
- /package/{declarations → dist}/types/cache/relationship.d.ts +0 -0
- /package/{declarations → dist}/types/graph.d.ts +0 -0
- /package/{declarations → dist}/types/identifier.d.ts +0 -0
- /package/{declarations → dist}/types/json/raw.d.ts +0 -0
- /package/{declarations → dist}/types/params.d.ts +0 -0
- /package/{declarations → dist}/types/record.d.ts +0 -0
- /package/{declarations → dist}/types/runtime.d.ts +0 -0
- /package/{declarations → dist}/types/runtime.d.ts.map +0 -0
- /package/{declarations → dist}/types/schema/fields.d.ts +0 -0
- /package/{declarations → dist}/types/schema/fields.type-test.d.ts +0 -0
- /package/{declarations → dist}/types/spec/document.d.ts +0 -0
- /package/{declarations → dist}/types/spec/error.d.ts +0 -0
- /package/{declarations → dist}/types/spec/json-api-raw.d.ts +0 -0
- /package/{declarations → dist}/types/symbols.d.ts +0 -0
- /package/{declarations → dist}/types/utils.d.ts +0 -0
- /package/{declarations → dist}/utils/string.d.ts +0 -0
- /package/{declarations → dist}/utils/string.d.ts.map +0 -0
- /package/{declarations → dist}/utils-BtURiy8l.d.ts +0 -0
- /package/{declarations → dist}/utils-BtURiy8l.d.ts.map +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"-private-
|
|
1
|
+
{"version":3,"file":"-private-CUkeqUhO.js","names":["getOrSetGlobal","SOURCE","Symbol","Destroy","dispose","for","Checkout","Commit","Context"],"sources":["../../../src/reactive/-private/symbols.ts"],"sourcesContent":["///////////////////\n///// WARNING /////\n///////////////////\n\nimport { getOrSetGlobal } from '../../types/-private';\n\n// Great, got your attention with that warning didn't we?\n// Good. Here's the deal: typescript treats symbols as unique types.\n// If by accident a module creating a symbol is processed more than\n// once, the symbol will be different in each processing. This will\n// cause a type error.\n// It could also cause a runtime error if the symbol is used innapropriately.\n// However, this case is extremely hard to hit and would require other things\n// to go wrong first.\n//\n// So, why do the warning? And why do we lie about the types of the symbols?\n//\n// Because we intentionally create multiple copies of them within the types\n// at build time. This is because we rollup our d.ts files in order to give\n// our consumers a better experience.\n//\n// However, no tool today supports rolling up d.ts files with multiple entry\n// points correctly. The tool we use currently (vite-plugin-dts) uses @microsoft/api-extractor\n// which creates a fully unique stand-alone types file per-entry-point. Thus\n// every entry point that uses one of these symbols somewhere will have accidentally\n// created a new symbol type.\n//\n// This cast allows us to rollup these types using this tool while not encountering\n// the unique symbol type issue.\n//\n// Note that none of these symbols are part of the public API, these are used for\n// debugging DX and as a safe way to provide an intimate contract on public objects.\n\nexport const SOURCE: '___(unique) Symbol(SOURCE)' = getOrSetGlobal('SOURCE', Symbol('#source'));\n\nexport const Destroy: '___(unique) Symbol(Destroy)' = getOrSetGlobal(\n 'Destroy',\n Symbol.dispose || Symbol.for('Dispose')\n);\n/**\n * Symbol for the method used to request a mutable copy of an otherwise\n * immutable {@link ReactiveResource}.\n *\n * @deprecated use the {@link checkout} utility function instead.\n */\nexport const Checkout: '___(unique) Symbol(Checkout)' = getOrSetGlobal('Checkout', Symbol('Checkout'));\nexport const Commit: '___(unique) Symbol(Commit)' = getOrSetGlobal('Commit', Symbol('Commit'));\n\n/**\n * Symbol used to stash the internal field/resource context (schema, store,\n * mutability, etc.) on a {@link ReactiveResource} or reactive field instance.\n */\nexport const Context: '___(unique) Symbol(Context)' = getOrSetGlobal('Context', Symbol('Context'));\n"],"mappings":";;;AAiCA,MAAaC,SAAuCD,eAAe,UAAUE,OAAO,SAAS,CAAC;AAE9F,MAAaC,UAAyCH,eACpD,WACAE,OAAOE,WAAWF,OAAOG,IAAI,SAAS,CACxC;;;;;;;AAOA,MAAaC,WAA2CN,eAAe,YAAYE,OAAO,UAAU,CAAC;AACrG,MAAaK,SAAuCP,eAAe,UAAUE,OAAO,QAAQ,CAAC;;;;;AAM7F,MAAaM,UAAyCR,eAAe,WAAWE,OAAO,SAAS,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
//#region package.json
|
|
2
2
|
var name = "@warp-drive/core";
|
|
3
|
-
var version = "5.9.0-beta.
|
|
3
|
+
var version = "5.9.0-beta.2";
|
|
4
4
|
|
|
5
5
|
//#endregion
|
|
6
6
|
//#region src/types/-private.ts
|
|
@@ -108,4 +108,4 @@ function setUniversalTransient(key, value) {
|
|
|
108
108
|
|
|
109
109
|
//#endregion
|
|
110
110
|
export { setTransient as a, peekUniversalTransient as i, getOrSetUniversal as n, setUniversalTransient as o, peekTransient as r, getOrSetGlobal as t };
|
|
111
|
-
//# sourceMappingURL=-private-
|
|
111
|
+
//# sourceMappingURL=-private-D6Tw25AD.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"-private-D6Tw25AD.js","names":["name","version","GlobalRef","globalThis","UniversalCache","__warpDrive_universalCache","__version","GlobalSink","Error","ModuleScopedCaches","__warpDrive_ModuleScopedCaches","console","warn","getOrSetGlobal","key","value","existing","undefined","peekTransient","globalKey","setTransient","getOrSetUniversal","peekUniversalTransient","setUniversalTransient"],"sources":["../../../package.json","../../../src/types/-private.ts"],"sourcesContent":["","// in testing mode, we utilize globals to ensure only one copy exists of\n// these maps, due to bugs in ember-auto-import\nimport { DEBUG, TESTING } from '@warp-drive/core/build-config/env';\n\nimport { name, version } from '../../package.json';\n\ntype UniversalTransientKey =\n // @warp-drive/core/request\n 'REQ_ID';\n\ntype UniversalKey =\n | `(transient) ${UniversalTransientKey}`\n // @warp-drive/core/request\n | 'RequestMap'\n | 'PromiseCache'\n | 'RequestCache'\n // @warp-drive/core-types/request\n | 'SkipCache'\n | 'EnableHydration'\n // @warp-drive/core-types/runtime\n | 'WarpDriveRuntimeConfig';\n\ntype TransientKey =\n // @warp-drive/core/graph\n | 'transactionRef'\n // @warp-drive/core/store\n | 'configuredGenerationMethod'\n | 'configuredUpdateMethod'\n | 'configuredForgetMethod'\n | 'configuredResetMethod'\n | 'configuredKeyInfoMethod'\n | 'signalHooks';\n\ntype GlobalKey =\n | `(transient) ${TransientKey}`\n // @warp-drive/legacy/adapter\n | 'AdapterError'\n | 'InvalidError'\n | 'TimeoutError'\n | 'AbortError'\n | 'UnauthorizedError'\n | 'ForbiddenError'\n | 'NotFoundError'\n | 'ConflictError'\n | 'ServerError'\n // @warp-drive/core/store/reactivity\n | '#{}'\n | '#[]'\n | 'Signals'\n // @warp-drive/legacy LegacySupport\n | 'AvailableShims'\n // @warp-drive/core RecordArrayManager\n | 'FAKE_ARR'\n // @warp-drive/core ReactiveArray\n | '#source'\n | '#update'\n | '#notify'\n | 'IS_COLLECTION'\n // @warp-drive/core RequestCache\n | 'Touching'\n | 'RequestPromise'\n // @warp-drive/legacy/compat FetchManager\n | 'SaveOp'\n // @warp-drive/legacy Model\n | 'LEGACY_SUPPORT'\n | 'LegacySupport'\n // @warp-drive/core/graph\n | 'Graphs'\n // @warp-drive/core/request\n | 'IS_FROZEN'\n | 'IS_CACHE_HANDLER'\n // @warp-drive/utilities\n | 'CONFIG'\n // @warp-drive/core CacheKeyManager\n | 'DEBUG_MAP'\n | 'IDENTIFIERS'\n | 'DOCUMENTS'\n // @warp-drive/core InstanceCache\n | 'RecordCache'\n | 'StoreMap'\n // @warp-drive/core/types/symbols\n | 'Store'\n | '$type'\n | 'TransformName'\n | 'RequestSignature'\n // @warp-drive/core/types/request\n | 'IS_FUTURE'\n | 'DOC'\n // @warp-drive/core NotificationManager\n | 'UnscopedChannel'\n // @warp-drive/core/reactive\n | 'ManagedArrayMap'\n | 'ManagedObjectMap'\n | 'Support'\n | 'SOURCE'\n | 'Destroy'\n | 'Checkout'\n | 'Commit'\n | 'Context';\n\ntype ModuleScopedCaches = Record<GlobalKey, unknown>;\n\nconst GlobalRef = globalThis as unknown as Record<\n string,\n {\n __warpDrive_ModuleScopedCaches?: ModuleScopedCaches;\n __warpDrive_hasOtherCopy?: boolean;\n __version: string;\n }\n> & {\n __warpDrive_universalCache: Record<UniversalKey, unknown>;\n};\nconst UniversalCache = (GlobalRef.__warpDrive_universalCache =\n GlobalRef.__warpDrive_universalCache ?? ({} as Record<UniversalKey, unknown>));\n\n// in order to support mirror packages, we ensure that each\n// unique package name has its own global cache\nGlobalRef[name] = GlobalRef[name] ?? { __version: version };\nconst GlobalSink = GlobalRef[name];\n\nif (DEBUG) {\n if (GlobalSink.__version !== version) {\n throw new Error('Multiple versions of WarpDrive detected, the application will malfunction.');\n }\n}\n\nconst ModuleScopedCaches = GlobalSink.__warpDrive_ModuleScopedCaches ?? ({} as ModuleScopedCaches);\nif (TESTING) {\n if (!GlobalSink.__warpDrive_ModuleScopedCaches) {\n GlobalSink.__warpDrive_ModuleScopedCaches = ModuleScopedCaches;\n } else {\n // oxlint-disable-next-line no-console\n console.warn(`\nMultiple copies of WarpDrive have been detected. This may be due to a bug in ember-auto-import\n in which test assets get their own copy of some v2-addons. This can cause the application to\n malfunction as each copy will maintain its own separate state.`);\n }\n} else {\n if (GlobalSink.__warpDrive_hasOtherCopy) {\n throw new Error('Multiple copies of WarpDrive detected, the application will malfunction.');\n }\n GlobalSink.__warpDrive_hasOtherCopy = true;\n}\n\ntype UniqueSymbol<T extends string> = `___(unique) Symbol(${T})`;\ntype UniqueSymbolOr<T, K extends string> = T extends symbol ? UniqueSymbol<K> : T;\n\n/**\n * Coordinates creation of a singleton `value` (e.g. a symbol, WeakMap, or\n * error class) for `key` so that duplicate copies of this package loaded\n * into the same process observe the same instance instead of each creating\n * their own.\n *\n * In `TESTING` builds this stores/reads `value` from a cache namespaced to\n * this package's name on `globalThis` (see the file-level comments above for\n * why this is necessary). Outside of `TESTING`, only one copy of the package\n * is expected to exist, so this is a no-op that always returns `value`\n * unchanged.\n *\n * The return type lies about symbols being unique to work around the d.ts\n * rollup issue described in `reactive/-private/symbols.ts`.\n *\n * @private\n */\nexport function getOrSetGlobal<T, K extends GlobalKey>(key: K, value: T): UniqueSymbolOr<T, K> {\n if (TESTING) {\n const existing = ModuleScopedCaches[key];\n if (existing === undefined) {\n return (ModuleScopedCaches[key] = value) as UniqueSymbolOr<T, K>;\n } else {\n return existing as UniqueSymbolOr<T, K>;\n }\n } else {\n return value as UniqueSymbolOr<T, K>;\n }\n}\n\n/**\n * Reads back the current value stored for `key` by {@link setTransient}, or\n * `null` if nothing has been stored yet.\n *\n * Unlike {@link getOrSetGlobal}, this always reads through the same\n * package-namespaced cache regardless of the `TESTING` flag, since this is\n * used for genuinely mutable state (not just singleton values) that must\n * stay in sync across any duplicate copies of this package.\n *\n * @private\n */\nexport function peekTransient<T>(key: TransientKey): T | null {\n const globalKey: `(transient) ${TransientKey}` = `(transient) ${key}`;\n return (ModuleScopedCaches[globalKey] as T) ?? null;\n}\n\n/**\n * Stores `value` for `key`, overwriting whatever was previously stored, so\n * that it can later be read back via {@link peekTransient}.\n *\n * See {@link peekTransient} for details on when/why this cache is shared.\n *\n * @private\n */\nexport function setTransient<T>(key: TransientKey, value: T): T {\n const globalKey: `(transient) ${TransientKey}` = `(transient) ${key}`;\n return (ModuleScopedCaches[globalKey] = value);\n}\n\n/**\n * Like {@link getOrSetGlobal}, but reads/writes a cache that is shared across\n * *all* copies of WarpDrive on `globalThis`, regardless of package name.\n *\n * This is used for keys (e.g. request/promise caches) that must be\n * coordinated even across \"mirror\" packages published under different\n * names, rather than only across duplicate copies of the same package name.\n *\n * @private\n */\nexport function getOrSetUniversal<T, K extends UniversalKey>(key: K, value: T): UniqueSymbolOr<T, K> {\n if (TESTING) {\n const existing = UniversalCache[key];\n if (existing === undefined) {\n return (UniversalCache[key] = value) as UniqueSymbolOr<T, K>;\n } else {\n return existing as UniqueSymbolOr<T, K>;\n }\n } else {\n return value as UniqueSymbolOr<T, K>;\n }\n}\n\n/**\n * Like {@link peekTransient}, but reads from the package-name-independent\n * cache used by {@link getOrSetUniversal}. Always reads through this shared\n * cache regardless of the `TESTING` flag.\n *\n * @private\n */\nexport function peekUniversalTransient<T>(key: UniversalTransientKey): T | null {\n const globalKey: `(transient) ${UniversalTransientKey}` = `(transient) ${key}`;\n return (UniversalCache[globalKey] as T) ?? null;\n}\n\n/**\n * Like {@link setTransient}, but writes to the package-name-independent\n * cache used by {@link getOrSetUniversal}, so it can later be read via\n * {@link peekUniversalTransient}.\n *\n * @private\n */\nexport function setUniversalTransient<T>(key: UniversalTransientKey, value: T): T {\n const globalKey: `(transient) ${UniversalTransientKey}` = `(transient) ${key}`;\n return (UniversalCache[globalKey] = value);\n}\n"],"mappings":";;;;;;ACsGA,MAAME,YAAYC;AAUlB,MAAMC,iBAAkBF,UAAUG,6BAChCH,UAAUG,8BAA+B,CAAC;AAI5CH,UAAUF,QAAQE,UAAUF,SAAS,EAAEM,WAAWL,QAAQ;AAC1D,MAAMM,aAAaL,UAAUF;AAG3B,IAAIO,WAAWD,cAAcL,SAC3B,MAAM,IAAIO,MAAM,4EAA4E;AAIhG,MAAMC,qBAAqBF,WAAWG,kCAAmC,CAAC;AAExE,IAAI,CAACH,WAAWG,gCACdH,WAAWG,iCAAiCD;KAG5CE,QAAQC,KAAK;;;iEAGgD;;;;;;;;;;;;;;;;;;AA6BjE,SAAgBC,eAAuCC,KAAQC,OAAgC;CAChF;EACX,MAAMC,WAAWP,mBAAmBK;EACpC,IAAIE,aAAaC,QACf,OAAQR,mBAAmBK,OAAOC;OAElC,OAAOC;CAEX;AAGF;;;;;;;;;;;;AAaA,SAAgBE,cAAiBJ,KAA6B;CAC5D,MAAMK,YAA2C,eAAeL;CAChE,OAAQL,mBAAmBU,cAAoB;AACjD;;;;;;;;;AAUA,SAAgBC,aAAgBN,KAAmBC,OAAa;CAC9D,MAAMI,YAA2C,eAAeL;CAChE,OAAQL,mBAAmBU,aAAaJ;AAC1C;;;;;;;;;;;AAYA,SAAgBM,kBAA6CP,KAAQC,OAAgC;CACtF;EACX,MAAMC,WAAWZ,eAAeU;EAChC,IAAIE,aAAaC,QACf,OAAQb,eAAeU,OAAOC;OAE9B,OAAOC;CAEX;AAGF;;;;;;;;AASA,SAAgBM,uBAA0BR,KAAsC;CAC9E,MAAMK,YAAoD,eAAeL;CACzE,OAAQV,eAAee,cAAoB;AAC7C;;;;;;;;AASA,SAAgBI,sBAAyBT,KAA4BC,OAAa;CAChF,MAAMI,YAAoD,eAAeL;CACzE,OAAQV,eAAee,aAAaJ;AACtC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as setTransient, r as peekTransient, t as getOrSetGlobal } from "../-private-
|
|
2
|
-
import { t as getGlobalConfig } from "../runtime-
|
|
1
|
+
import { a as setTransient, r as peekTransient, t as getOrSetGlobal } from "../-private-D6Tw25AD.js";
|
|
2
|
+
import { t as getGlobalConfig } from "../runtime-DoDtzXJb.js";
|
|
3
3
|
|
|
4
4
|
//#region src/graph/-private/coerce-id.ts
|
|
5
5
|
function coerceId(id) {
|
|
@@ -135,7 +135,7 @@ function removeIdentifierCompletelyFromRelationship(graph, relationship, value,
|
|
|
135
135
|
}
|
|
136
136
|
}
|
|
137
137
|
/** Notifies the store that a relationship has changed, provided the relationship has been accessed and is not currently being removed. */
|
|
138
|
-
function notifyChange(graph, relationship) {
|
|
138
|
+
function notifyChange(graph, relationship, channel) {
|
|
139
139
|
if (!relationship.accessed) return;
|
|
140
140
|
const resourceKey = relationship.identifier;
|
|
141
141
|
const key = relationship.definition.key;
|
|
@@ -144,7 +144,7 @@ function notifyChange(graph, relationship) {
|
|
|
144
144
|
return;
|
|
145
145
|
}
|
|
146
146
|
if (getGlobalConfig().WarpDrive.debug.LOG_GRAPH || globalThis.getWarpDriveRuntimeConfig().debug.LOG_GRAPH) console.log(`Graph: notifying relationship change for ${String(resourceKey)} ${key}`);
|
|
147
|
-
graph.store.notifyChange(resourceKey, "relationships", key);
|
|
147
|
+
graph.store.notifyChange(resourceKey, "relationships", key, channel);
|
|
148
148
|
}
|
|
149
149
|
/**
|
|
150
150
|
* Asserts (dev-only) that a pushed relationship data payload conforms to the JSON:API resource
|
|
@@ -682,7 +682,7 @@ function replaceRelatedRecordsLocal(graph, op, isRemote) {
|
|
|
682
682
|
relationship.additions = diff.add;
|
|
683
683
|
relationship.removals = diff.del;
|
|
684
684
|
relationship.localState = diff.finalState;
|
|
685
|
-
if (becameDirty && !wasDirty) notifyChange(graph, relationship);
|
|
685
|
+
if (becameDirty && !wasDirty) notifyChange(graph, relationship, "local");
|
|
686
686
|
}
|
|
687
687
|
function replaceRelatedRecordsRemote(graph, op, isRemote) {
|
|
688
688
|
const resourceKeys = op.value;
|
|
@@ -692,7 +692,7 @@ function replaceRelatedRecordsRemote(graph, op, isRemote) {
|
|
|
692
692
|
if (!test) throw new Error(`You can only '${op.op}' on a hasMany relationship. ${op.record.type}.${op.field} is a ${relationship.definition.kind}`);
|
|
693
693
|
})(isHasMany(relationship));
|
|
694
694
|
if (isRemote) graph._addToTransaction(relationship);
|
|
695
|
-
|
|
695
|
+
relationship.isDirty;
|
|
696
696
|
if (!relationship.state.hasReceivedData) relationship.isDirty = true;
|
|
697
697
|
relationship.state.hasReceivedData = true;
|
|
698
698
|
const { definition } = relationship;
|
|
@@ -718,7 +718,8 @@ function replaceRelatedRecordsRemote(graph, op, isRemote) {
|
|
|
718
718
|
relationship.remoteState = diff.finalState;
|
|
719
719
|
if (diff.changed) relationship.isDirty = true;
|
|
720
720
|
relationship._diff = diff;
|
|
721
|
-
if (
|
|
721
|
+
if (diff.remoteOrderChanged) flushCanonical(graph, relationship, "remote");
|
|
722
|
+
if (diff.changed) flushCanonical(graph, relationship, "local");
|
|
722
723
|
}
|
|
723
724
|
function addToInverse(graph, resourceKey, key, value, isRemote) {
|
|
724
725
|
const relationship = graph.get(resourceKey, key);
|
|
@@ -734,11 +735,12 @@ function addToInverse(graph, resourceKey, key, value, isRemote) {
|
|
|
734
735
|
graph._addToTransaction(relationship);
|
|
735
736
|
if (relationship.remoteState !== null) removeFromInverse(graph, relationship.remoteState, relationship.definition.inverseKey, resourceKey, isRemote);
|
|
736
737
|
relationship.remoteState = value;
|
|
738
|
+
notifyChange(graph, relationship);
|
|
737
739
|
}
|
|
738
740
|
if (relationship.localState !== value) {
|
|
739
741
|
if (!isRemote && relationship.localState) removeFromInverse(graph, relationship.localState, relationship.definition.inverseKey, resourceKey, isRemote);
|
|
740
742
|
relationship.localState = value;
|
|
741
|
-
notifyChange(graph, relationship);
|
|
743
|
+
if (!isRemote) notifyChange(graph, relationship, "local");
|
|
742
744
|
}
|
|
743
745
|
} else if (isHasMany(relationship)) {
|
|
744
746
|
if (isRemote) {
|
|
@@ -755,7 +757,7 @@ function addToInverse(graph, resourceKey, key, value, isRemote) {
|
|
|
755
757
|
}
|
|
756
758
|
} else {
|
|
757
759
|
if (!relationship.isDirty && !relationship.localState) relationship.localState = [];
|
|
758
|
-
if (_add(graph, resourceKey, relationship, value, null, isRemote)) notifyChange(graph, relationship);
|
|
760
|
+
if (_add(graph, resourceKey, relationship, value, null, isRemote)) notifyChange(graph, relationship, "local");
|
|
759
761
|
}
|
|
760
762
|
} else if (isRemote) {
|
|
761
763
|
if (!relationship.remoteMembers.has(value)) {
|
|
@@ -775,23 +777,24 @@ function removeFromInverse(graph, resourceKey, key, value, isRemote) {
|
|
|
775
777
|
if (isRemote) {
|
|
776
778
|
graph._addToTransaction(relationship);
|
|
777
779
|
relationship.remoteState = null;
|
|
780
|
+
notifyChange(graph, relationship);
|
|
778
781
|
}
|
|
779
782
|
if (relationship.localState === value) {
|
|
780
783
|
relationship.localState = null;
|
|
781
|
-
notifyChange(graph, relationship);
|
|
784
|
+
if (!isRemote) notifyChange(graph, relationship, "local");
|
|
782
785
|
}
|
|
783
786
|
} else if (isHasMany(relationship)) {
|
|
784
787
|
if (isRemote) {
|
|
785
788
|
graph._addToTransaction(relationship);
|
|
786
789
|
if (_removeRemote(relationship, value)) notifyChange(graph, relationship);
|
|
787
|
-
} else if (_removeLocal(relationship, value)) notifyChange(graph, relationship);
|
|
790
|
+
} else if (_removeLocal(relationship, value)) notifyChange(graph, relationship, "local");
|
|
788
791
|
} else if (isRemote) {
|
|
789
792
|
relationship.remoteMembers.delete(value);
|
|
790
793
|
relationship.localMembers.delete(value);
|
|
791
794
|
} else if (value && relationship.localMembers.has(value)) relationship.localMembers.delete(value);
|
|
792
795
|
}
|
|
793
|
-
function flushCanonical(graph, rel) {
|
|
794
|
-
if (rel.accessed) graph._scheduleLocalSync(rel);
|
|
796
|
+
function flushCanonical(graph, rel, channel) {
|
|
797
|
+
if (rel.accessed) graph._scheduleLocalSync(rel, channel);
|
|
795
798
|
}
|
|
796
799
|
|
|
797
800
|
//#endregion
|
|
@@ -836,13 +839,11 @@ function replaceRelatedRecord(graph, op, isRemote = false) {
|
|
|
836
839
|
addToInverse(graph, op.value, definition.inverseKey, op.record, isRemote);
|
|
837
840
|
}
|
|
838
841
|
if (isRemote) {
|
|
842
|
+
notifyChange(graph, relationship);
|
|
839
843
|
const { localState, remoteState } = relationship;
|
|
840
844
|
if (localState && checkIfNew(graph._realStore, localState) && !remoteState) return;
|
|
841
|
-
if (localState !== remoteState && localState === existingState)
|
|
842
|
-
|
|
843
|
-
notifyChange(graph, relationship);
|
|
844
|
-
}
|
|
845
|
-
} else notifyChange(graph, relationship);
|
|
845
|
+
if (localState !== remoteState && localState === existingState) relationship.localState = remoteState;
|
|
846
|
+
} else notifyChange(graph, relationship, "local");
|
|
846
847
|
}
|
|
847
848
|
|
|
848
849
|
//#endregion
|
|
@@ -1260,7 +1261,7 @@ function addToRelatedRecords(graph, op, isRemote) {
|
|
|
1260
1261
|
if (!relationship.isDirty && !relationship.localState) relationship.localState = [];
|
|
1261
1262
|
if (Array.isArray(value)) for (let i = 0; i < value.length; i++) addRelatedRecord(graph, relationship, record, value[i], index !== void 0 ? index + i : null, isRemote);
|
|
1262
1263
|
else addRelatedRecord(graph, relationship, record, value, index ?? null, isRemote);
|
|
1263
|
-
notifyChange(graph, relationship);
|
|
1264
|
+
notifyChange(graph, relationship, isRemote ? void 0 : "local");
|
|
1264
1265
|
}
|
|
1265
1266
|
function addRelatedRecord(graph, relationship, record, value, index, isRemote) {
|
|
1266
1267
|
((test) => {
|
|
@@ -1290,11 +1291,16 @@ function mergeInRelationship(graph, rel, op) {
|
|
|
1290
1291
|
else mergeImplicit(graph, rel, op);
|
|
1291
1292
|
}
|
|
1292
1293
|
function mergeBelongsTo(graph, rel, op) {
|
|
1293
|
-
|
|
1294
|
+
let changed = false;
|
|
1295
|
+
if (rel.remoteState === op.record) {
|
|
1296
|
+
rel.remoteState = op.value;
|
|
1297
|
+
changed = true;
|
|
1298
|
+
}
|
|
1294
1299
|
if (rel.localState === op.record) {
|
|
1295
1300
|
rel.localState = op.value;
|
|
1296
|
-
|
|
1301
|
+
changed = true;
|
|
1297
1302
|
}
|
|
1303
|
+
if (changed) notifyChange(graph, rel);
|
|
1298
1304
|
}
|
|
1299
1305
|
function mergeHasMany(graph, rel, op) {
|
|
1300
1306
|
if (rel.remoteMembers.has(op.record)) {
|
|
@@ -1353,7 +1359,7 @@ function removeFromRelatedRecords(graph, op, isRemote) {
|
|
|
1353
1359
|
})(isHasMany(relationship));
|
|
1354
1360
|
if (Array.isArray(value)) for (let i = 0; i < value.length; i++) removeRelatedRecord(graph, record, relationship, value[i], op.index ?? null, isRemote);
|
|
1355
1361
|
else removeRelatedRecord(graph, record, relationship, value, op.index ?? null, isRemote);
|
|
1356
|
-
notifyChange(graph, relationship);
|
|
1362
|
+
notifyChange(graph, relationship, isRemote ? void 0 : "local");
|
|
1357
1363
|
}
|
|
1358
1364
|
function removeRelatedRecord(graph, record, relationship, value, index, isRemote) {
|
|
1359
1365
|
((test) => {
|
|
@@ -1525,8 +1531,11 @@ var Graph = class {
|
|
|
1525
1531
|
* {@link Graph.push} but not yet flushed into the graph by {@link Graph._flushRemoteQueue}.
|
|
1526
1532
|
*/
|
|
1527
1533
|
/**
|
|
1528
|
-
* The
|
|
1529
|
-
*
|
|
1534
|
+
* The {@link CollectionEdge}s that have changes pending notification, scheduled via
|
|
1535
|
+
* {@link Graph._scheduleLocalSync} and drained by {@link Graph._flushLocalQueue}, each
|
|
1536
|
+
* mapped to the {@link NotificationChannel} the notification should be scoped to —
|
|
1537
|
+
* `null` when it must reach every subscriber (scheduled unscoped, or scheduled for
|
|
1538
|
+
* both channels).
|
|
1530
1539
|
*/
|
|
1531
1540
|
/**
|
|
1532
1541
|
* The identifier of the current remote-update transaction, or `null` when no transaction is
|
|
@@ -1552,7 +1561,7 @@ var Graph = class {
|
|
|
1552
1561
|
hasMany: void 0,
|
|
1553
1562
|
deletions: []
|
|
1554
1563
|
};
|
|
1555
|
-
this._updatedRelationships = /* @__PURE__ */ new
|
|
1564
|
+
this._updatedRelationships = /* @__PURE__ */ new Map();
|
|
1556
1565
|
this._transaction = null;
|
|
1557
1566
|
this._removing = null;
|
|
1558
1567
|
this.silenceNotifications = false;
|
|
@@ -1884,12 +1893,16 @@ var Graph = class {
|
|
|
1884
1893
|
}
|
|
1885
1894
|
}
|
|
1886
1895
|
/**
|
|
1887
|
-
* Marks a {@link CollectionEdge} as having
|
|
1888
|
-
*
|
|
1889
|
-
*
|
|
1896
|
+
* Marks a {@link CollectionEdge} as having changes that need to be notified on the given
|
|
1897
|
+
* {@link NotificationChannel} (omitted = unscoped, reaching every subscriber), and schedules
|
|
1898
|
+
* a flush of the sync queue (see {@link Graph._flushLocalQueue}) if one is not already
|
|
1899
|
+
* pending. Scheduling the same edge for both channels (or once unscoped) coalesces into a
|
|
1900
|
+
* single unscoped notification.
|
|
1890
1901
|
*/
|
|
1891
|
-
_scheduleLocalSync(relationship) {
|
|
1892
|
-
this._updatedRelationships
|
|
1902
|
+
_scheduleLocalSync(relationship, channel) {
|
|
1903
|
+
const pending = this._updatedRelationships;
|
|
1904
|
+
if (!pending.has(relationship)) pending.set(relationship, channel ?? null);
|
|
1905
|
+
else if (pending.get(relationship) !== (channel ?? null)) pending.set(relationship, null);
|
|
1893
1906
|
if (!this._willSyncLocal) {
|
|
1894
1907
|
this._willSyncLocal = true;
|
|
1895
1908
|
getStore(this.store)._schedule("sync", () => this._flushLocalQueue());
|
|
@@ -1942,13 +1955,13 @@ var Graph = class {
|
|
|
1942
1955
|
if (!this._willSyncLocal) return;
|
|
1943
1956
|
if (this.silenceNotifications) {
|
|
1944
1957
|
this.silenceNotifications = false;
|
|
1945
|
-
this._updatedRelationships = /* @__PURE__ */ new
|
|
1958
|
+
this._updatedRelationships = /* @__PURE__ */ new Map();
|
|
1946
1959
|
return;
|
|
1947
1960
|
}
|
|
1948
1961
|
this._willSyncLocal = false;
|
|
1949
1962
|
const updated = this._updatedRelationships;
|
|
1950
|
-
this._updatedRelationships = /* @__PURE__ */ new
|
|
1951
|
-
updated.forEach((rel) => notifyChange(this, rel));
|
|
1963
|
+
this._updatedRelationships = /* @__PURE__ */ new Map();
|
|
1964
|
+
updated.forEach((channel, rel) => notifyChange(this, rel, channel ?? void 0));
|
|
1952
1965
|
}
|
|
1953
1966
|
/**
|
|
1954
1967
|
* Tears down the graph: clears all tracked identifiers/edges, removes it from the global
|