{"id":316119,"date":"2021-01-09T15:00:56","date_gmt":"2021-01-09T15:00:56","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=316119"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=316119","title":{"rendered":"\u041a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u043c Svelte \u0432 \u0443\u043c\u0435. \u0427\u0430\u0441\u0442\u044c 1\/3"},"content":{"rendered":"\n<div class=\"post__text post__text_v2\" id=\"post-content-body\">\n<h3>\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435<\/h3>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0432\u0441\u043f\u043e\u043c\u043d\u0438\u043c \u043a\u0430\u043a \u043c\u044b \u043f\u0438\u0448\u0435\u043c \u0432\u0435\u0431-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0431\u0435\u0437 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u043e\u0432:<\/p>\n<p><strong>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u044d\u043b\u0435\u043c\u0435\u043d\u0442<\/strong><\/p>\n<pre><code class=\"javascript\">\/\/ \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u044d\u043b\u0435\u043c\u0435\u043d\u0442 h1 const h1 = document.createElement('h1'); h1.textContent = 'Hello World'; \/\/ ...\u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0435\u0433\u043e \u0432 body document.body.appendChild(h1);<\/code><\/pre>\n<p><strong>\u041e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u043c \u044d\u043b\u0435\u043c\u0435\u043d\u0442<\/strong><\/p>\n<pre><code class=\"javascript\">\/\/ \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u043c \u0442\u0435\u043a\u0441\u0442 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 h1 h1.textContent = 'Bye World';<\/code><\/pre>\n<p><strong>\u0423\u0434\u0430\u043b\u044f\u0435\u043c \u044d\u043b\u0435\u043c\u0435\u043d\u0442<\/strong><\/p>\n<pre><code class=\"javascript\">\/\/ \u043d\u0430\u043a\u043e\u043d\u0435\u0446, \u043c\u044b \u0443\u0434\u0430\u043b\u044f\u0435\u043c \u044d\u043b\u0435\u043c\u0435\u043d\u0442 h1 document.body.removeChild(h1);<\/code><\/pre>\n<p><strong>\u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0441\u0442\u0438\u043b\u0438 \u043a \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0443<\/strong><\/p>\n<pre><code class=\"javascript\">const h1 = document.createElement('h1'); h1.textContent = 'Hello World';  \/\/ \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043a\u043b\u0430\u0441\u0441 \u043a \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0443 h1 h1.setAttribute('class', 'abc');  \/\/ ...\u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0442\u0435\u0433 &lt;style&gt; \u0432 head const style = document.createElement('style'); style.textContent = '.abc { color: blue; }'; document.head.appendChild(style); document.body.appendChild(h1);<\/code><\/pre>\n<p><strong>\u0421\u043b\u0443\u0448\u0430\u0435\u043c \u0441\u043e\u0431\u044b\u0442\u0438\u044f click \u043d\u0430 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0435<\/strong><\/p>\n<pre><code class=\"javascript\">const button = document.createElement('button'); button.textContent = 'Click Me!';  \/\/ \u0441\u043b\u0443\u0448\u0430\u0435\u043c \u0441\u043e\u0431\u044b\u0442\u0438\u0435 click button.addEventListener('click', () =&gt; {   console.log('Hi!'); });  document.body.appendChild(button);<\/code><\/pre>\n<p>\u041d\u0430 \u0447\u0438\u0441\u0442\u043e\u043c JavaScript \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0447\u0442\u043e-\u0442\u043e \u043f\u043e\u0434\u043e\u0431\u043d\u043e\u0435.<\/p>\n<p>\u041e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u0446\u0435\u043b\u044c \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438 \u0432 \u0442\u043e\u043c \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u043a\u0430\u043a \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 Svelte \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u0435\u0442 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 Svelte \u0432 \u0431\u043b\u043e\u043a\u0438 \u043a\u043e\u0434\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u044f \u043f\u043e\u043a\u0430\u0437\u0430\u043b \u0432\u044b\u0448\u0435.<\/p>\n<h3>\u0421\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 Svelte<\/h3>\n<p>\u0414\u0430\u043b\u0435\u0435 \u044f \u043f\u043e\u043a\u0430\u0436\u0443 \u0431\u0430\u0437\u043e\u0432\u044b\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u044b Svelte \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441\u0430.<\/p>\n<blockquote>\n<p>\u0415\u0441\u043b\u0438 \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u0443\u0437\u043d\u0430\u0442\u044c \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435, \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c <a href=\"https:\/\/svelte.dev\/tutorial\/basics\" rel=\"noopener noreferrer nofollow\">\u0438\u043d\u0442\u0435\u0440\u0430\u043a\u0442\u0438\u0432\u043d\u044b\u0439 Svelte \u0442\u0443\u0442\u043e\u0440\u0438\u0430\u043b.<\/a><\/p>\n<\/blockquote>\n<p>\u0418\u0442\u0430\u043a, \u0432\u043e\u0442 \u043f\u0440\u043e\u0441\u0442\u0435\u0439\u0448\u0438\u0439 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 Svelte:<\/p>\n<pre><code class=\"xml\">&lt;h1&gt;Hello World&lt;\/h1&gt;<\/code><\/pre>\n<p><a href=\"https:\/\/svelte.dev\/repl\/99aeea705b1e48fe8610b3ccee948280\" rel=\"noopener noreferrer nofollow\"><strong>Svelte REPL<\/strong><\/a><\/p>\n<p>\u0414\u043b\u044f \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0441\u0442\u0438\u043b\u0435\u0439, \u043d\u0443\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0442\u0435\u0433 <code>&lt;style&gt;<\/code>:<\/p>\n<pre><code class=\"xml\">&lt;style&gt;   h1 {     color: rebeccapurple;   } &lt;\/style&gt;  &lt;h1&gt;Hello World&lt;\/h1&gt;<\/code><\/pre>\n<p><a href=\"https:\/\/svelte.dev\/repl\/cf54441399864c0f9b0cb25710a5fe9b\" rel=\"noopener noreferrer nofollow\"><strong>Svelte REPL<\/strong><\/a><\/p>\n<p>\u041d\u0430 \u044d\u0442\u043e\u043c \u044d\u0442\u0430\u043f\u0435 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0435 Svelte \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430 \u043e\u0449\u0443\u0449\u0430\u0435\u0442\u0441\u044f \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e \u0442\u043e\u043c\u0443 \u043a\u0430\u043a \u043c\u044b \u043f\u0438\u0448\u0435\u043c \u043e\u0431\u044b\u0447\u043d\u044b\u0439 HTML, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 Svelte \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u0430\u0434\u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e\u043c HTML \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441\u0430.<\/p>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a\u0430\u043a \u043c\u044b \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u043d\u0430\u0448 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442:<\/p>\n<pre><code class=\"xml\">&lt;script&gt;   let name = 'World'; &lt;\/script&gt;  &lt;h1&gt;Hello {name}&lt;\/h1&gt;<\/code><\/pre>\n<p><a href=\"https:\/\/svelte.dev\/repl\/c149ca960b0444948dc0c00a9175bcb3\" rel=\"noopener noreferrer nofollow\"><strong>Svelte REPL<\/strong><\/a><\/p>\n<p>\u041c\u044b \u043f\u043e\u043c\u0435\u0449\u0430\u0435\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e JavaScript \u0432 \u0444\u0438\u0433\u0443\u0440\u043d\u044b\u0435 \u0441\u043a\u043e\u0431\u043a\u0438.<\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u043a\u043b\u0438\u043a\u0430, \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0434\u0438\u0440\u0435\u043a\u0442\u0438\u0432\u0443 <code>on:<\/code><\/p>\n<pre><code class=\"xml\">&lt;script&gt;   let count = 0;   function onClickButton(event) {     console.log(count);   } &lt;\/script&gt;  &lt;button on:click={onClickButton}&gt;Clicked {count}&lt;\/button&gt;<\/code><\/pre>\n<p><a href=\"https:\/\/svelte.dev\/repl\/1da1dcaf51814ed09d2341ea7915f0a1\" rel=\"noopener noreferrer nofollow\"><strong>Svelte REPL<\/strong><\/a><\/p>\n<p>\u0414\u043b\u044f \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445 \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c <a href=\"https:\/\/www.w3schools.com\/js\/js_assignment.asp\" rel=\"noopener noreferrer nofollow\">\u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u044b \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u043d\u0438\u044f<\/a>:<\/p>\n<pre><code class=\"xml\">&lt;script&gt;   let count = 0;   function onClickButton(event) {     count += 1;   } &lt;\/script&gt;  &lt;button on:click={onClickButton}&gt;Clicked {count}&lt;\/button&gt;<\/code><\/pre>\n<p><a href=\"https:\/\/svelte.dev\/repl\/7bff4b7746df4007a51155d2006ce724\" rel=\"noopener noreferrer nofollow\"><strong>Svelte REPL<\/strong><\/a><\/p>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043a\u0430\u043a \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 Svelte \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0432 JavaScript, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u044b \u0432\u0438\u0434\u0435\u043b\u0438 \u0440\u0430\u043d\u0435\u0435.<\/p>\n<h3>\u041a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u043c Svelte \u0432 \u0443\u043c\u0435<\/h3>\n<p>\u041a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 Svelte \u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u0442 \u043a\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u044b \u043f\u0438\u0448\u0435\u0442\u0435 \u0438 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 JavaScript.<\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u043f\u043e\u043d\u044f\u0442\u044c, \u043a\u0430\u043a Svelte \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u0442 \u043a\u043e\u0434, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043d\u0430\u0447\u043d\u0435\u043c \u0441 \u043d\u0430\u0438\u043c\u0435\u043d\u044c\u0448\u0435\u0433\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0433\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u0438 \u043f\u043e\u0441\u0442\u0435\u043f\u0435\u043d\u043d\u043e \u0431\u0443\u0434\u0435\u043c \u0443\u0441\u043b\u043e\u0436\u043d\u044f\u0442\u044c \u0435\u0433\u043e. \u0412 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0432\u044b \u0443\u0432\u0438\u0434\u0438\u0442\u0435, \u0447\u0442\u043e \u0438\u043c\u0435\u043d\u043d\u043e Svelte \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 \u043a \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u043c\u0443 \u043a\u043e\u0434\u0443 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u043d\u0430\u0448\u0438\u0445 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439.<\/p>\n<p>\u041f\u0435\u0440\u0432\u044b\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u044b \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c:<\/p>\n<pre><code class=\"xml\">&lt;h1&gt;Hello World&lt;\/h1&gt;<\/code><\/pre>\n<p><a href=\"https:\/\/svelte.dev\/repl\/99aeea705b1e48fe8610b3ccee948280?version=3.19.1\" rel=\"noopener noreferrer nofollow\"><strong>Svelte REPL<\/strong><\/a><\/p>\n<p>\u041a\u043e\u0434 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f \u043d\u0430 \u0432\u044b\u0445\u043e\u0434\u0435:<\/p>\n<pre><code class=\"javascript\">function create_fragment(ctx) {   let h1;    return {     c() {       h1 = element('h1');       h1.textContent = 'Hello world';     },     m(target, anchor) {       insert(target, h1, anchor);     },     d(detaching) {       if (detaching) detach(h1);     },   }; }  export default class App extends SvelteComponent {   constructor(options) {     super();     init(this, options, null, create_fragment, safe_not_equal, {});   } }<\/code><\/pre>\n<p>\u041c\u044b \u043c\u043e\u0436\u0435\u043c \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u0434 \u043d\u0430 2 \u0447\u0430\u0441\u0442\u0438:<\/p>\n<ul>\n<li>\n<p><code>create_fragment<\/code><\/p>\n<\/li>\n<li>\n<p><code>class App extends SvelteComponent<\/code><\/p>\n<\/li>\n<\/ul>\n<h3>create_fragment<\/h3>\n<p>\u041a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b Svelte &#8212; \u044d\u0442\u043e \u0441\u0442\u0440\u043e\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0431\u043b\u043e\u043a\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f Svelte. \u041a\u0430\u0436\u0434\u044b\u0439 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 Svelte \u0444\u043e\u043a\u0443\u0441\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043d\u0430 \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0438 \u0441\u0432\u043e\u0435\u0439 \u0447\u0430\u0441\u0442\u0438 \u0438\u043b\u0438 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0435 \u0444\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u0433\u043e DOM \u0434\u0435\u0440\u0435\u0432\u0430.<\/p>\n<p>\u0424\u0443\u043d\u043a\u0446\u0438\u044f <code>create_fragment<\/code> \u0434\u0430\u0435\u0442 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0443 Svelte \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u043e \u043f\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044e \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0430 DOM \u0434\u0435\u0440\u0435\u0432\u0430.<\/p>\n<p>\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435 \u043d\u0430 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u044b\u0439 \u043e\u0431\u044a\u0435\u043a\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <code>create_fragment<\/code>. \u0412 \u043d\u0435\u043c \u0435\u0441\u0442\u044c \u0442\u0430\u043a\u0438\u0435 \u043c\u0435\u0442\u043e\u0434\u044b, \u043a\u0430\u043a:<\/p>\n<ul>\n<li>\n<p><code>c()<\/code><\/p>\n<\/li>\n<\/ul>\n<p>\u0421\u043e\u043a\u0440\u0430\u0449\u0435\u043d\u043d\u043e \u043e\u0442 create. \u0421\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u043f\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044e \u0432\u0441\u0435\u0445 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0432\u043e \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0435.<\/p>\n<p>\u0412 \u044d\u0442\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043c\u0435\u0442\u043e\u0434 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u043f\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 <code>h1<\/code>:<\/p>\n<pre><code class=\"javascript\">h1 = element('h1'); h1.textContent = 'Hello World';<\/code><\/pre>\n<ul>\n<li>\n<p><code>m(target, anchor)<\/code><\/p>\n<\/li>\n<\/ul>\n<p>\u0421\u043e\u043a\u0440\u0430\u0449\u0435\u043d\u043d\u043e \u043e\u0442 mount. \u0421\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u0434\u043b\u044f \u0432\u0441\u0442\u0430\u0432\u043a\u0438 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0432 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u0443\u044e \u0446\u0435\u043b\u044c.<\/p>\n<p>\u0412 \u044d\u0442\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043c\u0435\u0442\u043e\u0434 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u043f\u043e \u0432\u0441\u0442\u0430\u0432\u043a\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 <code>h1<\/code> \u0432 <code>target<\/code>:<\/p>\n<pre><code class=\"javascript\">insert(target, h1, anchor);  \/\/ http:\/\/github.com\/sveltejs\/svelte\/tree\/master\/src\/runtime\/internal\/dom.ts export function insert(target, node, anchor) {   target.insertBefore(node, anchor || null); }<\/code><\/pre>\n<ul>\n<li>\n<p><code>d(detaching)<\/code><\/p>\n<\/li>\n<\/ul>\n<p>\u0421\u043e\u043a\u0440\u0430\u0449\u0435\u043d\u043d\u043e \u043e\u0442 destroy. \u0421\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u043f\u043e \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u044e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0438\u0437 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0439 \u0446\u0435\u043b\u0438.<\/p>\n<p>\u0412 \u044d\u0442\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043c\u044b \u0443\u0434\u0430\u043b\u044f\u0435\u043c \u044d\u043b\u0435\u043c\u0435\u043d\u0442 <code>h1<\/code> \u0438\u0437 DOM \u0434\u0435\u0440\u0435\u0432\u0430:<\/p>\n<pre><code class=\"javascript\">detach(h1);  \/\/ http:\/\/github.com\/sveltejs\/svelte\/tree\/master\/src\/runtime\/internal\/dom.ts function detach(node) {   node.parentNode.removeChild(node); }<\/code><\/pre>\n<p>\u0418\u043c\u0435\u043d\u0430 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0441\u043e\u043a\u0440\u0430\u0449\u0435\u043d\u044b \u0434\u043b\u044f \u043b\u0443\u0447\u0448\u0435\u0439 \u043c\u0438\u043d\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438. \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435, \u0447\u0442\u043e <a href=\"https:\/\/alistapart.com\/article\/javascript-minification-part-ii\/#section3\" rel=\"noopener noreferrer nofollow\">\u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043c\u0438\u043d\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e.<\/a><\/p>\n<h3>export default class App extends SvelteComponent<\/h3>\n<p>\u041a\u0430\u0436\u0434\u044b\u0439 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 &#8212; \u044d\u0442\u043e \u043a\u043b\u0430\u0441\u0441, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 \u0447\u0435\u0440\u0435\u0437 <a href=\"https:\/\/svelte.dev\/docs#Client-side_component_API\" rel=\"noopener noreferrer nofollow\">\u044d\u0442\u043e\u0442 API<\/a>.<\/p>\n<p>\u0412 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0435 \u043c\u044b \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u043c \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 \u0441 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0435\u0439 \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043e\u043d \u0441\u043e\u0441\u0442\u043e\u0438\u0442, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 create_fragment. Svelte \u0431\u0443\u0434\u0435\u0442 \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u0438 \u0443\u0434\u0430\u043b\u044f\u0442\u044c \u0435\u0435 \u0432\u0441\u044f\u043a\u0438\u0439 \u0440\u0430\u0437, \u043a\u043e\u0433\u0434\u0430 \u0432 \u043d\u0435\u0439 \u043d\u0435\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438.<\/p>\n<p>\u041f\u043e\u043f\u0440\u043e\u0431\u0443\u0439\u0442\u0435 \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u0442\u0435\u0433 <code>&lt;h1&gt;<\/code> \u0438 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435, \u0447\u0442\u043e \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0434\u0435\u0442 \u0441 \u0432\u044b\u0432\u043e\u0434\u043e\u043c:<\/p>\n<pre><code class=\"xml\">&lt;!-- empty --&gt;<\/code><\/pre>\n<p><a href=\"https:\/\/svelte.dev\/repl\/1f29ce52adf446fc9116bb957b7200ec?version=3.19.1\" rel=\"noopener noreferrer nofollow\"><strong>Svelte REPL<\/strong><\/a><\/p>\n<pre><code class=\"javascript\">class App extends SvelteComponent {   constructor(options) {     super();     init(this, options, null, null, safe_not_equal, {});   } }<\/code><\/pre>\n<p>Svelte \u043f\u0435\u0440\u0435\u0434\u0430\u0441\u0442 <code>null<\/code> \u0432\u043c\u0435\u0441\u0442\u043e <code>create_fragment<\/code>!<\/p>\n<p>\u0424\u0443\u043d\u043a\u0446\u0438\u044f init &#8212; \u044d\u0442\u043e \u0442\u043e \u043c\u0435\u0441\u0442\u043e, \u0433\u0434\u0435 Svelte \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u0442 \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u043e \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0445 \u0447\u0430\u0441\u0442\u0435\u0439, \u0442\u0430\u043a\u0438\u0445 \u043a\u0430\u043a:<\/p>\n<ul>\n<li>\n<p>\u0432\u0445\u043e\u0434\u043d\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430, <code>ctx<\/code> \u0438 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442<\/p>\n<\/li>\n<li>\n<p>\u0441\u043e\u0431\u044b\u0442\u0438\u044f \u0436\u0438\u0437\u043d\u0435\u043d\u043d\u043e\u0433\u043e \u0446\u0438\u043a\u043b\u0430<\/p>\n<\/li>\n<li>\n<p>\u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430<\/p>\n<\/li>\n<\/ul>\n<p>\u0432 \u0441\u0430\u043c\u043e\u043c \u043a\u043e\u043d\u0446\u0435 Svelte \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 <code>create_fragment<\/code> \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0438 \u043c\u043e\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0432 DOM.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u0432\u044b \u0437\u0430\u043c\u0435\u0442\u0438\u043b\u0438, \u0432\u0441\u0435 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u0438 \u043c\u0435\u0442\u043e\u0434\u044b \u043f\u0440\u0438\u0432\u044f\u0437\u0430\u043d\u044b \u043a <code>this.$$<\/code>.<\/p>\n<p>\u041f\u043e\u044d\u0442\u043e\u043c\u0443, \u0435\u0441\u043b\u0438 \u0432\u044b \u043e\u0431\u0440\u0430\u0449\u0430\u0435\u0442\u0435\u0441\u044c \u043a \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0443 <code>$$<\/code> \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430, \u0432\u044b \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0435\u0441\u044c \u043a \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u043c \u0447\u0430\u0441\u0442\u044f\u043c \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430. \u0412\u044b \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u044b!<\/p>\n<h3>\u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445<\/h3>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043a\u043e\u0433\u0434\u0430 \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043b\u0438 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 Svelte \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043a\u0430\u043a \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u0437\u043c\u0435\u043d\u0438\u0442 \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u0434:<\/p>\n<pre><code class=\"xml\">&lt;script&gt; \tlet name = 'World'; &lt;\/script&gt;  &lt;h1&gt;Hello {name}&lt;\/h1&gt;<\/code><\/pre>\n<p><a href=\"https:\/\/svelte.dev\/repl\/c149ca960b0444948dc0c00a9175bcb3?version=3.19.1\" rel=\"noopener noreferrer nofollow\"><strong>Svelte REPL<\/strong><\/a><\/p>\n<p>\u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0432\u044b\u0432\u043e\u0434\u0430:<\/p>\n<pre><code class=\"javascript\">function create_fragment(ctx) {   \/\/ ...   return {     c() {       h1 = element('h1');       h1.textContent = `Hello ${name}`;},     \/\/ ...   }; } let name = 'World';  class App extends SvelteComponent {   \/\/ ... }<\/code><\/pre>\n<p>\u041d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0430\u0431\u043b\u044e\u0434\u0435\u043d\u0438\u044f:<\/p>\n<ul>\n<li>\n<p>\u0442\u043e, \u0447\u0442\u043e \u043c\u044b \u043d\u0430\u043f\u0438\u0441\u0430\u043b\u0438 \u0432 \u0442\u0435\u0433\u0435 <code>&lt;script&gt;<\/code>, \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u0432\u0435\u0440\u0445\u043d\u0438\u0439 \u0443\u0440\u043e\u0432\u0435\u043d\u044c \u043a\u043e\u0434\u0430<\/p>\n<\/li>\n<li>\n<p>\u0442\u0435\u043a\u0441\u0442\u043e\u0432\u043e\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 <code>h1<\/code> \u0442\u0435\u043f\u0435\u0440\u044c \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0448\u0430\u0431\u043b\u043e\u043d\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u043e\u0439<\/p>\n<\/li>\n<\/ul>\n<p>\u041f\u0440\u044f\u043c\u043e \u0441\u0435\u0439\u0447\u0430\u0441 \u043f\u043e\u0434 \u043a\u0430\u043f\u043e\u0442\u043e\u043c \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043c\u043d\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0445 \u0432\u0435\u0449\u0435\u0439, \u043d\u043e \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u043e\u0434\u043e\u0436\u0434\u0435\u043c, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u044d\u0442\u043e \u043b\u0443\u0447\u0448\u0435 \u0432\u0441\u0435\u0433\u043e \u043e\u0431\u044a\u044f\u0441\u043d\u044f\u0435\u0442\u0441\u044f \u043f\u0440\u0438 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0438 \u0441\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435\u043c \u043a\u043e\u0434\u0430.<\/p>\n<h3>\u041e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445<\/h3>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0434\u043b\u044f \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0438\u043c\u0435\u043d\u0438:<\/p>\n<pre><code class=\"xml\">&lt;script&gt; \tlet name = 'World'; \tfunction update() { \t\tname = 'Svelte'; \t} &lt;\/script&gt;  &lt;h1&gt;Hello {name}&lt;\/h1&gt;<\/code><\/pre>\n<p><a href=\"https:\/\/svelte.dev\/repl\/3841485f4d224774ba42617e4e964968?version=3.19.1\" rel=\"noopener noreferrer nofollow\"><strong>Svelte REPL<\/strong><\/a><\/p>\n<p>\u2026 \u0438 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430:<\/p>\n<pre><code class=\"javascript\">function create_fragment(ctx) {   return {     c() {       h1 = element('h1');       t0 = text('Hello ');       t1 = text(\/*name*\/ ctx[0]);     },     m(target, anchor) {       insert(target, h1, anchor);       append(h1, t0);       append(h1, t1);     },     p(ctx, [dirty]) {       if (dirty &amp; \/*name*\/ 1) set_data(t1, \/*name*\/ ctx[0]);     },     d(detaching) {       if (detaching) detach(h1);     },   }; }  function instance($$self, $$props, $$invalidate) {   let name = 'World';    function update() {     $$invalidate(0, (name = 'Svelte'));   }    return [name]; }  export default class App extends SvelteComponent {   constructor(options) {     super();     init(this, options, instance, create_fragment, safe_not_equal, {});   } }<\/code><\/pre>\n<p>\u041d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0430\u0431\u043b\u044e\u0434\u0435\u043d\u0438\u044f:<\/p>\n<ul>\n<li>\n<p>\u0442\u0435\u043a\u0441\u0442\u043e\u0432\u043e\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 <code>&lt;h1&gt;<\/code> \u0442\u0435\u043f\u0435\u0440\u044c \u0440\u0430\u0437\u0431\u0438\u0442\u043e \u043d\u0430 2 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u0445 \u0443\u0437\u043b\u0430, \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439 <code>text (...)<\/code><\/p>\n<\/li>\n<li>\n<p>\u043e\u0431\u044a\u0435\u043a\u0442 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u044b\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439 <code>create_fragment<\/code> \u043f\u043e\u043b\u0443\u0447\u0438\u043b \u043d\u043e\u0432\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 <code>p(ctx, dirty)<\/code><\/p>\n<\/li>\n<li>\n<p>\u043f\u043e\u044f\u0432\u0438\u043b\u0430\u0441\u044c \u043d\u043e\u0432\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f <code>instance<\/code><\/p>\n<\/li>\n<li>\n<p>\u0442\u043e \u0447\u0442\u043e \u043c\u044b \u043d\u0430\u043f\u0438\u0441\u0430\u043b\u0438 \u0432 \u0442\u0435\u0433\u0435 <code>script<\/code> \u0431\u044b\u043b\u043e \u043f\u0435\u0440\u0435\u043d\u0435\u0441\u0435\u043d\u043e \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u044e <code>instance<\/code><\/p>\n<\/li>\n<li>\n<p>\u0438\u043c\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u043e\u0441\u044c \u0432 <code>create_fragment<\/code>, \u0442\u0435\u043f\u0435\u0440\u044c \u0437\u0430\u043c\u0435\u043d\u0435\u043d\u043e \u043d\u0430 <code>ctx[0]<\/code><\/p>\n<\/li>\n<\/ul>\n<p>\u041f\u043e\u0447\u0435\u043c\u0443 \u043f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u0438 \u0442\u0430\u043a\u0438\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f?<\/p>\n<p>\u041a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 Svelte \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u0435\u0442 \u0432\u0441\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435, \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u043d\u044b\u0435 \u0432 \u0442\u0435\u0433\u0435 <code>&lt;script&gt;<\/code>.<\/p>\n<p>\u041e\u043d \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u0435\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0444\u0430\u043a\u0442\u043e\u0440\u044b \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439:<\/p>\n<ul>\n<li>\n<p>\u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0430? \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440: <code>count++<\/code><\/p>\n<\/li>\n<li>\n<p>\u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043f\u0435\u0440\u0435\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0430? \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440: <code>name = 'Svelte'<\/code><\/p>\n<\/li>\n<li>\n<p>\u043d\u0430 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u0441\u0441\u044b\u043b\u0430\u044e\u0442\u0441\u044f \u0432 \u0448\u0430\u0431\u043b\u043e\u043d\u0435? \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 <code>&lt;h1&gt;Hello {name}&lt;\/h1&gt;<\/code><\/p>\n<\/li>\n<li>\n<p>\u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0430 \u0434\u043b\u044f \u0437\u0430\u043f\u0438\u0441\u0438? \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 <code>const i = 1;<\/code> \u0438\u043b\u0438 <code>let i = 1;<\/code><\/p>\n<\/li>\n<li>\n<p>&#8230; \u0438 \u043c\u043d\u043e\u0433\u043e\u0435 \u0434\u0440\u0443\u0433\u043e\u0435<\/p>\n<\/li>\n<\/ul>\n<p>\u041a\u043e\u0433\u0434\u0430 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 Svelte \u043f\u043e\u043d\u0438\u043c\u0430\u0435\u0442, \u0447\u0442\u043e \u0438\u043c\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u043c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u043d\u0430\u0437\u043d\u0430\u0447\u0438\u0442\u044c (\u0438\u0437-\u0437\u0430 <code>name = 'Svelte';<\/code> \u043f\u0440\u0438 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0438), \u043e\u043d \u0440\u0430\u0437\u0431\u0438\u0432\u0430\u0435\u0442 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u043e\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 <code>h1<\/code> \u043d\u0430 \u0447\u0430\u0441\u0442\u0438, \u0447\u0442\u043e\u0431\u044b \u043e\u043d \u043c\u043e\u0433 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0442\u044c \u0447\u0430\u0441\u0442\u044c \u0442\u0435\u043a\u0441\u0442\u0430.<\/p>\n<p>\u0418 \u0432 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435, \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0432\u0438\u0434\u0435\u0442\u044c, \u0447\u0442\u043e \u0435\u0441\u0442\u044c \u043d\u043e\u0432\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 <code>p<\/code> \u0434\u043b\u044f \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u043e\u0433\u043e \u0443\u0437\u043b\u0430.<\/p>\n<ul>\n<li>\n<p><code>p(ctx, dirty)<\/code><\/p>\n<\/li>\n<\/ul>\n<p>\u0421\u043e\u043a\u0440\u0430\u0449\u0435\u043d\u043d\u043e \u043e\u0442 <code>u_p_date<\/code><\/p>\n<p><code>p(ctx, dirty)<\/code> \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u043f\u043e \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u043b\u043e\u0441\u044c \u0432 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0438 (<code>dirty<\/code>) \u0438 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0438 (<code>ctx<\/code>) \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430.<\/p>\n<h3>\u0424\u0443\u043d\u043a\u0446\u0438\u044f instance<\/h3>\n<p>\u041a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u043f\u043e\u043d\u0438\u043c\u0430\u0435\u0442, \u0447\u0442\u043e \u0438\u043c\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0432 \u0440\u0430\u0437\u043d\u044b\u0445 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u0430\u0445 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430 <code>App<\/code>.<\/p>\n<p>\u0412\u043e\u0442 \u043f\u043e\u0447\u0435\u043c\u0443 \u043e\u043d \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0430\u0435\u0442 \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u0435 \u0438\u043c\u0435\u043d\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0441 \u0438\u043c\u0435\u043d\u0435\u043c <code>instance<\/code>.<\/p>\n<p>\u0412 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435, \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e \u043e\u0442 \u0442\u043e\u0433\u043e, \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u043e\u0432 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430 <code>App<\/code>, \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0438\u043c\u0435\u043d\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u043e \u0438 \u043d\u0435 \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u0432\u043e \u0432\u0441\u0435\u0445 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u0430\u0445:<\/p>\n<pre><code class=\"xml\">&lt;App \/&gt; &lt;App \/&gt; &lt;App \/&gt;  &lt;!-- \u0432\u044b\u0432\u0435\u0434\u0435\u0442 --&gt; &lt;h1&gt;Hello world&lt;\/h1&gt; &lt;h1&gt;Hello world&lt;\/h1&gt; &lt;h1&gt;Hello world&lt;\/h1&gt;<\/code><\/pre>\n<p>\u041d\u043e \u0432 \u044d\u0442\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e <code>name<\/code> \u043c\u043e\u0436\u043d\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0432 \u043f\u0440\u0435\u0434\u0435\u043b\u0430\u0445 1 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u0430 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u0435 \u044d\u0442\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u0442\u0435\u043f\u0435\u0440\u044c \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0435\u043d\u043e \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u044e <code>instance<\/code>:<\/p>\n<pre><code class=\"xml\">&lt;App \/&gt; &lt;App \/&gt; &lt;App \/&gt;  &lt;!-- \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c --&gt; &lt;h1&gt;Hello world&lt;\/h1&gt; &lt;h1&gt;Hello Svelte&lt;\/h1&gt; &lt;h1&gt;Hello world&lt;\/h1&gt; &lt;!-- \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0435\u0433\u043e \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430 --&gt;<\/code><\/pre>\n<h3>instance($$self, $$props, $$invalidate)<\/h3>\n<p>\u0424\u0443\u043d\u043a\u0446\u0438\u044f instance \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0441\u043f\u0438\u0441\u043e\u043a \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430:<\/p>\n<ul>\n<li>\n<p>\u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u0441\u044b\u043b\u0430\u044e\u0442\u0441\u044f \u0432 \u0448\u0430\u0431\u043b\u043e\u043d\u0435<\/p>\n<\/li>\n<li>\n<p>\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u044b \u0438\u043b\u0438 \u043f\u0435\u0440\u0435\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u044b \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u0430 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430<\/p>\n<\/li>\n<\/ul>\n<p>\u0412 Svelte \u043c\u044b \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u044d\u0442\u043e\u0442 \u0441\u043f\u0438\u0441\u043e\u043a \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 <code>ctx<\/code>.<\/p>\n<p>\u0412 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <code>init<\/code> Svelte \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u044e <code>instance<\/code> \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f <code>ctx<\/code> \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0435\u0433\u043e \u043f\u0440\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0430 \u0434\u043b\u044f \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430:<\/p>\n<pre><code class=\"javascript\">\/\/ \u043a\u043e\u043d\u0446\u0435\u043f\u0442\u0443\u0430\u043b\u044c\u043d\u043e, const ctx = instance(\/*...*\/); const fragment = create_fragment(ctx);  \/\/ \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442 fragment.c();  \/\/ \u043c\u043e\u043d\u0442\u0438\u0440\u0443\u0435\u043c \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442 \u0432 DOM \u0434\u0435\u0440\u0435\u0432\u043e fragment.m(target);<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0432\u043c\u0435\u0441\u0442\u043e \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 <code>name<\/code> \u0432\u043d\u0435 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430 \u043c\u044b \u0441\u0441\u044b\u043b\u0430\u0435\u043c\u0441\u044f \u043d\u0430 <code>name<\/code>, \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u043d\u0443\u044e \u0447\u0435\u0440\u0435\u0437 <code>ctx<\/code>:<\/p>\n<pre><code class=\"javascript\">t1 = text(\/* name *\/ ctx[0]);<\/code><\/pre>\n<p>\u041f\u0440\u0438\u0447\u0438\u043d\u0430, \u043f\u043e \u043a\u043e\u0442\u043e\u0440\u043e\u0439 <code>ctx<\/code> \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043c\u0430\u0441\u0441\u0438\u0432\u043e\u043c, \u0430 \u043d\u0435 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0435\u0439 <code>Map<\/code> \u0438\u043b\u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u043c, \u0441\u0432\u044f\u0437\u0430\u043d\u0430 \u0441 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0435\u0439. \u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u043e\u0431\u0441\u0443\u0436\u0434\u0435\u043d\u0438\u0435 \u044d\u0442\u043e\u0433\u043e <a href=\"https:\/\/github.com\/sveltejs\/svelte\/issues\/1922\" rel=\"noopener noreferrer nofollow\">\u0437\u0434\u0435\u0441\u044c<\/a>.<\/p>\n<h3>$$invalidate<\/h3>\n<p>\u0421\u0435\u043a\u0440\u0435\u0442 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0440\u0435\u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u0438 \u0432 Svelte &#8212; \u043a\u0440\u043e\u0435\u0442\u0441\u044f \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <code>$$invalidate<\/code>.<\/p>\n<p>\u0414\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u044b\u043b\u0430<\/p>\n<ul>\n<li>\n<p>\u043f\u0435\u0440\u0435\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0430 \u0438\u043b\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0430<\/p>\n<\/li>\n<li>\n<p>\u0443\u043f\u043e\u043c\u044f\u043d\u0443\u0442\u0430 \u0432 \u0448\u0430\u0431\u043b\u043e\u043d\u0435<\/p>\n<\/li>\n<\/ul>\n<p>\u0431\u0443\u0434\u0435\u0442 \u0432\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f <code>$$invalidate<\/code> \u0441\u0440\u0430\u0437\u0443 \u043f\u043e\u0441\u043b\u0435 \u043f\u0440\u0438\u0441\u0432\u043e\u0435\u043d\u0438\u044f \u0438\u043b\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f:<\/p>\n<pre><code class=\"javascript\">name = 'Svelte'; count++; foo.a = 1;  \/\/ \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0432 \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a\u043e\u0439 \u043a\u043e\u0434 name = 'Svelte'; $$invalidate(\/* name *\/, name); count++; $$invalidate(\/* count *\/, count); foo.a = 1; $$invalidate(\/* foo *\/, foo);<\/code><\/pre>\n<p>\u0424\u0443\u043d\u043a\u0446\u0438\u044f <code>$$invalidate<\/code> \u043e\u0442\u043c\u0435\u0447\u0430\u0435\u0442 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u043a\u0430\u043a \u0433\u0440\u044f\u0437\u043d\u0443\u044e \u0438 \u043f\u043b\u0430\u043d\u0438\u0440\u0443\u0435\u0442 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430:<\/p>\n<pre><code class=\"javascript\">\/\/ \u043a\u043e\u043d\u0446\u0435\u043f\u0442\u0443\u0430\u043b\u044c\u043d\u043e... const ctx = instance(\/*...*\/); const fragment = create_fragment(ctx);  \/\/ \u0447\u0442\u043e\u0431\u044b \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u0442\u044c, \u043a\u0430\u043a\u0430\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f \u0438\u0437\u043c\u0435\u043d\u0438\u043b\u0430\u0441\u044c const dirty = new Set(); const $$invalidate = (variable, newValue) =&gt; {   \/\/ \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u043c ctx   ctx[variable] = newValue;    \/\/ \u043f\u043e\u043c\u0435\u0447\u0430\u0435\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u043a\u0430\u043a \u0433\u0440\u044f\u0437\u043d\u0443\u044e   dirty.add(variable);    \/\/ \u043f\u043b\u0430\u043d\u0438\u0440\u0443\u0435\u043c \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430   scheduleUpdate(component); };  \/\/ \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f, \u043a\u043e\u0433\u0434\u0430 \u0437\u0430\u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u043e \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 function flushUpdate() {   \/\/ \u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442   fragment.p(ctx, dirty);    \/\/ \u043e\u0447\u0438\u0441\u0442\u0438\u0442\u044c \u0441\u043f\u0438\u0441\u043e\u043a \u043f\u043e\u043c\u0435\u0447\u0435\u043d\u043d\u044b\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445   dirty.clear(); }<\/code><\/pre>\n<h3>\u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0441\u043b\u0443\u0448\u0430\u0442\u0435\u043b\u0438 \u0441\u043e\u0431\u044b\u0442\u0438\u0439<\/h3>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0441\u043b\u0443\u0448\u0430\u0442\u0435\u043b\u044f \u0441\u043e\u0431\u044b\u0442\u0438\u0439<\/p>\n<pre><code class=\"xml\">&lt;script&gt; \tlet name = 'world'; \tfunction update() { \t\tname = 'Svelte'; \t} &lt;\/script&gt;  &lt;h1 on:click={update}&gt;Hello {name}&lt;\/h1&gt;<\/code><\/pre>\n<p><a href=\"https:\/\/svelte.dev\/repl\/5b12ff52c2874f4dbb6405d9133b34da?version=3.19.1\" rel=\"noopener noreferrer nofollow\"><strong>Svelte REPL<\/strong><\/a><\/p>\n<p>\u0418 \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u0440\u0430\u0437\u043d\u0438\u0446\u0443:<\/p>\n<pre><code class=\"javascript\">function create_fragment(ctx) {   \/\/ ...   return {     c() {       h1 = element('h1');       t0 = text('Hello ');       t1 = text(\/*name*\/ ctx[0]);     },     m(target, anchor) {       insert(target, h1, anchor);       append(h1, t0);       append(h1, t1);       dispose = listen(h1, 'click', \/*update*\/ ctx[1]);},     p(ctx, [dirty]) {       if (dirty &amp; \/*name*\/ 1) set_data(t1, \/*name*\/ ctx[0]);     },     d(detaching) {       if (detaching) detach(h1);       dispose();},   }; }  function instance($$self, $$props, $$invalidate) {   let name = 'world';    function update() {     $$invalidate(0, (name = 'Svelte'));   }   return [name, update];} \/\/ ...<\/code><\/pre>\n<p>\u041d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0430\u0431\u043b\u044e\u0434\u0435\u043d\u0438\u044f:<\/p>\n<ul>\n<li>\n<p>\u0444\u0443\u043d\u043a\u0446\u0438\u044f <code>instance<\/code> \u0442\u0435\u043f\u0435\u0440\u044c \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 2 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0432\u043c\u0435\u0441\u0442\u043e \u043e\u0434\u043d\u043e\u0439<\/p>\n<\/li>\n<li>\n<p>\u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d \u0432\u044b\u0437\u043e\u0432 <code>listen<\/code> \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <code>mount<\/code> \u0438 <code>dispose<\/code> \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <code>destroy<\/code><\/p>\n<\/li>\n<\/ul>\n<p>\u041a\u0430\u043a \u044f \u0443\u043f\u043e\u043c\u0438\u043d\u0430\u043b \u0440\u0430\u043d\u0435\u0435, \u0444\u0443\u043d\u043a\u0446\u0438\u044f <code>instance<\/code> \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0435\u0441\u0442\u044c \u0441\u0441\u044b\u043b\u043a\u0430 \u0432 \u0448\u0430\u0431\u043b\u043e\u043d\u0435 \u0438 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u044b \u0438\u043b\u0438 \u043f\u0435\u0440\u0435\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u044b.<\/p>\n<p>\u041f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043c\u044b \u0442\u043e\u043b\u044c\u043a\u043e \u0447\u0442\u043e \u0441\u043e\u0441\u043b\u0430\u043b\u0438\u0441\u044c \u043d\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044e <code>update<\/code> \u0432 \u0448\u0430\u0431\u043b\u043e\u043d\u0435, \u0442\u0435\u043f\u0435\u0440\u044c \u043e\u043d\u0430 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <code>instance<\/code> \u043a\u0430\u043a \u0447\u0430\u0441\u0442\u044c <code>ctx<\/code>.<\/p>\n<p>Svelte \u043f\u044b\u0442\u0430\u0435\u0442\u0441\u044f \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0431\u043e\u043b\u0435\u0435 \u043a\u043e\u043c\u043f\u0430\u043a\u0442\u043d\u044b\u0439 \u0432\u044b\u0432\u043e\u0434 JavaScript, \u043d\u0435 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044f \u043b\u0438\u0448\u043d\u044e\u044e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e, \u0435\u0441\u043b\u0438 \u0432 \u044d\u0442\u043e\u043c \u043d\u0435\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438.<\/p>\n<h3>listen \u0438 dispose<\/h3>\n<p>\u041a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437, \u043a\u043e\u0433\u0434\u0430 \u0432\u044b \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442\u0435 \u0441\u043b\u0443\u0448\u0430\u0442\u0435\u043b\u044c \u0441\u043e\u0431\u044b\u0442\u0438\u0439 \u0432 \u0448\u0430\u0431\u043b\u043e\u043d\u0435, Svelte \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u0441\u043b\u0443\u0448\u0430\u0442\u0435\u043b\u044c \u0438 \u0443\u0434\u0430\u043b\u044f\u0435\u0442 \u0435\u0433\u043e, \u043a\u043e\u0433\u0434\u0430 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442 \u0443\u0434\u0430\u043b\u044f\u0435\u0442\u0441\u044f \u0438\u0437 DOM.<\/p>\n<p>\u041f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0435 \u0441\u043b\u0443\u0448\u0430\u0442\u0435\u043b\u0435\u0439 \u0441\u043e\u0431\u044b\u0442\u0438\u0439,<\/p>\n<pre><code class=\"xml\">&lt;h1 \ton:click={update} \ton:mousedown={update} \ton:touchstart={update}&gt;   Hello {name}! &lt;\/h1&gt;<\/code><\/pre>\n<p><a href=\"https:\/\/svelte.dev\/repl\/efde6f2aaf624e708767f1bd3e94e479?version=3.19.1\" rel=\"noopener noreferrer nofollow\"><strong>Svelte REPL<\/strong><\/a><\/p>\n<p>\u0438 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u0432\u044b\u0432\u043e\u0434 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u0430:<\/p>\n<pre><code class=\"javascript\">\/\/ ... dispose = [   listen(h1, 'click', \/*update*\/ ctx[1]),   listen(h1, 'mousedown', \/*update*\/ ctx[1]),   listen(h1, 'touchstart', \/*update*\/ ctx[1], { passive: true }), ]; \/\/ ... run_all(dispose);<\/code><\/pre>\n<p>\u0412\u043c\u0435\u0441\u0442\u043e \u0442\u043e\u0433\u043e \u0447\u0442\u043e\u0431\u044b \u043e\u0431\u044a\u044f\u0432\u043b\u044f\u0442\u044c \u0438 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043d\u043e\u0432\u0443\u044e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u0434\u043b\u044f \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0441\u043b\u0443\u0448\u0430\u0442\u0435\u043b\u044f, Svelte \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u0435\u0442 \u0438\u0445 \u0432 \u043c\u0430\u0441\u0441\u0438\u0432:<\/p>\n<pre><code class=\"javascript\">\/\/ \u0432\u043c\u0435\u0441\u0442\u043e \u0432\u043e\u0442 \u0442\u0430\u043a\u043e\u0433\u043e dispose1 = listen(h1, 'click', \/*update*\/ ctx[1]); dispose2 = listen(h1, 'mousedown', \/*update*\/ ctx[1]); dispose2 = listen(h1, 'touchstart', \/*update*\/ ctx[1], { passive: true }); \/\/ ... dispose1(); dispose2(); dispose3();<\/code><\/pre>\n<p>\u041c\u0438\u043d\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u044f \u043c\u043e\u0436\u0435\u0442 \u0441\u0436\u0430\u0442\u044c \u0438\u043c\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439, \u043d\u043e \u0441\u043a\u043e\u0431\u043a\u0438 \u0443\u0431\u0440\u0430\u0442\u044c \u043d\u0435\u043b\u044c\u0437\u044f.<\/p>\n<p>\u041e\u043f\u044f\u0442\u044c \u0436\u0435, \u044d\u0442\u043e \u0435\u0449\u0435 \u043e\u0434\u0438\u043d \u043e\u0442\u043b\u0438\u0447\u043d\u044b\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a Svelte \u043f\u044b\u0442\u0430\u0435\u0442\u0441\u044f \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u043c\u043f\u0430\u043a\u0442\u043d\u044b\u0439 \u0432\u044b\u0432\u043e\u0434 JavaScript. Svelte \u043d\u0435 \u0441\u043e\u0437\u0434\u0430\u0435\u0442 \u043c\u0430\u0441\u0441\u0438\u0432 <code>dispose<\/code>, \u0435\u0441\u043b\u0438 \u0438\u043c\u0435\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u0438\u043d \u0441\u043b\u0443\u0448\u0430\u0442\u0435\u043b\u044c \u0441\u043e\u0431\u044b\u0442\u0438\u0439.<\/p>\n<h3>\u0418\u0442\u043e\u0433\u043e<\/h3>\n<p>\u0421\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 Svelte &#8212; \u044d\u0442\u043e \u043d\u0430\u0434\u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e HTML.<\/p>\n<p>\u041a\u043e\u0433\u0434\u0430 \u0432\u044b \u043f\u0438\u0448\u0435\u0442\u0435 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 Svelte, \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u0442 \u0432\u0430\u0448 \u043a\u043e\u0434 \u0438 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 JavaScript \u043a\u043e\u0434.<\/p>\n<p>\u041a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u044c \u043d\u0430 3 \u0441\u0435\u0433\u043c\u0435\u043d\u0442\u0430:<\/p>\n<p><strong>1. create_fragment<\/strong><\/p>\n<ul>\n<li>\n<p>\u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044e \u043f\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044e \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0430 DOM \u0434\u043b\u044f \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430.<\/p>\n<\/li>\n<\/ul>\n<p><strong>2. instance<\/strong><\/p>\n<ul>\n<li>\n<p>\u0411\u043e\u043b\u044c\u0448\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u043a\u043e\u0434\u0430, \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0433\u043e \u0432 \u0442\u0435\u0433\u0435 <code>&lt;script&gt;<\/code>, \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0437\u0434\u0435\u0441\u044c.<\/p>\n<\/li>\n<li>\n<p>\u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0441\u043f\u0438\u0441\u043e\u043a \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u0430, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0435\u0441\u0442\u044c \u0441\u0441\u044b\u043b\u043a\u0430 \u0432 \u0448\u0430\u0431\u043b\u043e\u043d\u0435.<\/p>\n<\/li>\n<li>\n<p><code>$$invalidate<\/code> \u0432\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u043e\u0441\u043b\u0435 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u043d\u0438\u044f \u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u0430<\/p>\n<\/li>\n<\/ul>\n<p><strong>3. class App extends SvelteComponent<\/strong><\/p>\n<ul>\n<li>\n<p>\u0418\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u0442 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <code>create_fragment<\/code> \u0438 <code>instance<\/code><\/p>\n<\/li>\n<li>\n<p>\u0423\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0435 \u0447\u0430\u0441\u0442\u0438 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430<\/p>\n<\/li>\n<li>\n<p>\u041f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 <a href=\"https:\/\/svelte.dev\/docs#Client-side_component_API\" rel=\"noopener noreferrer nofollow\">API \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430<\/a><\/p>\n<\/li>\n<\/ul>\n<p>Svelte \u0441\u0442\u0440\u0435\u043c\u0438\u0442\u0441\u044f \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0431\u043e\u043b\u0435\u0435 \u043a\u043e\u043c\u043f\u0430\u043a\u0442\u043d\u044b\u0439 JavaScript, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440:<\/p>\n<ul>\n<li>\n<p>\u0420\u0430\u0437\u0431\u0438\u0435\u043d\u0438\u0435 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u043e\u0433\u043e \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0433\u043e <code>h1<\/code> \u043d\u0430 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0435 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u0435 \u0443\u0437\u043b\u044b \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u043e\u0433\u0434\u0430, \u043a\u043e\u0433\u0434\u0430 \u0447\u0430\u0441\u0442\u044c \u0442\u0435\u043a\u0441\u0442\u0430 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0430<\/p>\n<\/li>\n<li>\n<p>\u041d\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 <code>create_fragment<\/code> \u0438\u043b\u0438 <code>instance<\/code>, \u043a\u043e\u0433\u0434\u0430 \u044d\u0442\u043e \u043d\u0435 \u043d\u0443\u0436\u043d\u043e<\/p>\n<\/li>\n<li>\n<p>\u0413\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442 <code>dispose<\/code> \u043a\u0430\u043a \u043c\u0430\u0441\u0441\u0438\u0432 \u0438\u043b\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u044e, \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0441\u043b\u0443\u0448\u0430\u0442\u0435\u043b\u0435\u0439 \u0441\u043e\u0431\u044b\u0442\u0438\u0439.<\/p>\n<\/li>\n<li>\n<p>&#8230;<\/p>\n<\/li>\n<\/ul>\n<h3>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h3>\n<p>\u041c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043b\u0438 \u0431\u0430\u0437\u043e\u0432\u0443\u044e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u043a\u043e\u0434\u0430, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 Svelte \u0438 \u044d\u0442\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430\u0447\u0430\u043b\u043e.<\/p>\n<hr>\n<p><em>\u041d\u0430\u0434\u0435\u044e\u0441\u044c \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u0430\u0442\u0435\u0440\u0438\u0430\u043b \u0431\u044b\u043b \u0434\u043b\u044f \u0432\u0430\u0441 \u043f\u043e\u043b\u0435\u0437\u0435\u043d!<\/em><\/p>\n<\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/536468\/\"> https:\/\/habr.com\/ru\/post\/536468\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text_v2\" id=\"post-content-body\">\n<h3>\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435<\/h3>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0432\u0441\u043f\u043e\u043c\u043d\u0438\u043c \u043a\u0430\u043a \u043c\u044b \u043f\u0438\u0448\u0435\u043c \u0432\u0435\u0431-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0431\u0435\u0437 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u043e\u0432:<\/p>\n<p><strong>\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u044d\u043b\u0435\u043c\u0435\u043d\u0442<\/strong><\/p>\n<pre><code class=\"javascript\">\/\/ \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u044d\u043b\u0435\u043c\u0435\u043d\u0442 h1 const h1 = document.createElement('h1'); h1.textContent = 'Hello World'; \/\/ ...\u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0435\u0433\u043e \u0432 body document.body.appendChild(h1);<\/code><\/pre>\n<p><strong>\u041e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u043c \u044d\u043b\u0435\u043c\u0435\u043d\u0442<\/strong><\/p>\n<pre><code class=\"javascript\">\/\/ \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u043c \u0442\u0435\u043a\u0441\u0442 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 h1 h1.textContent = 'Bye World';<\/code><\/pre>\n<p><strong>\u0423\u0434\u0430\u043b\u044f\u0435\u043c \u044d\u043b\u0435\u043c\u0435\u043d\u0442<\/strong><\/p>\n<pre><code class=\"javascript\">\/\/ \u043d\u0430\u043a\u043e\u043d\u0435\u0446, \u043c\u044b \u0443\u0434\u0430\u043b\u044f\u0435\u043c \u044d\u043b\u0435\u043c\u0435\u043d\u0442 h1 document.body.removeChild(h1);<\/code><\/pre>\n<p><strong>\u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0441\u0442\u0438\u043b\u0438 \u043a \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0443<\/strong><\/p>\n<pre><code class=\"javascript\">const h1 = document.createElement('h1'); h1.textContent = 'Hello World';  \/\/ \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043a\u043b\u0430\u0441\u0441 \u043a \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0443 h1 h1.setAttribute('class', 'abc');  \/\/ ...\u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0442\u0435\u0433 &lt;style&gt; \u0432 head const style = document.createElement('style'); style.textContent = '.abc { color: blue; }'; document.head.appendChild(style); document.body.appendChild(h1);<\/code><\/pre>\n<p><strong>\u0421\u043b\u0443\u0448\u0430\u0435\u043c \u0441\u043e\u0431\u044b\u0442\u0438\u044f click \u043d\u0430 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0435<\/strong><\/p>\n<pre><code class=\"javascript\">const button = document.createElement('button'); button.textContent = 'Click Me!';  \/\/ \u0441\u043b\u0443\u0448\u0430\u0435\u043c \u0441\u043e\u0431\u044b\u0442\u0438\u0435 click button.addEventListener('click', () =&gt; {   console.log('Hi!'); });  document.body.appendChild(button);<\/code><\/pre>\n<p>\u041d\u0430 \u0447\u0438\u0441\u0442\u043e\u043c JavaScript \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0447\u0442\u043e-\u0442\u043e \u043f\u043e\u0434\u043e\u0431\u043d\u043e\u0435.<\/p>\n<p>\u041e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u0446\u0435\u043b\u044c \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438 \u0432 \u0442\u043e\u043c \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u043a\u0430\u043a \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 Svelte \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u0435\u0442 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 Svelte \u0432 \u0431\u043b\u043e\u043a\u0438 \u043a\u043e\u0434\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u044f \u043f\u043e\u043a\u0430\u0437\u0430\u043b \u0432\u044b\u0448\u0435.<\/p>\n<h3>\u0421\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 Svelte<\/h3>\n<p>\u0414\u0430\u043b\u0435\u0435 \u044f \u043f\u043e\u043a\u0430\u0436\u0443 \u0431\u0430\u0437\u043e\u0432\u044b\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u044b Svelte \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441\u0430.<\/p>\n<blockquote>\n<p>\u0415\u0441\u043b\u0438 \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u0443\u0437\u043d\u0430\u0442\u044c \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435, \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c <a href=\"https:\/\/svelte.dev\/tutorial\/basics\" rel=\"noopener noreferrer nofollow\">\u0438\u043d\u0442\u0435\u0440\u0430\u043a\u0442\u0438\u0432\u043d\u044b\u0439 Svelte \u0442\u0443\u0442\u043e\u0440\u0438\u0430\u043b.<\/a><\/p>\n<\/blockquote>\n<p>\u0418\u0442\u0430\u043a, \u0432\u043e\u0442 \u043f\u0440\u043e\u0441\u0442\u0435\u0439\u0448\u0438\u0439 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 Svelte:<\/p>\n<pre><code class=\"xml\">&lt;h1&gt;Hello World&lt;\/h1&gt;<\/code><\/pre>\n<p><a href=\"https:\/\/svelte.dev\/repl\/99aeea705b1e48fe8610b3ccee948280\" rel=\"noopener noreferrer nofollow\"><strong>Svelte REPL<\/strong><\/a><\/p>\n<p>\u0414\u043b\u044f \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0441\u0442\u0438\u043b\u0435\u0439, \u043d\u0443\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0442\u0435\u0433 <code>&lt;style&gt;<\/code>:<\/p>\n<pre><code class=\"xml\">&lt;style&gt;   h1 {     color: rebeccapurple;   } &lt;\/style&gt;  &lt;h1&gt;Hello World&lt;\/h1&gt;<\/code><\/pre>\n<p><a href=\"https:\/\/svelte.dev\/repl\/cf54441399864c0f9b0cb25710a5fe9b\" rel=\"noopener noreferrer nofollow\"><strong>Svelte REPL<\/strong><\/a><\/p>\n<p>\u041d\u0430 \u044d\u0442\u043e\u043c \u044d\u0442\u0430\u043f\u0435 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0435 Svelte \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430 \u043e\u0449\u0443\u0449\u0430\u0435\u0442\u0441\u044f \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e \u0442\u043e\u043c\u0443 \u043a\u0430\u043a \u043c\u044b \u043f\u0438\u0448\u0435\u043c \u043e\u0431\u044b\u0447\u043d\u044b\u0439 HTML, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 Svelte \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043d\u0430\u0434\u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e\u043c HTML \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441\u0430.<\/p>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a\u0430\u043a \u043c\u044b \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u043d\u0430\u0448 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442:<\/p>\n<pre><code class=\"xml\">&lt;script&gt;   let name = 'World'; &lt;\/script&gt;  &lt;h1&gt;Hello {name}&lt;\/h1&gt;<\/code><\/pre>\n<p><a href=\"https:\/\/svelte.dev\/repl\/c149ca960b0444948dc0c00a9175bcb3\" rel=\"noopener noreferrer nofollow\"><strong>Svelte REPL<\/strong><\/a><\/p>\n<p>\u041c\u044b \u043f\u043e\u043c\u0435\u0449\u0430\u0435\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e JavaScript \u0432 \u0444\u0438\u0433\u0443\u0440\u043d\u044b\u0435 \u0441\u043a\u043e\u0431\u043a\u0438.<\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u043a\u043b\u0438\u043a\u0430, \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0434\u0438\u0440\u0435\u043a\u0442\u0438\u0432\u0443 <code>on:<\/code><\/p>\n<pre><code class=\"xml\">&lt;script&gt;   let count = 0;   function onClickButton(event) {     console.log(count);   } &lt;\/script&gt;  &lt;button on:click={onClickButton}&gt;Clicked {count}&lt;\/button&gt;<\/code><\/pre>\n<p><a href=\"https:\/\/svelte.dev\/repl\/1da1dcaf51814ed09d2341ea7915f0a1\" rel=\"noopener noreferrer nofollow\"><strong>Svelte REPL<\/strong><\/a><\/p>\n<p>\u0414\u043b\u044f \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445 \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c <a href=\"https:\/\/www.w3schools.com\/js\/js_assignment.asp\" rel=\"noopener noreferrer nofollow\">\u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u044b \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u043d\u0438\u044f<\/a>:<\/p>\n<pre><code class=\"xml\">&lt;script&gt;   let count = 0;   function onClickButton(event) {     count += 1;   } &lt;\/script&gt;  &lt;button on:click={onClickButton}&gt;Clicked {count}&lt;\/button&gt;<\/code><\/pre>\n<p><a href=\"https:\/\/svelte.dev\/repl\/7bff4b7746df4007a51155d2006ce724\" rel=\"noopener noreferrer nofollow\"><strong>Svelte REPL<\/strong><\/a><\/p>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043a\u0430\u043a \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 Svelte \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0432 JavaScript, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u044b \u0432\u0438\u0434\u0435\u043b\u0438 \u0440\u0430\u043d\u0435\u0435.<\/p>\n<h3>\u041a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u043c Svelte \u0432 \u0443\u043c\u0435<\/h3>\n<p>\u041a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 Svelte \u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u0442 \u043a\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u044b \u043f\u0438\u0448\u0435\u0442\u0435 \u0438 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 JavaScript.<\/p>\n<p>\u0427\u0442\u043e\u0431\u044b \u043f\u043e\u043d\u044f\u0442\u044c, \u043a\u0430\u043a Svelte \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u0442 \u043a\u043e\u0434, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043d\u0430\u0447\u043d\u0435\u043c \u0441 \u043d\u0430\u0438\u043c\u0435\u043d\u044c\u0448\u0435\u0433\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0433\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u0438 \u043f\u043e\u0441\u0442\u0435\u043f\u0435\u043d\u043d\u043e \u0431\u0443\u0434\u0435\u043c \u0443\u0441\u043b\u043e\u0436\u043d\u044f\u0442\u044c \u0435\u0433\u043e. \u0412 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0432\u044b \u0443\u0432\u0438\u0434\u0438\u0442\u0435, \u0447\u0442\u043e \u0438\u043c\u0435\u043d\u043d\u043e Svelte \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 \u043a \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u043c\u0443 \u043a\u043e\u0434\u0443 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u043d\u0430\u0448\u0438\u0445 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439.<\/p>\n<p>\u041f\u0435\u0440\u0432\u044b\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u044b \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c:<\/p>\n<pre><code class=\"xml\">&lt;h1&gt;Hello World&lt;\/h1&gt;<\/code><\/pre>\n<p><a href=\"https:\/\/svelte.dev\/repl\/99aeea705b1e48fe8610b3ccee948280?version=3.19.1\" rel=\"noopener noreferrer nofollow\"><strong>Svelte REPL<\/strong><\/a><\/p>\n<p>\u041a\u043e\u0434 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f \u043d\u0430 \u0432\u044b\u0445\u043e\u0434\u0435:<\/p>\n<pre><code class=\"javascript\">function create_fragment(ctx) {   let h1;    return {     c() {       h1 = element('h1');       h1.textContent = 'Hello world';     },     m(target, anchor) {       insert(target, h1, anchor);     },     d(detaching) {       if (detaching) detach(h1);     },   }; }  export default class App extends SvelteComponent {   constructor(options) {     super();     init(this, options, null, create_fragment, safe_not_equal, {});   } }<\/code><\/pre>\n<p>\u041c\u044b \u043c\u043e\u0436\u0435\u043c \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u0434 \u043d\u0430 2 \u0447\u0430\u0441\u0442\u0438:<\/p>\n<ul>\n<li>\n<p><code>create_fragment<\/code><\/p>\n<\/li>\n<li>\n<p><code>class App extends SvelteComponent<\/code><\/p>\n<\/li>\n<\/ul>\n<h3>create_fragment<\/h3>\n<p>\u041a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b Svelte &#8212; \u044d\u0442\u043e \u0441\u0442\u0440\u043e\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0431\u043b\u043e\u043a\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f Svelte. \u041a\u0430\u0436\u0434\u044b\u0439 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 Svelte \u0444\u043e\u043a\u0443\u0441\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043d\u0430 \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u0438 \u0441\u0432\u043e\u0435\u0439 \u0447\u0430\u0441\u0442\u0438 \u0438\u043b\u0438 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0435 \u0444\u0438\u043d\u0430\u043b\u044c\u043d\u043e\u0433\u043e DOM \u0434\u0435\u0440\u0435\u0432\u0430.<\/p>\n<p>\u0424\u0443\u043d\u043a\u0446\u0438\u044f <code>create_fragment<\/code> \u0434\u0430\u0435\u0442 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0443 Svelte \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u043e \u043f\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044e \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0430 DOM \u0434\u0435\u0440\u0435\u0432\u0430.<\/p>\n<p>\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435 \u043d\u0430 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u044b\u0439 \u043e\u0431\u044a\u0435\u043a\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <code>create_fragment<\/code>. \u0412 \u043d\u0435\u043c \u0435\u0441\u0442\u044c \u0442\u0430\u043a\u0438\u0435 \u043c\u0435\u0442\u043e\u0434\u044b, \u043a\u0430\u043a:<\/p>\n<ul>\n<li>\n<p><code>c()<\/code><\/p>\n<\/li>\n<\/ul>\n<p>\u0421\u043e\u043a\u0440\u0430\u0449\u0435\u043d\u043d\u043e \u043e\u0442 create. \u0421\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u043f\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044e \u0432\u0441\u0435\u0445 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0432\u043e \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0435.<\/p>\n<p>\u0412 \u044d\u0442\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043c\u0435\u0442\u043e\u0434 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u043f\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 <code>h1<\/code>:<\/p>\n<pre><code class=\"javascript\">h1 = element('h1'); h1.textContent = 'Hello World';<\/code><\/pre>\n<ul>\n<li>\n<p><code>m(target, anchor)<\/code><\/p>\n<\/li>\n<\/ul>\n<p>\u0421\u043e\u043a\u0440\u0430\u0449\u0435\u043d\u043d\u043e \u043e\u0442 mount. \u0421\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u0434\u043b\u044f \u0432\u0441\u0442\u0430\u0432\u043a\u0438 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0432 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u0443\u044e \u0446\u0435\u043b\u044c.<\/p>\n<p>\u0412 \u044d\u0442\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043c\u0435\u0442\u043e\u0434 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u043f\u043e \u0432\u0441\u0442\u0430\u0432\u043a\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 <code>h1<\/code> \u0432 <code>target<\/code>:<\/p>\n<pre><code class=\"javascript\">insert(target, h1, anchor);  \/\/ http:\/\/github.com\/sveltejs\/svelte\/tree\/master\/src\/runtime\/internal\/dom.ts export function insert(target, node, anchor) {   target.insertBefore(node, anchor || null); }<\/code><\/pre>\n<ul>\n<li>\n<p><code>d(detaching)<\/code><\/p>\n<\/li>\n<\/ul>\n<p>\u0421\u043e\u043a\u0440\u0430\u0449\u0435\u043d\u043d\u043e \u043e\u0442 destroy. \u0421\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u043f\u043e \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u044e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0438\u0437 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0439 \u0446\u0435\u043b\u0438.<\/p>\n<p>\u0412 \u044d\u0442\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043c\u044b \u0443\u0434\u0430\u043b\u044f\u0435\u043c \u044d\u043b\u0435\u043c\u0435\u043d\u0442 <code>h1<\/code> \u0438\u0437 DOM \u0434\u0435\u0440\u0435\u0432\u0430:<\/p>\n<pre><code class=\"javascript\">detach(h1);  \/\/ http:\/\/github.com\/sveltejs\/svelte\/tree\/master\/src\/runtime\/internal\/dom.ts function detach(node) {   node.parentNode.removeChild(node); }<\/code><\/pre>\n<p>\u0418\u043c\u0435\u043d\u0430 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0441\u043e\u043a\u0440\u0430\u0449\u0435\u043d\u044b \u0434\u043b\u044f \u043b\u0443\u0447\u0448\u0435\u0439 \u043c\u0438\u043d\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438. \u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435, \u0447\u0442\u043e <a href=\"https:\/\/alistapart.com\/article\/javascript-minification-part-ii\/#section3\" rel=\"noopener noreferrer nofollow\">\u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043c\u0438\u043d\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e.<\/a><\/p>\n<h3>export default class App extends SvelteComponent<\/h3>\n<p>\u041a\u0430\u0436\u0434\u044b\u0439 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 &#8212; \u044d\u0442\u043e \u043a\u043b\u0430\u0441\u0441, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 \u0447\u0435\u0440\u0435\u0437 <a href=\"https:\/\/svelte.dev\/docs#Client-side_component_API\" rel=\"noopener noreferrer nofollow\">\u044d\u0442\u043e\u0442 API<\/a>.<\/p>\n<p>\u0412 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0435 \u043c\u044b \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u043c \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 \u0441 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0435\u0439 \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043e\u043d \u0441\u043e\u0441\u0442\u043e\u0438\u0442, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 create_fragment. Svelte \u0431\u0443\u0434\u0435\u0442 \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u0438 \u0443\u0434\u0430\u043b\u044f\u0442\u044c \u0435\u0435 \u0432\u0441\u044f\u043a\u0438\u0439 \u0440\u0430\u0437, \u043a\u043e\u0433\u0434\u0430 \u0432 \u043d\u0435\u0439 \u043d\u0435\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438.<\/p>\n<p>\u041f\u043e\u043f\u0440\u043e\u0431\u0443\u0439\u0442\u0435 \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u0442\u0435\u0433 <code>&lt;h1&gt;<\/code> \u0438 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435, \u0447\u0442\u043e \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0434\u0435\u0442 \u0441 \u0432\u044b\u0432\u043e\u0434\u043e\u043c:<\/p>\n<pre><code class=\"xml\">&lt;!-- empty --&gt;<\/code><\/pre>\n<p><a href=\"https:\/\/svelte.dev\/repl\/1f29ce52adf446fc9116bb957b7200ec?version=3.19.1\" rel=\"noopener noreferrer nofollow\"><strong>Svelte REPL<\/strong><\/a><\/p>\n<pre><code class=\"javascript\">class App extends SvelteComponent {   constructor(options) {     super();     init(this, options, null, null, safe_not_equal, {});   } }<\/code><\/pre>\n<p>Svelte \u043f\u0435\u0440\u0435\u0434\u0430\u0441\u0442 <code>null<\/code> \u0432\u043c\u0435\u0441\u0442\u043e <code>create_fragment<\/code>!<\/p>\n<p>\u0424\u0443\u043d\u043a\u0446\u0438\u044f init &#8212; \u044d\u0442\u043e \u0442\u043e \u043c\u0435\u0441\u0442\u043e, \u0433\u0434\u0435 Svelte \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u0442 \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u043e \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0445 \u0447\u0430\u0441\u0442\u0435\u0439, \u0442\u0430\u043a\u0438\u0445 \u043a\u0430\u043a:<\/p>\n<ul>\n<li>\n<p>\u0432\u0445\u043e\u0434\u043d\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430, <code>ctx<\/code> \u0438 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442<\/p>\n<\/li>\n<li>\n<p>\u0441\u043e\u0431\u044b\u0442\u0438\u044f \u0436\u0438\u0437\u043d\u0435\u043d\u043d\u043e\u0433\u043e \u0446\u0438\u043a\u043b\u0430<\/p>\n<\/li>\n<li>\n<p>\u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430<\/p>\n<\/li>\n<\/ul>\n<p>\u0432 \u0441\u0430\u043c\u043e\u043c \u043a\u043e\u043d\u0446\u0435 Svelte \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 <code>create_fragment<\/code> \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0438 \u043c\u043e\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0432 DOM.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u0432\u044b \u0437\u0430\u043c\u0435\u0442\u0438\u043b\u0438, \u0432\u0441\u0435 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u0438 \u043c\u0435\u0442\u043e\u0434\u044b \u043f\u0440\u0438\u0432\u044f\u0437\u0430\u043d\u044b \u043a <code>this.$$<\/code>.<\/p>\n<p>\u041f\u043e\u044d\u0442\u043e\u043c\u0443, \u0435\u0441\u043b\u0438 \u0432\u044b \u043e\u0431\u0440\u0430\u0449\u0430\u0435\u0442\u0435\u0441\u044c \u043a \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0443 <code>$$<\/code> \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430, \u0432\u044b \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0435\u0441\u044c \u043a \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u043c \u0447\u0430\u0441\u0442\u044f\u043c \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430. \u0412\u044b \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u044b!<\/p>\n<h3>\u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445<\/h3>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043a\u043e\u0433\u0434\u0430 \u043c\u044b \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043b\u0438 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 Svelte \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442, \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043a\u0430\u043a \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u0437\u043c\u0435\u043d\u0438\u0442 \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u0434:<\/p>\n<pre><code class=\"xml\">&lt;script&gt; \tlet name = 'World'; &lt;\/script&gt;  &lt;h1&gt;Hello {name}&lt;\/h1&gt;<\/code><\/pre>\n<p><a href=\"https:\/\/svelte.dev\/repl\/c149ca960b0444948dc0c00a9175bcb3?version=3.19.1\" rel=\"noopener noreferrer nofollow\"><strong>Svelte REPL<\/strong><\/a><\/p>\n<p>\u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0432\u044b\u0432\u043e\u0434\u0430:<\/p>\n<pre><code class=\"javascript\">function create_fragment(ctx) {   \/\/ ...   return {     c() {       h1 = element('h1');       h1.textContent = `Hello ${name}`;},     \/\/ ...   }; } let name = 'World';  class App extends SvelteComponent {   \/\/ ... }<\/code><\/pre>\n<p>\u041d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0430\u0431\u043b\u044e\u0434\u0435\u043d\u0438\u044f:<\/p>\n<ul>\n<li>\n<p>\u0442\u043e, \u0447\u0442\u043e \u043c\u044b \u043d\u0430\u043f\u0438\u0441\u0430\u043b\u0438 \u0432 \u0442\u0435\u0433\u0435 <code>&lt;script&gt;<\/code>, \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u0432\u0435\u0440\u0445\u043d\u0438\u0439 \u0443\u0440\u043e\u0432\u0435\u043d\u044c \u043a\u043e\u0434\u0430<\/p>\n<\/li>\n<li>\n<p>\u0442\u0435\u043a\u0441\u0442\u043e\u0432\u043e\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 <code>h1<\/code> \u0442\u0435\u043f\u0435\u0440\u044c \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0448\u0430\u0431\u043b\u043e\u043d\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u043e\u0439<\/p>\n<\/li>\n<\/ul>\n<p>\u041f\u0440\u044f\u043c\u043e \u0441\u0435\u0439\u0447\u0430\u0441 \u043f\u043e\u0434 \u043a\u0430\u043f\u043e\u0442\u043e\u043c \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043c\u043d\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0445 \u0432\u0435\u0449\u0435\u0439, \u043d\u043e \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u043e\u0434\u043e\u0436\u0434\u0435\u043c, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u044d\u0442\u043e \u043b\u0443\u0447\u0448\u0435 \u0432\u0441\u0435\u0433\u043e \u043e\u0431\u044a\u044f\u0441\u043d\u044f\u0435\u0442\u0441\u044f \u043f\u0440\u0438 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0438 \u0441\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435\u043c \u043a\u043e\u0434\u0430.<\/p>\n<h3>\u041e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445<\/h3>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0434\u043b\u044f \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0438\u043c\u0435\u043d\u0438:<\/p>\n<pre><code class=\"xml\">&lt;script&gt; \tlet name = 'World'; \tfunction update() { \t\tname = 'Svelte'; \t} &lt;\/script&gt;  &lt;h1&gt;Hello {name}&lt;\/h1&gt;<\/code><\/pre>\n<p><a href=\"https:\/\/svelte.dev\/repl\/3841485f4d224774ba42617e4e964968?version=3.19.1\" rel=\"noopener noreferrer nofollow\"><strong>Svelte REPL<\/strong><\/a><\/p>\n<p>\u2026 \u0438 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0441\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430:<\/p>\n<pre><code class=\"javascript\">function create_fragment(ctx) {   return {     c() {       h1 = element('h1');       t0 = text('Hello ');       t1 = text(\/*name*\/ ctx[0]);     },     m(target, anchor) {       insert(target, h1, anchor);       append(h1, t0);       append(h1, t1);     },     p(ctx, [dirty]) {       if (dirty &amp; \/*name*\/ 1) set_data(t1, \/*name*\/ ctx[0]);     },     d(detaching) {       if (detaching) detach(h1);     },   }; }  function instance($$self, $$props, $$invalidate) {   let name = 'World';    function update() {     $$invalidate(0, (name = 'Svelte'));   }    return [name]; }  export default class App extends SvelteComponent {   constructor(options) {     super();     init(this, options, instance, create_fragment, safe_not_equal, {});   } }<\/code><\/pre>\n<p>\u041d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0430\u0431\u043b\u044e\u0434\u0435\u043d\u0438\u044f:<\/p>\n<ul>\n<li>\n<p>\u0442\u0435\u043a\u0441\u0442\u043e\u0432\u043e\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 <code>&lt;h1&gt;<\/code> \u0442\u0435\u043f\u0435\u0440\u044c \u0440\u0430\u0437\u0431\u0438\u0442\u043e \u043d\u0430 2 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u044b\u0445 \u0443\u0437\u043b\u0430, \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439 <code>text (...)<\/code><\/p>\n<\/li>\n<li>\n<p>\u043e\u0431\u044a\u0435\u043a\u0442 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u044b\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439 <code>create_fragment<\/code> \u043f\u043e\u043b\u0443\u0447\u0438\u043b \u043d\u043e\u0432\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 <code>p(ctx, dirty)<\/code><\/p>\n<\/li>\n<li>\n<p>\u043f\u043e\u044f\u0432\u0438\u043b\u0430\u0441\u044c \u043d\u043e\u0432\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f <code>instance<\/code><\/p>\n<\/li>\n<li>\n<p>\u0442\u043e \u0447\u0442\u043e \u043c\u044b \u043d\u0430\u043f\u0438\u0441\u0430\u043b\u0438 \u0432 \u0442\u0435\u0433\u0435 <code>script<\/code> \u0431\u044b\u043b\u043e \u043f\u0435\u0440\u0435\u043d\u0435\u0441\u0435\u043d\u043e \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u044e <code>instance<\/code><\/p>\n<\/li>\n<li>\n<p>\u0438\u043c\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u043e\u0441\u044c \u0432 <code>create_fragment<\/code>, \u0442\u0435\u043f\u0435\u0440\u044c \u0437\u0430\u043c\u0435\u043d\u0435\u043d\u043e \u043d\u0430 <code>ctx[0]<\/code><\/p>\n<\/li>\n<\/ul>\n<p>\u041f\u043e\u0447\u0435\u043c\u0443 \u043f\u0440\u043e\u0438\u0437\u043e\u0448\u043b\u0438 \u0442\u0430\u043a\u0438\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f?<\/p>\n<p>\u041a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 Svelte \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u0435\u0442 \u0432\u0441\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435, \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u043d\u044b\u0435 \u0432 \u0442\u0435\u0433\u0435 <code>&lt;script&gt;<\/code>.<\/p>\n<p>\u041e\u043d \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u0435\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0444\u0430\u043a\u0442\u043e\u0440\u044b \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439:<\/p>\n<ul>\n<li>\n<p>\u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0430? \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440: <code>count++<\/code><\/p>\n<\/li>\n<li>\n<p>\u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043f\u0435\u0440\u0435\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0430? \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440: <code>name = 'Svelte'<\/code><\/p>\n<\/li>\n<li>\n<p>\u043d\u0430 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u0441\u0441\u044b\u043b\u0430\u044e\u0442\u0441\u044f \u0432 \u0448\u0430\u0431\u043b\u043e\u043d\u0435? \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 <code>&lt;h1&gt;Hello {name}&lt;\/h1&gt;<\/code><\/p>\n<\/li>\n<li>\n<p>\u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0430 \u0434\u043b\u044f \u0437\u0430\u043f\u0438\u0441\u0438? \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 <code>const i = 1;<\/code> \u0438\u043b\u0438 <code>let i = 1;<\/code><\/p>\n<\/li>\n<li>\n<p>&#8230; \u0438 \u043c\u043d\u043e\u0433\u043e\u0435 \u0434\u0440\u0443\u0433\u043e\u0435<\/p>\n<\/li>\n<\/ul>\n<p>\u041a\u043e\u0433\u0434\u0430 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 Svelte \u043f\u043e\u043d\u0438\u043c\u0430\u0435\u0442, \u0447\u0442\u043e \u0438\u043c\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u043c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u043d\u0430\u0437\u043d\u0430\u0447\u0438\u0442\u044c (\u0438\u0437-\u0437\u0430 <code>name = 'Svelte';<\/code> \u043f\u0440\u0438 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0438), \u043e\u043d \u0440\u0430\u0437\u0431\u0438\u0432\u0430\u0435\u0442 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u043e\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 <code>h1<\/code> \u043d\u0430 \u0447\u0430\u0441\u0442\u0438, \u0447\u0442\u043e\u0431\u044b \u043e\u043d \u043c\u043e\u0433 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0442\u044c \u0447\u0430\u0441\u0442\u044c \u0442\u0435\u043a\u0441\u0442\u0430.<\/p>\n<p>\u0418 \u0432 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435, \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0432\u0438\u0434\u0435\u0442\u044c, \u0447\u0442\u043e \u0435\u0441\u0442\u044c \u043d\u043e\u0432\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 <code>p<\/code> \u0434\u043b\u044f \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u043e\u0433\u043e \u0443\u0437\u043b\u0430.<\/p>\n<ul>\n<li>\n<p><code>p(ctx, dirty)<\/code><\/p>\n<\/li>\n<\/ul>\n<p>\u0421\u043e\u043a\u0440\u0430\u0449\u0435\u043d\u043d\u043e \u043e\u0442 <code>u_p_date<\/code><\/p>\n<p><code>p(ctx, dirty)<\/code> \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 \u043f\u043e \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u043b\u043e\u0441\u044c \u0432 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0438 (<code>dirty<\/code>) \u0438 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0438 (<code>ctx<\/code>) \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430.<\/p>\n<h3>\u0424\u0443\u043d\u043a\u0446\u0438\u044f instance<\/h3>\n<p>\u041a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u043f\u043e\u043d\u0438\u043c\u0430\u0435\u0442, \u0447\u0442\u043e \u0438\u043c\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u043d\u0435 \u043c\u043e\u0436\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0432 \u0440\u0430\u0437\u043d\u044b\u0445 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u0430\u0445 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430 <code>App<\/code>.<\/p>\n<p>\u0412\u043e\u0442 \u043f\u043e\u0447\u0435\u043c\u0443 \u043e\u043d \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0430\u0435\u0442 \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u0435 \u0438\u043c\u0435\u043d\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0441 \u0438\u043c\u0435\u043d\u0435\u043c <code>instance<\/code>.<\/p>\n<p>\u0412 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435, \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e \u043e\u0442 \u0442\u043e\u0433\u043e, \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u043e\u0432 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430 <code>App<\/code>, \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0438\u043c\u0435\u043d\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u043e \u0438 \u043d\u0435 \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u0432\u043e \u0432\u0441\u0435\u0445 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u0430\u0445:<\/p>\n<pre><code class=\"xml\">&lt;App \/&gt; &lt;App \/&gt; &lt;App \/&gt;  &lt;!-- \u0432\u044b\u0432\u0435\u0434\u0435\u0442 --&gt; &lt;h1&gt;Hello world&lt;\/h1&gt; &lt;h1&gt;Hello world&lt;\/h1&gt; &lt;h1&gt;Hello world&lt;\/h1&gt;<\/code><\/pre>\n<p>\u041d\u043e \u0432 \u044d\u0442\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e <code>name<\/code> \u043c\u043e\u0436\u043d\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0432 \u043f\u0440\u0435\u0434\u0435\u043b\u0430\u0445 1 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u0430 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u0435 \u044d\u0442\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u0442\u0435\u043f\u0435\u0440\u044c \u043f\u0435\u0440\u0435\u043c\u0435\u0449\u0435\u043d\u043e \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u044e <code>instance<\/code>:<\/p>\n<pre><code class=\"xml\">&lt;App \/&gt; &lt;App \/&gt; &lt;App \/&gt;  &lt;!-- \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c --&gt; &lt;h1&gt;Hello world&lt;\/h1&gt; &lt;h1&gt;Hello Svelte&lt;\/h1&gt; &lt;h1&gt;Hello world&lt;\/h1&gt; &lt;!-- \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0435\u0433\u043e \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430 --&gt;<\/code><\/pre>\n<h3>instance($$self, $$props, $$invalidate)<\/h3>\n<p>\u0424\u0443\u043d\u043a\u0446\u0438\u044f instance \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0441\u043f\u0438\u0441\u043e\u043a \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430:<\/p>\n<ul>\n<li>\n<p>\u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u0441\u044b\u043b\u0430\u044e\u0442\u0441\u044f \u0432 \u0448\u0430\u0431\u043b\u043e\u043d\u0435<\/p>\n<\/li>\n<li>\n<p>\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u044b \u0438\u043b\u0438 \u043f\u0435\u0440\u0435\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u044b \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440\u0430 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430<\/p>\n<\/li>\n<\/ul>\n<p>\u0412 Svelte \u043c\u044b \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u044d\u0442\u043e\u0442 \u0441\u043f\u0438\u0441\u043e\u043a \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 <code>ctx<\/code>.<\/p>\n<p>\u0412 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <code>init<\/code> Svelte \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u044e <code>instance<\/code> \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f <code>ctx<\/code> \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0435\u0433\u043e \u043f\u0440\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u0430 \u0434\u043b\u044f \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430:<\/p>\n<pre><code class=\"javascript\">\/\/ \u043a\u043e\u043d\u0446\u0435\u043f\u0442\u0443\u0430\u043b\u044c\u043d\u043e,<\/code><\/pre>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-316119","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/316119","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=316119"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/316119\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=316119"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=316119"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=316119"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}