This repository has been archived by the owner on Jun 20, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 237
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Issue with npm module dependencies being pulled into shared refe…
- Loading branch information
Showing
22 changed files
with
200 additions
and
20 deletions.
There are no files selected for viewing
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 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 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 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 @@ | ||
export * from "./token"; |
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 * as decode from "jwt-decode"; | ||
export function jwtdecode() { | ||
console.log(decode); | ||
return decode(""); | ||
} |
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,2 @@ | ||
export * from "./links"; | ||
export * from "./route"; |
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,4 @@ | ||
export const links = { | ||
test: "/test", | ||
whatever: "/whatever" | ||
}; |
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 { Store } from "../store"; | ||
export const route = () => { | ||
console.log("i am a routing object"); | ||
console.log("setting up store", Store); | ||
}; |
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 @@ | ||
export * from "./store"; |
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 { jwtdecode } from "../auth"; | ||
|
||
console.log("here shit"); | ||
export const Store = () => { | ||
console.log('********************************'); | ||
console.log("decode?", jwtdecode); | ||
}; |
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,3 @@ | ||
import { loadRoute } from "./route-loader"; | ||
|
||
loadRoute(); |
4 changes: 4 additions & 0 deletions
4
src/tests/stubs/cases/quantum_split_2/modules/test/routes/another-test-route.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,4 @@ | ||
export const anotherTestRoute = { | ||
component: () => import("../views/another-test-component"), | ||
moreComponents: [() => import("../views/test-component-header")] | ||
}; |
2 changes: 2 additions & 0 deletions
2
src/tests/stubs/cases/quantum_split_2/modules/test/routes/index.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,2 @@ | ||
export * from "./test-route"; | ||
export * from "./another-test-route"; |
6 changes: 6 additions & 0 deletions
6
src/tests/stubs/cases/quantum_split_2/modules/test/routes/test-route.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 { route } from "../../../common/routes"; | ||
|
||
export const testRoute = { | ||
component: () => import("../views/test-component"), | ||
moreComponents: [() => import("../views/test-component-header")] | ||
}; |
8 changes: 8 additions & 0 deletions
8
...ases/quantum_split_2/modules/test/views/another-test-component/another-test-component.tsx
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,8 @@ | ||
import { links } from "../../../../common/routes"; | ||
import { jwtdecode } from "../../../../common/auth"; | ||
|
||
export function AnotherTestComponent() { | ||
console.log("I am another test component"); | ||
console.log("I also reference links", links); | ||
console.log("and I reference the auth function", jwtdecode()); | ||
} |
2 changes: 2 additions & 0 deletions
2
src/tests/stubs/cases/quantum_split_2/modules/test/views/another-test-component/index.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,2 @@ | ||
import { AnotherTestComponent } from "./another-test-component"; | ||
export = AnotherTestComponent; |
2 changes: 2 additions & 0 deletions
2
src/tests/stubs/cases/quantum_split_2/modules/test/views/test-component-header/index.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,2 @@ | ||
import { TestComponentHeader } from "./test-component-header"; | ||
export = TestComponentHeader; |
3 changes: 3 additions & 0 deletions
3
.../cases/quantum_split_2/modules/test/views/test-component-header/test-component-header.tsx
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,3 @@ | ||
export function TestComponentHeader() { | ||
console.log("I am a test component header"); | ||
} |
2 changes: 2 additions & 0 deletions
2
src/tests/stubs/cases/quantum_split_2/modules/test/views/test-component/index.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,2 @@ | ||
import { TestComponent } from "./test-component"; | ||
export = TestComponent; |
8 changes: 8 additions & 0 deletions
8
src/tests/stubs/cases/quantum_split_2/modules/test/views/test-component/test-component.tsx
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,8 @@ | ||
import { links } from "../../../../common/routes"; | ||
|
||
// this bundle is receiving ALL of the common/ui/layout module split into it, | ||
// even though this isn't the only bundle using it. | ||
export function TestComponent() { | ||
console.log("I am a test component"); | ||
console.log("here are my links", links); | ||
} |
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,25 @@ | ||
import { testRoute, anotherTestRoute } from "./modules/test/routes"; | ||
|
||
import { route } from "./common/routes"; | ||
|
||
// this function is referenced in our split bundles too. | ||
// for some reason, the first split bundle is receiving ALL of | ||
// the common bundle files | ||
|
||
// this would get loaded into the router | ||
const routeLoader = [anotherTestRoute, testRoute]; | ||
|
||
// mock router call | ||
export async function loadRoute() { | ||
routeLoader.forEach(r => { | ||
runRoute(r); | ||
}); | ||
} | ||
|
||
async function runRoute(r: typeof testRoute) { | ||
const component = await r.component(); | ||
component(); | ||
|
||
const components = await Promise.all(r.moreComponents.map(r => r())); | ||
components.forEach(c => c()); | ||
} |
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,10 @@ | ||
{ | ||
"compilerOptions": { | ||
"module": "commonjs", | ||
"target": "ES6", | ||
"jsx": "react", | ||
"importHelpers": true, | ||
"emitDecoratorMetadata": true, | ||
"experimentalDecorators": true | ||
} | ||
} |