-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Convert mostly everything to new webpack modules structure
- Loading branch information
Showing
22 changed files
with
447 additions
and
471 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import spacepack from "@moonlight-mod/wp/spacepack_spacepack"; | ||
|
||
module.exports = spacepack.findByCode( | ||
["useStateFromStores", ":function"].join("") | ||
)[0].exports; |
6 changes: 6 additions & 0 deletions
6
packages/core-extensions/src/common/webpackModules/fluxDispatcher.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import spacepack from "@moonlight-mod/wp/spacepack_spacepack"; | ||
|
||
module.exports = spacepack.findByExports( | ||
"isDispatching", | ||
"dispatch" | ||
)[0].exports.default; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import spacepack from "@moonlight-mod/wp/spacepack_spacepack"; | ||
|
||
module.exports = spacepack.findByCode( | ||
"__SECRET_INTERNALS_DO_NOT_USE" + "_OR_YOU_WILL_BE_FIRED", | ||
/\.?version(?:=|:)/, | ||
/\.?createElement(?:=|:)/ | ||
)[0].exports; |
23 changes: 23 additions & 0 deletions
23
packages/core-extensions/src/common/webpackModules/stores.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import Flux from "@moonlight-mod/wp/common_flux"; | ||
|
||
module.exports = new Proxy( | ||
{}, | ||
{ | ||
get: function (target, key, receiver) { | ||
const allStores = Flux.Store.getAll(); | ||
|
||
let targetStore; | ||
for (const store of allStores) { | ||
const name = store.getName(); | ||
if (name.length === 1) continue; // filter out unnamed stores | ||
|
||
if (name === key) { | ||
targetStore = store; | ||
break; | ||
} | ||
} | ||
|
||
return targetStore; | ||
} | ||
} | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
packages/core-extensions/src/disableSentry/webpackModules/stub.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
const logger = moonlight.getLogger("disableSentry"); | ||
|
||
const keys = [ | ||
"setUser", | ||
"clearUser", | ||
"setTags", | ||
"setExtra", | ||
"captureException", | ||
"captureCrash", | ||
"captureMessage", | ||
"addBreadcrumb" | ||
]; | ||
|
||
export const proxy = () => | ||
new Proxy( | ||
{}, | ||
{ | ||
get(target, prop, receiver) { | ||
if (prop === "profiledRootComponent") { | ||
return (arg: any) => arg; | ||
} else if (prop === "crash") { | ||
return () => { | ||
throw Error("crash"); | ||
}; | ||
} else if (keys.includes(prop.toString())) { | ||
return (...args: any[]) => | ||
logger.debug(`Sentry calling "${prop.toString()}":`, ...args); | ||
} else { | ||
return undefined; | ||
} | ||
} | ||
} | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.