Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added an ipcRenderer usage sample to the electron-typescript example #20000

Merged
merged 7 commits into from
Jan 21, 2021

Conversation

ShashiSrinath
Copy link
Contributor

No description provided.

global.ipcRenderer was not recognized inside the renderer folder before
…mple

Added an example of ipc renderer usage
@ijjk ijjk added the examples Issue/PR related to examples label Dec 9, 2020
@vercel vercel bot temporarily deployed to Preview December 9, 2020 05:37 Inactive
@ijjk
Copy link
Member

ijjk commented Dec 9, 2020

Stats from current PR

Default Server Mode (Increase detected ⚠️)
General
vercel/next.js canary ShashiSrinath/next.js canary Change
buildDuration 9.8s 9.9s ⚠️ +85ms
nodeModulesSize 82.5 MB 82.5 MB
Page Load Tests Overall increase ✓
vercel/next.js canary ShashiSrinath/next.js canary Change
/ failed reqs 0 0
/ total time (seconds) 2.353 2.339 -0.01
/ avg req/sec 1062.59 1068.97 +6.38
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.272 1.27 0
/error-in-render avg req/sec 1965.62 1968.1 +2.48
Client Bundles (main, webpack, commons)
vercel/next.js canary ShashiSrinath/next.js canary Change
677f882d2ed8..34b9.js gzip 12.8 kB 12.8 kB
framework.HASH.js gzip 39 kB 39 kB
main-899eb31..d9d9.js gzip 6.56 kB 6.56 kB
webpack-e067..f178.js gzip 751 B 751 B
Overall change 59 kB 59 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary ShashiSrinath/next.js canary Change
polyfills-4b..e242.js gzip 31 kB 31 kB
Overall change 31 kB 31 kB
Client Pages
vercel/next.js canary ShashiSrinath/next.js canary Change
_app-7231d4b..5856.js gzip 1.28 kB 1.28 kB
_error-01375..90b6.js gzip 3.69 kB 3.69 kB
hooks-d4591d..e7c2.js gzip 887 B 887 B
index-17468f..5d83.js gzip 227 B 227 B
link-db223d9..dbd7.js gzip 1.61 kB 1.61 kB
routerDirect..fd29.js gzip 303 B 303 B
withRouter-b..76ae.js gzip 302 B 302 B
Overall change 8.31 kB 8.31 kB
Client Build Manifests
vercel/next.js canary ShashiSrinath/next.js canary Change
_buildManifest.js gzip 322 B 322 B
Overall change 322 B 322 B
Rendered Page Sizes
vercel/next.js canary ShashiSrinath/next.js canary Change
index.html gzip 614 B 614 B
link.html gzip 621 B 621 B
withRouter.html gzip 608 B 608 B
Overall change 1.84 kB 1.84 kB

Serverless Mode
General
vercel/next.js canary ShashiSrinath/next.js canary Change
buildDuration 11.5s 11.8s ⚠️ +309ms
nodeModulesSize 82.5 MB 82.5 MB
Client Bundles (main, webpack, commons)
vercel/next.js canary ShashiSrinath/next.js canary Change
677f882d2ed8..34b9.js gzip 12.8 kB 12.8 kB
framework.HASH.js gzip 39 kB 39 kB
main-899eb31..d9d9.js gzip 6.56 kB 6.56 kB
webpack-e067..f178.js gzip 751 B 751 B
Overall change 59 kB 59 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary ShashiSrinath/next.js canary Change
polyfills-4b..e242.js gzip 31 kB 31 kB
Overall change 31 kB 31 kB
Client Pages
vercel/next.js canary ShashiSrinath/next.js canary Change
_app-7231d4b..5856.js gzip 1.28 kB 1.28 kB
_error-01375..90b6.js gzip 3.69 kB 3.69 kB
hooks-d4591d..e7c2.js gzip 887 B 887 B
index-17468f..5d83.js gzip 227 B 227 B
link-db223d9..dbd7.js gzip 1.61 kB 1.61 kB
routerDirect..fd29.js gzip 303 B 303 B
withRouter-b..76ae.js gzip 302 B 302 B
Overall change 8.31 kB 8.31 kB
Client Build Manifests
vercel/next.js canary ShashiSrinath/next.js canary Change
_buildManifest.js gzip 322 B 322 B
Overall change 322 B 322 B
Serverless bundles
vercel/next.js canary ShashiSrinath/next.js canary Change
_error.js 1 MB 1 MB
404.html 2.67 kB 2.67 kB
hooks.html 1.92 kB 1.92 kB
index.js 1 MB 1 MB
link.js 1.06 MB 1.06 MB
routerDirect.js 1.05 MB 1.05 MB
withRouter.js 1.05 MB 1.05 MB
Overall change 5.16 MB 5.16 MB
Commit: 9e573dc

@vercel vercel bot temporarily deployed to Preview December 9, 2020 07:12 Inactive
@ijjk
Copy link
Member

ijjk commented Dec 9, 2020

Stats from current PR

Default Server Mode (Increase detected ⚠️)
General
vercel/next.js canary ShashiSrinath/next.js canary Change
buildDuration 8.5s 8.2s -269ms
nodeModulesSize 82.5 MB 82.5 MB
Page Load Tests Overall increase ✓
vercel/next.js canary ShashiSrinath/next.js canary Change
/ failed reqs 0 0
/ total time (seconds) 2.044 2.008 -0.04
/ avg req/sec 1223.29 1244.99 +21.7
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.08 1.044 -0.04
/error-in-render avg req/sec 2314.29 2395.77 +81.48
Client Bundles (main, webpack, commons)
vercel/next.js canary ShashiSrinath/next.js canary Change
677f882d2ed8..34b9.js gzip 12.8 kB 12.8 kB
framework.HASH.js gzip 39 kB 39 kB
main-899eb31..d9d9.js gzip 6.56 kB 6.56 kB
webpack-e067..f178.js gzip 751 B 751 B
Overall change 59 kB 59 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary ShashiSrinath/next.js canary Change
polyfills-4b..e242.js gzip 31 kB 31 kB
Overall change 31 kB 31 kB
Client Pages
vercel/next.js canary ShashiSrinath/next.js canary Change
_app-7231d4b..5856.js gzip 1.28 kB 1.28 kB
_error-01375..90b6.js gzip 3.69 kB 3.69 kB
hooks-d4591d..e7c2.js gzip 887 B 887 B
index-17468f..5d83.js gzip 227 B 227 B
link-db223d9..dbd7.js gzip 1.61 kB 1.61 kB
routerDirect..fd29.js gzip 303 B 303 B
withRouter-b..76ae.js gzip 302 B 302 B
Overall change 8.31 kB 8.31 kB
Client Build Manifests
vercel/next.js canary ShashiSrinath/next.js canary Change
_buildManifest.js gzip 322 B 322 B
Overall change 322 B 322 B
Rendered Page Sizes
vercel/next.js canary ShashiSrinath/next.js canary Change
index.html gzip 614 B 614 B
link.html gzip 621 B 621 B
withRouter.html gzip 608 B 608 B
Overall change 1.84 kB 1.84 kB

Serverless Mode
General
vercel/next.js canary ShashiSrinath/next.js canary Change
buildDuration 9.7s 9.8s ⚠️ +169ms
nodeModulesSize 82.5 MB 82.5 MB
Client Bundles (main, webpack, commons)
vercel/next.js canary ShashiSrinath/next.js canary Change
677f882d2ed8..34b9.js gzip 12.8 kB 12.8 kB
framework.HASH.js gzip 39 kB 39 kB
main-899eb31..d9d9.js gzip 6.56 kB 6.56 kB
webpack-e067..f178.js gzip 751 B 751 B
Overall change 59 kB 59 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary ShashiSrinath/next.js canary Change
polyfills-4b..e242.js gzip 31 kB 31 kB
Overall change 31 kB 31 kB
Client Pages
vercel/next.js canary ShashiSrinath/next.js canary Change
_app-7231d4b..5856.js gzip 1.28 kB 1.28 kB
_error-01375..90b6.js gzip 3.69 kB 3.69 kB
hooks-d4591d..e7c2.js gzip 887 B 887 B
index-17468f..5d83.js gzip 227 B 227 B
link-db223d9..dbd7.js gzip 1.61 kB 1.61 kB
routerDirect..fd29.js gzip 303 B 303 B
withRouter-b..76ae.js gzip 302 B 302 B
Overall change 8.31 kB 8.31 kB
Client Build Manifests
vercel/next.js canary ShashiSrinath/next.js canary Change
_buildManifest.js gzip 322 B 322 B
Overall change 322 B 322 B
Serverless bundles
vercel/next.js canary ShashiSrinath/next.js canary Change
_error.js 1 MB 1 MB
404.html 2.67 kB 2.67 kB
hooks.html 1.92 kB 1.92 kB
index.js 1 MB 1 MB
link.js 1.06 MB 1.06 MB
routerDirect.js 1.05 MB 1.05 MB
withRouter.js 1.05 MB 1.05 MB
Overall change 5.16 MB 5.16 MB
Commit: 4643151

@vercel vercel bot temporarily deployed to Preview December 9, 2020 13:25 Inactive
@ijjk
Copy link
Member

ijjk commented Dec 9, 2020

Stats from current PR

Default Server Mode (Increase detected ⚠️)
General
vercel/next.js canary ShashiSrinath/next.js canary Change
buildDuration 10.1s 9.8s -280ms
nodeModulesSize 82.5 MB 82.5 MB
Page Load Tests Overall increase ✓
vercel/next.js canary ShashiSrinath/next.js canary Change
/ failed reqs 0 0
/ total time (seconds) 2.39 2.417 ⚠️ +0.03
/ avg req/sec 1046.04 1034.47 ⚠️ -11.57
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.264 1.241 -0.02
/error-in-render avg req/sec 1977.74 2014.86 +37.12
Client Bundles (main, webpack, commons)
vercel/next.js canary ShashiSrinath/next.js canary Change
677f882d2ed8..34b9.js gzip 12.8 kB 12.8 kB
framework.HASH.js gzip 39 kB 39 kB
main-899eb31..d9d9.js gzip 6.56 kB 6.56 kB
webpack-e067..f178.js gzip 751 B 751 B
Overall change 59 kB 59 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary ShashiSrinath/next.js canary Change
polyfills-4b..e242.js gzip 31 kB 31 kB
Overall change 31 kB 31 kB
Client Pages
vercel/next.js canary ShashiSrinath/next.js canary Change
_app-7231d4b..5856.js gzip 1.28 kB 1.28 kB
_error-01375..90b6.js gzip 3.69 kB 3.69 kB
hooks-d4591d..e7c2.js gzip 887 B 887 B
index-17468f..5d83.js gzip 227 B 227 B
link-db223d9..dbd7.js gzip 1.61 kB 1.61 kB
routerDirect..fd29.js gzip 303 B 303 B
withRouter-b..76ae.js gzip 302 B 302 B
Overall change 8.31 kB 8.31 kB
Client Build Manifests
vercel/next.js canary ShashiSrinath/next.js canary Change
_buildManifest.js gzip 322 B 322 B
Overall change 322 B 322 B
Rendered Page Sizes
vercel/next.js canary ShashiSrinath/next.js canary Change
index.html gzip 614 B 614 B
link.html gzip 621 B 621 B
withRouter.html gzip 608 B 608 B
Overall change 1.84 kB 1.84 kB

Serverless Mode
General
vercel/next.js canary ShashiSrinath/next.js canary Change
buildDuration 11.6s 11.8s ⚠️ +271ms
nodeModulesSize 82.5 MB 82.5 MB
Client Bundles (main, webpack, commons)
vercel/next.js canary ShashiSrinath/next.js canary Change
677f882d2ed8..34b9.js gzip 12.8 kB 12.8 kB
framework.HASH.js gzip 39 kB 39 kB
main-899eb31..d9d9.js gzip 6.56 kB 6.56 kB
webpack-e067..f178.js gzip 751 B 751 B
Overall change 59 kB 59 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary ShashiSrinath/next.js canary Change
polyfills-4b..e242.js gzip 31 kB 31 kB
Overall change 31 kB 31 kB
Client Pages
vercel/next.js canary ShashiSrinath/next.js canary Change
_app-7231d4b..5856.js gzip 1.28 kB 1.28 kB
_error-01375..90b6.js gzip 3.69 kB 3.69 kB
hooks-d4591d..e7c2.js gzip 887 B 887 B
index-17468f..5d83.js gzip 227 B 227 B
link-db223d9..dbd7.js gzip 1.61 kB 1.61 kB
routerDirect..fd29.js gzip 303 B 303 B
withRouter-b..76ae.js gzip 302 B 302 B
Overall change 8.31 kB 8.31 kB
Client Build Manifests
vercel/next.js canary ShashiSrinath/next.js canary Change
_buildManifest.js gzip 322 B 322 B
Overall change 322 B 322 B
Serverless bundles
vercel/next.js canary ShashiSrinath/next.js canary Change
_error.js 1 MB 1 MB
404.html 2.67 kB 2.67 kB
hooks.html 1.92 kB 1.92 kB
index.js 1 MB 1 MB
link.js 1.06 MB 1.06 MB
routerDirect.js 1.05 MB 1.05 MB
withRouter.js 1.05 MB 1.05 MB
Overall change 5.16 MB 5.16 MB
Commit: 7424a35

@KushibikiMashu
Copy link

KushibikiMashu commented Jan 21, 2021

This example is what I'm looking for! It works well. Thanks!

@ijjk
Copy link
Member

ijjk commented Jan 21, 2021

Stats from current PR

Default Server Mode (Decrease detected ✓)
General
vercel/next.js canary ShashiSrinath/next.js canary Change
buildDuration 8.6s 8.8s ⚠️ +210ms
nodeModulesSize 73.3 MB 73.3 MB
Page Load Tests Overall decrease ⚠️
vercel/next.js canary ShashiSrinath/next.js canary Change
/ failed reqs 0 0
/ total time (seconds) 1.702 1.73 ⚠️ +0.03
/ avg req/sec 1468.78 1445.43 ⚠️ -23.35
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.036 1.115 ⚠️ +0.08
/error-in-render avg req/sec 2413.95 2242.34 ⚠️ -171.61
Client Bundles (main, webpack, commons)
vercel/next.js canary ShashiSrinath/next.js canary Change
677f882d2ed8..43e3.js gzip 13.1 kB 13.1 kB
framework.HASH.js gzip 39 kB 39 kB
main-HASH.js gzip 6.63 kB 6.63 kB
webpack-HASH.js gzip 751 B 751 B
Overall change 59.4 kB 59.4 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary ShashiSrinath/next.js canary Change
polyfills-HASH.js gzip 31.3 kB 31.3 kB
Overall change 31.3 kB 31.3 kB
Client Pages
vercel/next.js canary ShashiSrinath/next.js canary Change
_app-2a09aa2..4a98.js gzip 1.28 kB 1.28 kB
_error-8b758..aef6.js gzip 3.46 kB 3.46 kB
hooks-c71ae4..70cd.js gzip 887 B 887 B
index-bbee2f..528b.js gzip 227 B 227 B
link-7faf09b..eba4.js gzip 1.64 kB 1.64 kB
routerDirect..bf84.js gzip 303 B 303 B
withRouter-a..5826.js gzip 302 B 302 B
Overall change 8.09 kB 8.09 kB
Client Build Manifests
vercel/next.js canary ShashiSrinath/next.js canary Change
_buildManifest.js gzip 321 B 321 B
Overall change 321 B 321 B
Rendered Page Sizes
vercel/next.js canary ShashiSrinath/next.js canary Change
index.html gzip 616 B 616 B
link.html gzip 621 B 621 B
withRouter.html gzip 609 B 609 B
Overall change 1.85 kB 1.85 kB

Serverless Mode
General
vercel/next.js canary ShashiSrinath/next.js canary Change
buildDuration 10.5s 10.5s ⚠️ +1ms
nodeModulesSize 73.3 MB 73.3 MB
Client Bundles (main, webpack, commons)
vercel/next.js canary ShashiSrinath/next.js canary Change
677f882d2ed8..43e3.js gzip 13.1 kB 13.1 kB
framework.HASH.js gzip 39 kB 39 kB
main-HASH.js gzip 6.63 kB 6.63 kB
webpack-HASH.js gzip 751 B 751 B
Overall change 59.4 kB 59.4 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary ShashiSrinath/next.js canary Change
polyfills-HASH.js gzip 31.3 kB 31.3 kB
Overall change 31.3 kB 31.3 kB
Client Pages
vercel/next.js canary ShashiSrinath/next.js canary Change
_app-2a09aa2..4a98.js gzip 1.28 kB 1.28 kB
_error-8b758..aef6.js gzip 3.46 kB 3.46 kB
hooks-c71ae4..70cd.js gzip 887 B 887 B
index-bbee2f..528b.js gzip 227 B 227 B
link-7faf09b..eba4.js gzip 1.64 kB 1.64 kB
routerDirect..bf84.js gzip 303 B 303 B
withRouter-a..5826.js gzip 302 B 302 B
Overall change 8.09 kB 8.09 kB
Client Build Manifests
vercel/next.js canary ShashiSrinath/next.js canary Change
_buildManifest.js gzip 321 B 321 B
Overall change 321 B 321 B
Serverless bundles
vercel/next.js canary ShashiSrinath/next.js canary Change
_error.js 1 MB 1 MB
404.html 2.67 kB 2.67 kB
hooks.html 1.92 kB 1.92 kB
index.js 1 MB 1 MB
link.js 1.06 MB 1.06 MB
routerDirect.js 1.05 MB 1.05 MB
withRouter.js 1.05 MB 1.05 MB
Overall change 5.19 MB 5.19 MB

Webpack 5 Mode (Decrease detected ✓)
General
vercel/next.js canary ShashiSrinath/next.js canary Change
buildDuration 10.4s 10.4s -15ms
nodeModulesSize 73.3 MB 73.3 MB
Page Load Tests Overall decrease ⚠️
vercel/next.js canary ShashiSrinath/next.js canary Change
/ failed reqs 0 0
/ total time (seconds) 1.696 1.748 ⚠️ +0.05
/ avg req/sec 1473.92 1429.82 ⚠️ -44.1
/error-in-render failed reqs 0 0
/error-in-render total time (seconds) 1.078 1.09 ⚠️ +0.01
/error-in-render avg req/sec 2319.25 2292.61 ⚠️ -26.64
Client Bundles (main, webpack, commons)
vercel/next.js canary ShashiSrinath/next.js canary Change
597-3bd7d6bd..868b.js gzip 13 kB 13 kB
framework.HASH.js gzip 39.3 kB 39.3 kB
main-HASH.js gzip 6.58 kB 6.58 kB
webpack-HASH.js gzip 954 B 954 B
Overall change 59.8 kB 59.8 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary ShashiSrinath/next.js canary Change
polyfills-HASH.js gzip 31.1 kB 31.1 kB
Overall change 31.1 kB 31.1 kB
Client Pages
vercel/next.js canary ShashiSrinath/next.js canary Change
_app-a5b2e84..33cf.js gzip 1.26 kB 1.26 kB
_error-6f1f9..5577.js gzip 3.38 kB 3.38 kB
hooks-725de8..0a15.js gzip 904 B 904 B
index-939503..6e1c.js gzip 232 B 232 B
link-e0cc871..fdbb.js gzip 1.63 kB 1.63 kB
routerDirect..9360.js gzip 308 B 308 B
withRouter-6..44ec.js gzip 304 B 304 B
Overall change 8.02 kB 8.02 kB
Client Build Manifests
vercel/next.js canary ShashiSrinath/next.js canary Change
_buildManifest.js gzip 299 B 299 B
Overall change 299 B 299 B
Rendered Page Sizes
vercel/next.js canary ShashiSrinath/next.js canary Change
index.html gzip 585 B 585 B
link.html gzip 592 B 592 B
withRouter.html gzip 579 B 579 B
Overall change 1.76 kB 1.76 kB

Diffs

Diff for index.html
@@ -43,7 +43,7 @@
         "props": { "pageProps": {} },
         "page": "/",
         "query": {},
-        "buildId": "EUxILcpmDRYeFRVF21gUJ",
+        "buildId": "ENJl7mKYv25xQM4SR-2Jr",
         "isFallback": false,
         "gip": true
       }
@@ -77,11 +77,11 @@
       async=""
     ></script>
     <script
-      src="/_next/static/EUxILcpmDRYeFRVF21gUJ/_buildManifest.js"
+      src="/_next/static/ENJl7mKYv25xQM4SR-2Jr/_buildManifest.js"
       async=""
     ></script>
     <script
-      src="/_next/static/EUxILcpmDRYeFRVF21gUJ/_ssgManifest.js"
+      src="/_next/static/ENJl7mKYv25xQM4SR-2Jr/_ssgManifest.js"
       async=""
     ></script>
   </body>
Diff for link.html
@@ -48,7 +48,7 @@
         "props": { "pageProps": {} },
         "page": "/link",
         "query": {},
-        "buildId": "EUxILcpmDRYeFRVF21gUJ",
+        "buildId": "ENJl7mKYv25xQM4SR-2Jr",
         "isFallback": false,
         "gip": true
       }
@@ -82,11 +82,11 @@
       async=""
     ></script>
     <script
-      src="/_next/static/EUxILcpmDRYeFRVF21gUJ/_buildManifest.js"
+      src="/_next/static/ENJl7mKYv25xQM4SR-2Jr/_buildManifest.js"
       async=""
     ></script>
     <script
-      src="/_next/static/EUxILcpmDRYeFRVF21gUJ/_ssgManifest.js"
+      src="/_next/static/ENJl7mKYv25xQM4SR-2Jr/_ssgManifest.js"
       async=""
     ></script>
   </body>
Diff for withRouter.html
@@ -43,7 +43,7 @@
         "props": { "pageProps": {} },
         "page": "/withRouter",
         "query": {},
-        "buildId": "EUxILcpmDRYeFRVF21gUJ",
+        "buildId": "ENJl7mKYv25xQM4SR-2Jr",
         "isFallback": false,
         "gip": true
       }
@@ -77,11 +77,11 @@
       async=""
     ></script>
     <script
-      src="/_next/static/EUxILcpmDRYeFRVF21gUJ/_buildManifest.js"
+      src="/_next/static/ENJl7mKYv25xQM4SR-2Jr/_buildManifest.js"
       async=""
     ></script>
     <script
-      src="/_next/static/EUxILcpmDRYeFRVF21gUJ/_ssgManifest.js"
+      src="/_next/static/ENJl7mKYv25xQM4SR-2Jr/_ssgManifest.js"
       async=""
     ></script>
   </body>
Commit: 645bfef

@timneutkens timneutkens merged commit 9fd9d83 into vercel:canary Jan 21, 2021
@luker2
Copy link

luker2 commented Apr 19, 2021

Hey @timneutkens to make this even more typescript friendly, I wanted to use an enum instead of 'message'. Do you know how I could share TypeScript between electron & next, or how to tweak webpack?

I tried adding root/shared.ts with the enum but get:

You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file

@luker2
Copy link

luker2 commented Apr 20, 2021

Nevermind, #13045 (comment) worked for me.

@vercel vercel locked as resolved and limited conversation to collaborators Jan 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
examples Issue/PR related to examples
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants