Skip to content

Commit c2ad4d2

Browse files
authored
refactor(api)!: Rename primitives mod to core (#8273)
1 parent 618b0d0 commit c2ad4d2

34 files changed

Lines changed: 45 additions & 40 deletions

File tree

.changes/api-primitives-core.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@tauri-apps/api': 'patch:breaking'
3+
---
4+
5+
Changed former `tauri` module from `primitives` to `core`.

core/tauri/scripts/bundle.global.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/api/src/App.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<script>
22
import { onMount } from 'svelte'
33
import { writable } from 'svelte/store'
4-
import { invoke } from '@tauri-apps/api/primitives'
4+
import { invoke } from '@tauri-apps/api/core'
55
66
import Welcome from './views/Welcome.svelte'
77
import Communication from './views/Communication.svelte'

examples/api/src/views/Communication.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<script>
22
import { listen, emit } from '@tauri-apps/api/event'
3-
import { invoke } from '@tauri-apps/api/primitives'
3+
import { invoke } from '@tauri-apps/api/core'
44
import { onMount, onDestroy } from 'svelte'
55
66
export let onMessage

examples/api/src/views/Welcome.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<script>
2-
import { invoke } from '@tauri-apps/api/primitives'
2+
import { invoke } from '@tauri-apps/api/core'
33
import { getName, getVersion, getTauriVersion } from '@tauri-apps/api/app'
44
55
let version = '1.0.0'

examples/commands/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ <h1>Tauri Commands</h1>
1515
function runCommand(commandName, args, optional) {
1616
const id = optional ? '#response-optional' : '#response'
1717
const result = document.querySelector(id)
18-
window.__TAURI__.primitives
18+
window.__TAURI__.core
1919
.invoke(commandName, args)
2020
.then((response) => {
2121
const val =

examples/isolation/dist/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ <h1>Hello, Tauri!</h1>
7171
const ping = document.querySelector("#ping")
7272
const pong = document.querySelector('#pong')
7373
ping.addEventListener("click", () => {
74-
window.__TAURI__.primitives.invoke("ping")
74+
window.__TAURI__.core.invoke("ping")
7575
.then(() => {
7676
pong.innerText = `ok: ${Date.now()}`
7777
})

examples/parent-window/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
const responseContainer = document.getElementById('response')
2626
function runCommand(commandName, args, optional) {
27-
window.__TAURI__.primitives
27+
window.__TAURI__.core
2828
.invoke(commandName, args)
2929
.then((response) => {
3030
responseContainer.innerText += `Ok(${response})\n\n`

examples/splashscreen/dist/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ <h1>This is the main window!</h1>
66
document.addEventListener('DOMContentLoaded', () => {
77
// we delay here just so we can see the splashscreen for a while
88
setTimeout(() => {
9-
window.__TAURI__.primitives.invoke('close_splashscreen')
9+
window.__TAURI__.core.invoke('close_splashscreen')
1010
}, 2000)
1111
})
1212
</script>

examples/streaming/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
<source type="video/mp4" />
2121
</video>
2222
<script>
23-
const { invoke, convertFileSrc } = window.__TAURI__.primitives
23+
const { invoke, convertFileSrc } = window.__TAURI__.core
2424
const video = document.getElementById('video_source')
2525
const source = document.createElement('source')
2626
invoke('video_uri').then(([scheme, path]) => {

0 commit comments

Comments
 (0)