File tree Expand file tree Collapse file tree 5 files changed +15
-8
lines changed
crates/tauri-cli/templates/plugin/__example-api/tauri-app Expand file tree Collapse file tree 5 files changed +15
-8
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ " tauri-cli " : " patch:bug"
3
+ " @tauri-apps/cli " : " patch:bug"
4
+ ---
5
+
6
+ Properly migrate svelte to v5 in the plugin example template
Original file line number Diff line number Diff line change 1
1
{
2
2
"compilerOptions" : {
3
- "moduleResolution" : " Node " ,
3
+ "moduleResolution" : " bundler " ,
4
4
"target" : " ESNext" ,
5
5
"module" : " ESNext" ,
6
6
/**
7
7
* svelte-preprocess cannot figure out whether you have
8
8
* a value or a type, so tell TypeScript to enforce using
9
9
* `import type` instead of `import` for Types.
10
10
*/
11
- "importsNotUsedAsValues " : " error " ,
11
+ "verbatimModuleSyntax " : true ,
12
12
"isolatedModules" : true ,
13
13
"resolveJsonModule" : true ,
14
14
/**
Original file line number Diff line number Diff line change 2
2
import Greet from ' ./lib/Greet.svelte'
3
3
import { ping } from ' tauri-plugin-{{ plugin_name }}-api'
4
4
5
- let response = ' '
5
+ let response = $state ( ' ' )
6
6
7
7
function updateResponse (returnValue ) {
8
8
response += ` [${ new Date ().toLocaleTimeString ()} ] ` + (typeof returnValue === ' string' ? returnValue : JSON .stringify (returnValue)) + ' <br>'
37
37
</div >
38
38
39
39
<div >
40
- <button on : click =" {_ping }" >Ping</button >
40
+ <button onclick =" {_ping }" >Ping</button >
41
41
<div >{@html response }</div >
42
42
</div >
43
43
Original file line number Diff line number Diff line change 1
1
<script >
2
2
import { invoke } from " @tauri-apps/api/core"
3
3
4
- let name = " " ;
5
- let greetMsg = " "
4
+ let name = $state ( " " ) ;
5
+ let greetMsg = $state ( " " )
6
6
7
7
async function greet (){
8
8
// Learn more about Tauri commands at https://v2.tauri.app/develop/calling-rust/#commands
13
13
<div >
14
14
<div class =" row" >
15
15
<input id ="greet-input" placeholder ="Enter a name..." bind:value ={name } />
16
- <button on:click ={greet }>
16
+ <button onclick ={greet }>
17
17
Greet
18
18
</button >
19
19
</div >
Original file line number Diff line number Diff line change 1
1
import "./style.css" ;
2
2
import App from "./App.svelte" ;
3
+ import { mount } from 'svelte' ;
3
4
4
- const app = new App ( {
5
+ const app = mount ( App , {
5
6
target : document . getElementById ( "app" ) ,
6
7
} ) ;
7
8
You can’t perform that action at this time.
0 commit comments