From 8b7631228f95baf9e515a63eea32f83badcbab3b Mon Sep 17 00:00:00 2001 From: Milan Burda Date: Mon, 6 Sep 2021 11:06:27 +0200 Subject: [PATCH] chore: move native-image.ts back into common (#30838) --- filenames.auto.gni | 8 ++++---- lib/browser/api/module-list.ts | 1 - lib/common/api/module-list.ts | 1 + lib/{browser => common}/api/native-image.ts | 0 lib/renderer/api/module-list.ts | 1 - lib/renderer/api/native-image.ts | 3 --- lib/sandboxed_renderer/api/module-list.ts | 2 +- 7 files changed, 6 insertions(+), 10 deletions(-) rename lib/{browser => common}/api/native-image.ts (100%) delete mode 100644 lib/renderer/api/native-image.ts diff --git a/filenames.auto.gni b/filenames.auto.gni index 163f7be1d131..92bcbf4f0e7b 100644 --- a/filenames.auto.gni +++ b/filenames.auto.gni @@ -135,6 +135,7 @@ auto_filenames = { sandbox_bundle_deps = [ "lib/common/api/deprecate.ts", + "lib/common/api/native-image.ts", "lib/common/define-properties.ts", "lib/common/ipc-messages.ts", "lib/common/type-utils.ts", @@ -143,7 +144,6 @@ auto_filenames = { "lib/renderer/api/crash-reporter.ts", "lib/renderer/api/desktop-capturer.ts", "lib/renderer/api/ipc-renderer.ts", - "lib/renderer/api/native-image.ts", "lib/renderer/api/web-frame.ts", "lib/renderer/inspector.ts", "lib/renderer/ipc-renderer-internal-utils.ts", @@ -205,7 +205,6 @@ auto_filenames = { "lib/browser/api/menu.ts", "lib/browser/api/message-channel.ts", "lib/browser/api/module-list.ts", - "lib/browser/api/native-image.ts", "lib/browser/api/native-theme.ts", "lib/browser/api/net-log.ts", "lib/browser/api/net.ts", @@ -240,6 +239,7 @@ auto_filenames = { "lib/common/api/clipboard.ts", "lib/common/api/deprecate.ts", "lib/common/api/module-list.ts", + "lib/common/api/native-image.ts", "lib/common/api/shell.ts", "lib/common/define-properties.ts", "lib/common/init.ts", @@ -263,6 +263,7 @@ auto_filenames = { "lib/common/api/clipboard.ts", "lib/common/api/deprecate.ts", "lib/common/api/module-list.ts", + "lib/common/api/native-image.ts", "lib/common/api/shell.ts", "lib/common/define-properties.ts", "lib/common/init.ts", @@ -277,7 +278,6 @@ auto_filenames = { "lib/renderer/api/exports/electron.ts", "lib/renderer/api/ipc-renderer.ts", "lib/renderer/api/module-list.ts", - "lib/renderer/api/native-image.ts", "lib/renderer/api/web-frame.ts", "lib/renderer/init.ts", "lib/renderer/inspector.ts", @@ -303,6 +303,7 @@ auto_filenames = { "lib/common/api/clipboard.ts", "lib/common/api/deprecate.ts", "lib/common/api/module-list.ts", + "lib/common/api/native-image.ts", "lib/common/api/shell.ts", "lib/common/define-properties.ts", "lib/common/init.ts", @@ -316,7 +317,6 @@ auto_filenames = { "lib/renderer/api/exports/electron.ts", "lib/renderer/api/ipc-renderer.ts", "lib/renderer/api/module-list.ts", - "lib/renderer/api/native-image.ts", "lib/renderer/api/web-frame.ts", "lib/renderer/ipc-renderer-internal-utils.ts", "lib/renderer/ipc-renderer-internal.ts", diff --git a/lib/browser/api/module-list.ts b/lib/browser/api/module-list.ts index e7a12ce2b124..b9e3340cd295 100644 --- a/lib/browser/api/module-list.ts +++ b/lib/browser/api/module-list.ts @@ -16,7 +16,6 @@ export const browserModuleList: ElectronInternal.ModuleEntry[] = [ { name: 'Menu', loader: () => require('./menu') }, { name: 'MenuItem', loader: () => require('./menu-item') }, { name: 'MessageChannelMain', loader: () => require('./message-channel') }, - { name: 'nativeImage', loader: () => require('./native-image') }, { name: 'nativeTheme', loader: () => require('./native-theme') }, { name: 'net', loader: () => require('./net') }, { name: 'netLog', loader: () => require('./net-log') }, diff --git a/lib/common/api/module-list.ts b/lib/common/api/module-list.ts index 1c9d459cfa5c..a5493e552dfa 100644 --- a/lib/common/api/module-list.ts +++ b/lib/common/api/module-list.ts @@ -1,6 +1,7 @@ // Common modules, please sort alphabetically export const commonModuleList: ElectronInternal.ModuleEntry[] = [ { name: 'clipboard', loader: () => require('./clipboard') }, + { name: 'nativeImage', loader: () => require('./native-image') }, { name: 'shell', loader: () => require('./shell') }, // The internal modules, invisible unless you know their names. { name: 'deprecate', loader: () => require('./deprecate'), private: true } diff --git a/lib/browser/api/native-image.ts b/lib/common/api/native-image.ts similarity index 100% rename from lib/browser/api/native-image.ts rename to lib/common/api/native-image.ts diff --git a/lib/renderer/api/module-list.ts b/lib/renderer/api/module-list.ts index 4ae57b180e1b..e4612c3f41d9 100644 --- a/lib/renderer/api/module-list.ts +++ b/lib/renderer/api/module-list.ts @@ -3,7 +3,6 @@ export const rendererModuleList: ElectronInternal.ModuleEntry[] = [ { name: 'contextBridge', loader: () => require('./context-bridge') }, { name: 'crashReporter', loader: () => require('./crash-reporter') }, { name: 'ipcRenderer', loader: () => require('./ipc-renderer') }, - { name: 'nativeImage', loader: () => require('./native-image') }, { name: 'webFrame', loader: () => require('./web-frame') } ]; diff --git a/lib/renderer/api/native-image.ts b/lib/renderer/api/native-image.ts deleted file mode 100644 index e68d81a132c4..000000000000 --- a/lib/renderer/api/native-image.ts +++ /dev/null @@ -1,3 +0,0 @@ -const { nativeImage } = process._linkedBinding('electron_common_native_image'); - -export default nativeImage; diff --git a/lib/sandboxed_renderer/api/module-list.ts b/lib/sandboxed_renderer/api/module-list.ts index 3c148ecee36b..dafa6c578736 100644 --- a/lib/sandboxed_renderer/api/module-list.ts +++ b/lib/sandboxed_renderer/api/module-list.ts @@ -13,7 +13,7 @@ export const moduleList: ElectronInternal.ModuleEntry[] = [ }, { name: 'nativeImage', - loader: () => require('@electron/internal/renderer/api/native-image') + loader: () => require('@electron/internal/common/api/native-image') }, { name: 'webFrame',