Skip to content

Commit 41ac87e

Browse files
Refactor CallbackRegistry and clientStartup initialization
- Move `initializeTimeoutEvents()` call to `getOrWaitForItem()` method in CallbackRegistry - Remove unnecessary 4-second delay in clientStartup - Clean up commented-out webpack configuration in clientWebpackConfig
1 parent 6aa8e2c commit 41ac87e

File tree

3 files changed

+1
-6
lines changed

3 files changed

+1
-6
lines changed

node_package/src/CallbackRegistry.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ export default class CallbackRegistry<T> {
1515

1616
constructor(registryType: string) {
1717
this.registryType = registryType;
18-
this.initializeTimeoutEvents();
1918
}
2019

2120
private initializeTimeoutEvents() {
@@ -75,6 +74,7 @@ export default class CallbackRegistry<T> {
7574
}
7675

7776
getOrWaitForItem(name: string): Promise<T> {
77+
this.initializeTimeoutEvents();
7878
return new Promise((resolve, reject) => {
7979
try {
8080
resolve(this.get(name));

node_package/src/clientStartup.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ function reactOnRailsPageUnloaded(): void {
2121
}
2222

2323
export async function clientStartup(context: Context): Promise<void> {
24-
await new Promise((resolve) => setTimeout(resolve, 4000));
2524
// Check if server rendering
2625
if (!isWindow(context)) {
2726
return;

spec/dummy/config/webpack/clientWebpackConfig.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,6 @@ const configureClient = () => {
99
// client config is going to try to load chunks.
1010
delete clientConfig.entry['server-bundle'];
1111

12-
// clientConfig.resolve.fallback = {
13-
// ...clientConfig.resolve.fallback,
14-
// 'process/browser': false,
15-
// };
1612
return clientConfig;
1713
};
1814

0 commit comments

Comments
 (0)