Replace webpack with esbuild

This commit is contained in:
hensm
2021-05-26 18:32:46 +01:00
parent 13cd1127c6
commit d343ac4629
16 changed files with 10690 additions and 393 deletions

View File

@@ -1,6 +1,6 @@
{
"extensionName": {
"message": "EXTENSION_NAME"
"message": "fx_cast"
, "description": "Name of the extension and the native receiver selector window title."
}
, "extensionDescription": {

View File

@@ -144,7 +144,7 @@ browser.menus.onClicked.addListener(async (info, tab) => {
});
await browser.tabs.executeScript(tab.id, {
file: "senders/media/bundle.js"
file: "senders/media/index.js"
, frameId: info.frameId
});
} else {

View File

@@ -178,7 +178,7 @@ async function onBeforeCastSDKRequest(details: OnBeforeRequestDetails) {
});
return {
redirectUrl: browser.runtime.getURL("shim/bundle.js")
redirectUrl: browser.runtime.getURL("shim/index.js")
};
}

View File

@@ -5,7 +5,7 @@ import { Options } from "./lib/options";
export default {
bridgeApplicationName: APPLICATION_NAME
bridgeApplicationName: BRIDGE_NAME
, bridgeBackupEnabled: false
, bridgeBackupHost: "localhost"
, bridgeBackupPort: 9556

6
ext/src/global.d.ts vendored
View File

@@ -1,8 +1,6 @@
// Define replacement types
declare const BRIDGE_VERSION: string;
declare const BRIDGE_NAME: string;
declare const MIRRORING_APP_ID: string;
declare const APPLICATION_NAME: string;
declare const APPLICATION_VERSION: string;
declare type Nullable<T> = T | null;

View File

@@ -101,7 +101,7 @@ const getInfo = () => new Promise<BridgeInfo>(async (resolve, reject) => {
// Print compatibility info to console
if (!isVersionCompatible) {
logger.error(`Expecting ${applicationName} v${APPLICATION_VERSION}, found v${applicationVersion}. ${
logger.error(`Expecting ${applicationName} v${BRIDGE_VERSION}, found v${applicationVersion}. ${
isVersionOlder
? "Try updating the native app to the latest version."
: "Try updating the extension to the latest version"}`);
@@ -110,7 +110,7 @@ const getInfo = () => new Promise<BridgeInfo>(async (resolve, reject) => {
resolve({
name: applicationName
, version: applicationVersion
, expectedVersion: APPLICATION_VERSION
, expectedVersion: BRIDGE_VERSION
// Version info
, isVersionExact

View File

@@ -1,15 +1,15 @@
{
"name": "__MSG_extensionName__"
, "description": "__MSG_extensionDescription__"
, "version": "EXTENSION_VERSION"
, "version": "0.1.2"
, "developer": {
"name": "AUTHOR"
, "url": "AUTHOR_HOMEPAGE"
"name": "Matt Hensman"
, "url": "https://matt.tf/"
}
, "applications": {
"gecko": {
"id": "EXTENSION_ID"
"id": "fx_cast@matt.tf"
, "strict_min_version": "64.0"
, "update_url": "https://hensm.github.io/fx_cast/updates.json"
}
@@ -25,7 +25,7 @@
}
, "background": {
"scripts": [ "background.js" ]
"scripts": [ "background/background.js" ]
}
, "content_scripts": [
@@ -39,7 +39,6 @@
}
]
, "content_security_policy": "CONTENT_SECURITY_POLICY"
, "default_locale": "en"
, "icons": {
@@ -66,7 +65,7 @@
, "<all_urls>"
]
, "web_accessible_resources": [
"shim/bundle.js"
"shim/index.js"
, "senders/media/overlay/overlayContent.js"
, "senders/media/overlay/AirPlay_Audio.svg"
, "senders/media/overlay/AirPlay_Video.svg"

View File

@@ -133,8 +133,8 @@ class OptionsApp extends Component<
return (
<div>
<form id="form" ref={ form => { this.form = form; }}
onSubmit={ this.handleFormSubmit }
onChange={ this.handleFormChange }>
onSubmit={ this.handleFormSubmit }
onChange={ this.handleFormChange }>
<Bridge info={ this.state.bridgeInfo }
loading={ this.state.bridgeLoading }

View File

@@ -1,13 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="../photon-colors.css">
<link rel="stylesheet" href="../photon-widgets.css">
<link rel="stylesheet" href="styles/index.css">
</head>
<body>
<div id="root"></div>
</body>
</html>