-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d79e2a0
commit d54cfa4
Showing
12 changed files
with
25,915 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/****************************************************************************** | ||
* This file is auto-generated by Vaadin. | ||
* If you want to customize the entry point, you can copy this file or create | ||
* your own `index.ts` in your frontend directory. | ||
* By default, the `index.ts` file should be in `./frontend/` folder. | ||
* | ||
* NOTE: | ||
* - You need to restart the dev-server after adding the new `index.ts` file. | ||
* After that, all modifications to `index.ts` are recompiled automatically. | ||
* - `index.js` is also supported if you don't want to use TypeScript. | ||
******************************************************************************/ | ||
|
||
// import Vaadin client-router to handle client-side and server-side navigation | ||
import { Router } from '@vaadin/router'; | ||
|
||
// import Flow module to enable navigation to Vaadin server-side views | ||
import { Flow } from '@vaadin/flow-frontend/Flow'; | ||
|
||
const { serverSideRoutes } = new Flow({ | ||
imports: () => import('../../target/frontend/generated-flow-imports') | ||
}); | ||
|
||
const routes = [ | ||
// for client-side, place routes below (more info https://vaadin.com/docs/v15/flow/typescript/creating-routes.html) | ||
|
||
// for server-side, the next magic line sends all unmatched routes: | ||
...serverSideRoutes // IMPORTANT: this must be the last entry in the array | ||
]; | ||
|
||
// Vaadin router needs an outlet in the index.html page to display views | ||
const router = new Router(document.querySelector('#outlet')); | ||
router.setRoutes(routes); |
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,6 @@ | ||
// @ts-nocheck | ||
window.Vaadin = window.Vaadin || {}; | ||
window.Vaadin.featureFlags = window.Vaadin.featureFlags || {}; | ||
window.Vaadin.featureFlags.exampleFeatureFlag = false; | ||
window.Vaadin.featureFlags.viteForFrontendBuild = false; | ||
window.Vaadin.featureFlags.mapComponent = false; |
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,5 @@ | ||
import './vaadin-featureflags.ts'; | ||
|
||
import './index'; | ||
|
||
import '@vaadin/flow-frontend/VaadinDevmodeGizmo.js'; |
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,31 @@ | ||
// @ts-ignore | ||
if (import.meta.hot) { | ||
// @ts-ignore | ||
const hot = import.meta.hot; | ||
|
||
const isLiveReloadDisabled = () => { | ||
// Checks if live reload is disabled in the debug window | ||
return sessionStorage.getItem('vaadin.live-reload.active') === 'false'; | ||
}; | ||
|
||
const preventViteReload = (payload: any) => { | ||
// Changing the path prevents Vite from reloading | ||
payload.path = '/_fake/path.html'; | ||
}; | ||
|
||
let pendingNavigationTo: string | undefined = undefined; | ||
|
||
window.addEventListener('vaadin-router-go', (routerEvent: any) => { | ||
pendingNavigationTo = routerEvent.detail.pathname + routerEvent.detail.search; | ||
}); | ||
hot.on('vite:beforeFullReload', (payload: any) => { | ||
if (isLiveReloadDisabled()) { | ||
preventViteReload(payload); | ||
} | ||
if (pendingNavigationTo) { | ||
// Force reload with the new URL | ||
location.href = pendingNavigationTo; | ||
preventViteReload(payload); | ||
} | ||
}); | ||
} |
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,23 @@ | ||
<!DOCTYPE html> | ||
<!-- | ||
This file is auto-generated by Vaadin. | ||
--> | ||
|
||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1" /> | ||
<style> | ||
body, #outlet { | ||
height: 100vh; | ||
width: 100%; | ||
margin: 0; | ||
} | ||
</style> | ||
<!-- index.ts is included here automatically (either by the dev server or during the build) --> | ||
</head> | ||
<body> | ||
<!-- This outlet div is where the views are rendered --> | ||
<div id="outlet"></div> | ||
</body> | ||
</html> |
Oops, something went wrong.