-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
improve fw lite dx by using vite dev (#1345)
* setup services in OnAfterRenderAsync which plays better with server pre rendering * when an override service is null, remove it from the services object instead of setting it to null * move invokeOnWindow to new Root component so it's shared between web and Maui, use that instead of Routes in each project * use vite dev for serving js
- Loading branch information
Showing
12 changed files
with
84 additions
and
56 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
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,14 @@ | ||
<script> | ||
window.invokeOnWindow = function (methodName, args) { | ||
if (!(methodName in window)) { | ||
//todo not sure how to handle this for now, maybe we wait until the app is ready? | ||
console.error(`Method ${methodName} not found`); | ||
return; | ||
} | ||
window[methodName](...args); | ||
}; | ||
</script> | ||
<Routes/> | ||
@code { | ||
|
||
} |
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,16 @@ | ||
if (import.meta.env.DEV) { | ||
//when in dev mode, svelte and vite want to put style sheets in the head | ||
//however blazor will remove them, so we need to put them in the body instead | ||
// eslint-disable-next-line @typescript-eslint/unbound-method | ||
const headerAppend = document.head.appendChild; | ||
document.head.appendChild = function newAppend<T extends Node>(node: T) { | ||
//this is used for both svelte and vite imports | ||
if (node.nodeName === 'STYLE') { | ||
document.getElementById('svelte-app')?.appendChild(node); | ||
} else { | ||
headerAppend.call(document.head, node); | ||
} | ||
return node; | ||
}; | ||
} | ||
|
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