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 11{
22 "compilerOptions" : {
3- "moduleResolution" : " Node " ,
3+ "moduleResolution" : " bundler " ,
44 "target" : " ESNext" ,
55 "module" : " ESNext" ,
66 /**
77 * svelte-preprocess cannot figure out whether you have
88 * a value or a type, so tell TypeScript to enforce using
99 * `import type` instead of `import` for Types.
1010 */
11- "importsNotUsedAsValues " : " error " ,
11+ "verbatimModuleSyntax " : true ,
1212 "isolatedModules" : true ,
1313 "resolveJsonModule" : true ,
1414 /**
Original file line number Diff line number Diff line change 22 import Greet from ' ./lib/Greet.svelte'
33 import { ping } from ' tauri-plugin-{{ plugin_name }}-api'
44
5- let response = ' '
5+ let response = $state ( ' ' )
66
77 function updateResponse (returnValue ) {
88 response += ` [${ new Date ().toLocaleTimeString ()} ] ` + (typeof returnValue === ' string' ? returnValue : JSON .stringify (returnValue)) + ' <br>'
3737 </div >
3838
3939 <div >
40- <button on : click =" {_ping }" >Ping</button >
40+ <button onclick =" {_ping }" >Ping</button >
4141 <div >{@html response }</div >
4242 </div >
4343
Original file line number Diff line number Diff line change 11<script >
22 import { invoke } from " @tauri-apps/api/core"
33
4- let name = " " ;
5- let greetMsg = " "
4+ let name = $state ( " " ) ;
5+ let greetMsg = $state ( " " )
66
77 async function greet (){
88 // Learn more about Tauri commands at https://v2.tauri.app/develop/calling-rust/#commands
1313<div >
1414 <div class =" row" >
1515 <input id ="greet-input" placeholder ="Enter a name..." bind:value ={name } />
16- <button on:click ={greet }>
16+ <button onclick ={greet }>
1717 Greet
1818 </button >
1919 </div >
Original file line number Diff line number Diff line change 11import "./style.css" ;
22import App from "./App.svelte" ;
3+ import { mount } from 'svelte' ;
34
4- const app = new App ( {
5+ const app = mount ( App , {
56 target : document . getElementById ( "app" ) ,
67} ) ;
78
You can’t perform that action at this time.
0 commit comments