{"id":265436,"date":"2015-09-11T13:36:03","date_gmt":"2015-09-11T09:36:03","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=265436"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=265436","title":{"rendered":"\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 React JSX \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 TypeScript 1.6"},"content":{"rendered":"<p>       \u041d\u0435 \u0442\u0430\u043a \u0434\u0430\u0432\u043d\u043e Microsoft <a href=\"http:\/\/blogs.msdn.com\/b\/typescript\/archive\/2015\/09\/02\/announcing-typescript-1-6-beta-react-jsx-better-error-checking-and-more.aspx\">\u043e\u0431\u044a\u044f\u0432\u0438\u043b\u0430 \u043e \u0432\u044b\u043f\u0443\u0441\u043a\u0435 TypeScript 1.6 Beta<\/a>, \u043e\u0434\u043d\u0438\u043c \u0438\u0437 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0445, \u043d\u0430 \u043c\u043e\u0439 \u0432\u0437\u0433\u043b\u044f\u0434, \u043d\u043e\u0432\u043e\u0432\u0432\u0435\u0434\u0435\u043d\u0438\u0435\u043c \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 React\/JSX, \u0447\u0442\u043e \u0432 \u0441\u043e\u0432\u043e\u043a\u0443\u043f\u043d\u043e\u0441\u0442\u0438 \u0441 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044f\u043c\u0438 TypeScript&#8217;\u0430 \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u0442 \u043d\u043e\u0432\u044b\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/712\/71b\/f94\/71271bf94cb442c29578df43ee6844c9.jpg\"\/><\/p>\n<p>  \u042f \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u043e \u043b\u0438\u0447\u043d\u043e\u043c \u043e\u043f\u044b\u0442\u0435 \u2014 \u043a\u0430\u043a \u043d\u0430\u0447\u0430\u043b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u0432\u044f\u0437\u043a\u0443 TypeScript + React, \u0441 \u043a\u0430\u043a\u0438\u043c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430\u043c\u0438 \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0441\u044f \u0438 \u043a\u0430\u043a \u0438\u0445 \u0440\u0435\u0448\u0430\u043b. \u0410 \u0442\u0430\u043a \u0436\u0435 \u043f\u043e\u043a\u0430\u0436\u0443 \u043f\u0440\u0438\u043c\u0435\u0440\u044b gulp-\u0442\u0430\u0441\u043a\u043e\u0432 \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u044d\u0442\u043e \u0432\u0441\u0435 \u0437\u0430\u0440\u0430\u0431\u043e\u0442\u0430\u043b\u043e \u0438 \u043f\u0440\u043e\u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0438\u0440\u0443\u044e \u043a\u043e\u0434 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0433\u043e todo \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043d\u0430 TypeScript + React (<a href=\"https:\/\/github.com\/forcewake\/tsc-react-gulp-example\">\u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 Github<\/a>).<\/p>\n<p>  \u0415\u0441\u043b\u0438 \u0432\u0430\u043c \u044d\u0442\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e \u2014 \u043f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430, \u0437\u0430\u0445\u043e\u0434\u0438\u0442\u0435 \u043f\u043e\u0434 \u043a\u0430\u0442.<br \/>  <a name=\"habracut\"><\/a>   <\/p>\n<ul>\n<li> <a href=\"#typescript-16\">TypeScript 1.6<\/a><br \/> \n<ul>\n<li><a href=\"#native-jsx\">\u041d\u0430\u0439\u0442\u0438\u0432\u043d\u0430\u044f \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 JSX<\/a><\/li>\n<\/ul>\n<p>   <\/li>\n<li> <a href=\"#preparation\">\u041f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0430<\/a><br \/> \n<ul>\n<li><a href=\"#install-typescript-16-beta\">\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 TypeScript 1.6 Beta<\/a><\/li>\n<li><a href=\"#packagejson\">\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 package.json<\/a><\/li>\n<li> <a href=\"#gulpfilejs-config\">\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 gulpfile.js<\/a><br \/> \n<ul>\n<li><a href=\"#typescript-compile\">\u041a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u044f TypeScript<\/a><\/li>\n<li><a href=\"#browserify\">browserify<\/a><\/li>\n<li><a href=\"#index-html\">\u041a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 index.html<\/a><\/li>\n<li><a href=\"#gulpfilejs-file\">gulpfile.js \u0444\u0430\u0439\u043b<\/a><\/li>\n<\/ul>\n<p>   <\/li>\n<li><a href=\"#typescript-definitions\">TypeScript Definitions<\/a><\/li>\n<li><a href=\"#tsconfigjson\">\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 tsconfig.json<\/a><\/li>\n<\/ul>\n<p>   <\/li>\n<li> <a href=\"#react-code\">React-\u043a\u043e\u0434<\/a><br \/> \n<ul>\n<li><a href=\"#todoitem-tsx\">todoItem.tsx \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442<\/a><\/li>\n<li><a href=\"#main-tsx\">main.tsx \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442<\/a><\/li>\n<li><a href=\"#bootstrap-ts\">bootstrap.ts<\/a><\/li>\n<li><a href=\"#index-html-source\">index.html<\/a><\/li>\n<\/ul>\n<p>   <\/li>\n<li> <a href=\"#run-and-fun\">\u0417\u0430\u043f\u0443\u0441\u043a \u0438 \u0444\u0435\u0439\u0435\u0440\u0432\u0435\u0440\u043a\u0438<\/a><br \/> \n<ul>\n<li><a href=\"#install\">\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0438 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u044f<\/a><\/li>\n<li><a href=\"#http-server\">\u0417\u0430\u043f\u0443\u0441\u043a<\/a><\/li>\n<\/ul>\n<p>   <\/li>\n<li><a href=\"#end\">\u0412\u043c\u0435\u0441\u0442\u043e \u0437\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f<\/a><\/li>\n<\/ul>\n<p>  <a name=\"typescript-16\"><\/a>  <\/p>\n<h2><font color=\"#cc0000\">TypeScript 1.6<\/font><\/h2>\n<p>  \u0412\u043e\u0442 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0438 \u0434\u043e\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u0440\u0438\u043d\u0435\u0441\u043b\u043e \u044d\u0442\u043e \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435:<\/p>\n<ul>\n<li>ES6 \u0438\u0442\u0435\u0440\u0430\u0442\u043e\u0440\u044b<\/li>\n<li>\u041b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0435 \u0442\u0438\u043f\u044b<\/li>\n<li>\u041d\u0430\u0439\u0442\u0438\u0432\u043d\u0430\u044f \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 JSX<\/li>\n<li>\u0410\u0431\u0441\u0442\u0440\u0430\u043a\u0442\u043d\u044b\u0435 \u043a\u043b\u0430\u0441\u0441\u044b \u0438 \u043c\u0435\u0442\u043e\u0434\u044b<\/li>\n<\/ul>\n<p>  \u041f\u043e\u043b\u043d\u044b\u0439 \u0441\u043f\u0438\u0441\u043e\u043a \u0438 \u0441\u0441\u044b\u043b\u043a\u0438 \u043d\u0430 issues \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u043d\u0430 <a href=\"https:\/\/github.com\/Microsoft\/TypeScript\/wiki\/Roadmap\">Github<\/a>. \u041d\u0430\u0434\u0435\u044e\u0441\u044c, \u0447\u0442\u043e \u043a\u0442\u043e-\u043d\u0438\u0431\u0443\u0434\u044c \u0438\u0437 \u0445\u0430\u0431\u0440\u0430\u0441\u043e\u043e\u0431\u0449\u0435\u0441\u0442\u0432\u0430 \u0441\u0434\u0435\u043b\u0430\u0435\u0442 \u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u043b\u043d\u044b\u0439 \u043e\u0431\u0437\u043e\u0440 \u0432\u0441\u0435\u0445 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439. \u042f \u0436\u0435 \u0443\u0434\u0435\u043b\u044e \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u043d\u043e\u043c\u0443 \u0438\u0437 \u043d\u0438\u0445, \u0430 \u0438\u043c\u0435\u043d\u043d\u043e:<\/p>\n<p>  <a name=\"native-jsx\"><\/a>  <\/p>\n<h3><font color=\"#cc0000\">\u041d\u0430\u0439\u0442\u0438\u0432\u043d\u0430\u044f \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 JSX<\/font><\/h3>\n<p>  \u00ab\u0412\u0430\u0443!\u00bb \u2014 \u0432\u043e\u0442 \u043f\u0435\u0440\u0432\u0430\u044f \u043c\u044b\u0441\u043b\u044c, \u043a\u043e\u0433\u0434\u0430 \u044f \u043f\u0440\u043e\u0447\u0438\u0442\u0430\u043b <a href=\"http:\/\/blogs.msdn.com\/b\/typescript\/archive\/2015\/09\/02\/announcing-typescript-1-6-beta-react-jsx-better-error-checking-and-more.aspx\">\u0430\u043d\u043e\u043d\u0441<\/a>. \u041d\u043e \u0434\u0430\u043b\u044c\u0448\u0435 \u043d\u0430\u0447\u0430\u043b\u0438\u0441\u044c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b, \u0442\u0430\u043a \u043a\u0430\u043a \u043d\u0435\u043b\u044c\u0437\u044f \u043f\u0440\u043e\u0441\u0442\u043e \u0432\u0437\u044f\u0442\u044c \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c edge-\u0442\u0435\u0445\u043d\u043e\u043b\u043e\u0433\u0438\u0438, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0435\u0440\u0435\u0434 \u0442\u0435\u043c, \u043d\u0430\u0447\u0430\u0442\u044c \u043f\u0438\u0441\u0430\u0442\u044c \u043a\u043b\u0430\u0441\u0441\u043d\u044b\u0439 \u0442\u0438\u043f\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u0434, \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u043e\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u0438, \u0447\u0442\u043e\u0431\u044b \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u0432 \u0431\u0443\u0434\u0443\u0449\u0435\u043c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0441\u043e \u0441\u0431\u043e\u0440\u043a\u043e\u0439 \u0438 \u0434\u0435\u043f\u043b\u043e\u0435\u043c \u043d\u0430\u0448\u0435\u0433\u043e \u043a\u043e\u0434\u0430.<\/p>\n<p>  <a name=\"preparation\"><\/a>  <\/p>\n<h2><font color=\"#cc0000\">\u041f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043a\u0430<\/font><\/h2>\n<p>  \u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0431\u0443\u0434\u0435\u043c \u0441\u0447\u0438\u0442\u0430\u0442\u044c, \u0447\u0442\u043e \u0443 \u043d\u0430\u0441 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u044b \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u044b \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0435 \u0432\u0435\u0440\u0441\u0438\u0438 <em>nodejs<\/em> \u0438 <em>npm<\/em>.<\/p>\n<p>  <a name=\"install-typescript-16-beta\"><\/a>  <\/p>\n<h3><font color=\"#cc0000\">\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 TypeScript 1.6 Beta<\/font><\/h3>\n<p>  \u0414\u043b\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 TypeScript 1.6 Beta \u0432 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u0443\u044e \u043e\u0431\u043b\u0430\u0441\u0442\u044c \u0432\u0438\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439:<\/p>\n<pre><code class=\"bash\">npm install -g typescript@1.6.0-beta <\/code><\/pre>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u044d\u0442\u043e\u0433\u043e \u0443 \u0432\u0430\u0441 \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u0435 \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0430 \u043a\u043e\u043c\u0430\u043d\u0434\u0430 <strong>tsc<\/strong> \u2014 \u044d\u0442\u043e \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0438 \u0435\u0441\u0442\u044c \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u0434\u043b\u044f TypeScript. \u0423\u0431\u0435\u0434\u0438\u0442\u0435\u0441\u044c \u0447\u0442\u043e \u0443 \u0432\u0430\u0441 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u0430 \u0432\u0435\u0440\u0441\u0438\u044f 1.6-beta.<\/p>\n<p>  \u041f\u0440\u043e\u0432\u0435\u0440\u0438\u043c, \u0447\u0442\u043e \u0432\u0441\u0451 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043b\u043e\u0441\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u044b:<\/p>\n<pre><code>tsc --version <\/code><\/pre>\n<p>  \u0414\u043b\u044f \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0439 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u0443:<\/p>\n<pre><code>npm install typescript@1.6.0-beta --save-dev <\/code><\/pre>\n<p>  <a name=\"packagejson\"><\/a>  <\/p>\n<h3><font color=\"#cc0000\">\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 package.json<\/font><\/h3>\n<p>  \u0424\u0430\u0439\u043b <b>package.json<\/b> \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0432 \u0441\u0435\u0431\u0435 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u0432\u0430\u0448\u0435\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438: \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435, \u0432\u0435\u0440\u0441\u0438\u044f, \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u0438 \u0442\u043e\u043c\u0443 \u043f\u043e\u0434\u043e\u0431\u043d\u043e\u0435. \u041b\u044e\u0431\u0430\u044f \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u044f, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0435\u0441\u0442\u044c \u044d\u0442\u043e\u0442 \u0444\u0430\u0439\u043b, \u0438\u043d\u0442\u0435\u0440\u043f\u0440\u0435\u0442\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043a\u0430\u043a Node.js-\u043f\u0430\u043a\u0435\u0442, \u0434\u0430\u0436\u0435 \u0435\u0441\u043b\u0438 \u0432\u044b \u043d\u0435 \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u0442\u0435\u0441\u044c \u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u0442\u044c \u0435\u0433\u043e.<\/p>\n<p>  \u0421\u043f\u043e\u0441\u043e\u0431 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0444\u0430\u0439\u043b\u0430 <b>package.json<\/b> \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u0442\u043e\u0433\u043e, \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u0442\u0435\u0441\u044c \u043b\u0438 \u0432\u044b \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u0442\u044c \u043f\u0430\u043a\u0435\u0442 \u0438\u043b\u0438 \u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u0442\u044c \u0435\u0433\u043e. \u0412 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043e\u043d \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0441\u043f\u0438\u0441\u043e\u043a \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439 \u043d\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430:<\/p>\n<pre><code>{   &quot;name&quot;: &quot;tsc-react-gulp-example&quot;,   &quot;version&quot;: &quot;1.0.0&quot;,   &quot;dependencies&quot;: {     &quot;react&quot;: &quot;^0.13.3&quot;   },   &quot;devDependencies&quot;: {     &quot;browserify&quot;: &quot;^11.0.0&quot;,     &quot;del&quot;: &quot;^1.2.0&quot;,     &quot;gulp&quot;: &quot;^3.9.0&quot;,     &quot;gulp-typescript&quot;: &quot;^2.8.0&quot;,     &quot;typescript&quot;: &quot;next&quot;,     &quot;vinyl-source-stream&quot;: &quot;^1.1.0&quot;   } } <\/code><\/pre>\n<p>  <a name=\"gulpfilejs-config\"><\/a>  <\/p>\n<h3><font color=\"#cc0000\">\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 gulpfile.js<\/font><\/h3>\n<p>  \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0441\u0431\u043e\u0440\u0449\u0438\u043a\u0430 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b gulp, \u043d\u043e, \u043a\u0430\u043a \u043f\u043e \u043c\u043d\u0435, \u043e\u0441\u043e\u0431\u043e\u0439 \u0440\u0430\u0437\u043d\u0438\u0446\u044b \u043d\u0435\u0442, \u0442\u0430\u043a \u043a\u0430\u043a \u0433\u043b\u0430\u0432\u043d\u043e\u0435 \u2014 \u0438\u0434\u0435\u044f. \u0414\u043b\u044f \u0441\u0431\u043e\u0440\u043a\u0438 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u043c\u044b \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f \u0443\u0436\u0435 \u0433\u043e\u0442\u043e\u0432\u044b\u043c\u0438 npm \u043f\u0430\u043a\u0435\u0442\u0430\u043c\u0438: <a href=\"https:\/\/www.npmjs.com\/package\/gulp-typescript\">gulp-typescript<\/a> \u0434\u043b\u044f \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 TypeScript \u0438 <a href=\"https:\/\/www.npmjs.com\/package\/browserify\">browserify<\/a> \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u044f\u043c\u0438 \u043d\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430.<\/p>\n<p>  <a name=\"typescript-compile\"><\/a>  <\/p>\n<h4><font color=\"#cc0000\">\u041a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u044f TypeScript<\/font><\/h4>\n<p>  \u0422\u0430\u0441\u043a \u0434\u043b\u044f \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 TypeScript \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<pre><code>var gulp        = require('gulp'),     typescript  = require('typescript'),     ts          = require('gulp-typescript'),  var project = ts.createProject('src\/tsconfig.json', {typescript: typescript});  gulp.task('compile', function () {   var result = gulp     .src('src\/**\/*{ts,tsx}')     .pipe(ts(project));   return result.js.pipe(gulp.dest('.tmp')); }); <\/code><\/pre>\n<p>  \u0417\u0434\u0435\u0441\u044c \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0430\u043b\u0438 \u0440\u0430\u043d\u0435\u0435 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u043d\u044b\u0439 \u0444\u0430\u0439\u043b \u043f\u0440\u043e\u0435\u043a\u0442\u0430. \u0411\u043e\u043b\u0435\u0435 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u2014 \u043d\u0430 <a href=\"https:\/\/github.com\/ivogabe\/gulp-typescript#using-tsconfigjson\">github \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0430<\/a>.<\/p>\n<p>  <a name=\"browserify\"><\/a>  <\/p>\n<h4><font color=\"#cc0000\">browserify<\/font><\/h4>\n<p>  \u0422\u0430\u0441\u043a \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0431\u0430\u043d\u0434\u043b\u0430 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<pre><code>var gulp        = require('gulp'),     browserify  = require('browserify'),     source      = require('vinyl-source-stream');      gulp.task('bundle', function () {   var b = browserify('.tmp\/bootstrap.js');   return b.bundle()     .pipe(source('bundle.js'))     .pipe(gulp.dest('dist')); }); <\/code><\/pre>\n<p>  <a name=\"index-html\"><\/a>  <\/p>\n<h4><font color=\"#cc0000\">\u041a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 index.html<\/font><\/h4>\n<p>  \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u0440\u0430\u0431\u043e\u0442\u044b \u0441\u043e \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u043c\u0438 \u0444\u0430\u0439\u043b\u0430\u043c\u0438 \u0438 \u0438\u0445 \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0432 gulp \u043f\u0440\u0438\u0432\u0435\u0434\u0443 \u043f\u0440\u0438\u043c\u0435\u0440 gulp-\u0442\u0430\u0441\u043a\u0430 \u0434\u043b\u044f \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f <b>index.html<\/b> \u0432 \u043f\u0430\u043f\u043a\u0443 <b>dist<\/b>:<\/p>\n<pre><code>gulp.task('through', function () {   return gulp     .src(['src\/index.html'])     .pipe(gulp.dest('dist')); }); <\/code><\/pre>\n<p>  <a name=\"gulpfilejs-file\"><\/a>  <\/p>\n<h4><font color=\"#cc0000\">gulpfile.js \u0444\u0430\u0439\u043b<\/font><\/h4>\n<p>  \u0422\u043e\u0433\u0434\u0430 \u0432\u0435\u0441\u044c <b>gulpfile.js<\/b> \u0431\u0443\u0434\u0435\u043c \u0442\u0430\u043a\u0438\u043c:<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 gulpfile.js<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code>'use strict';  var gulp        = require('gulp'),     typescript  = require('typescript'),     ts          = require('gulp-typescript'),     browserify  = require('browserify'),     source      = require('vinyl-source-stream'),     del         = require('del');  var project = ts.createProject('src\/tsconfig.json', {typescript: typescript});  gulp.task('through', function () {   return gulp     .src(['src\/index.html'])     .pipe(gulp.dest('dist')); });  gulp.task('compile', function () {   var result = gulp.src('src\/**\/*{ts,tsx}')     .pipe(ts(project));   return result.js.pipe(gulp.dest('.tmp')); });  gulp.task('bundle', ['through','compile'], function () {   var b = browserify('.tmp\/bootstrap.js');   return b.bundle()     .pipe(source('bundle.js'))     .pipe(gulp.dest('dist'))   ; });  gulp.task('clean', function (done) {   del(['.tmp'], done.bind(this)); }); <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  <a name=\"typescript-definitions\"><\/a>  <\/p>\n<h3><font color=\"#cc0000\">TypeScript Definitions<\/font><\/h3>\n<p>  \u042f \u0441\u0435\u0439\u0447\u0430\u0441 \u043d\u0435 \u0431\u0443\u0434\u0443 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u043e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0438 TypeScript Definitions, \u043e\u0431 \u044d\u0442\u043e\u043c \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043e \u043c\u043d\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u043d\u044b\u0445 \u0441\u0442\u0430\u0442\u0435\u0439. \u0421\u043a\u0430\u0436\u0443 \u043b\u0438\u0448\u044c, \u0447\u0442\u043e \u0434\u043b\u044f \u0442\u043e\u0433\u043e \u0447\u0442\u043e\u0431\u044b \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0435 \u043d\u0430 JS \u0434\u043b\u044f \u043d\u0438\u0445 \u043d\u0443\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u0438 \u0441\u0430\u043c\u044b\u0435 TypeScript Definitions. \u0418 \u0435\u0441\u0442\u044c \u0434\u0430\u0436\u0435 \u0446\u0435\u043b\u044b\u0439 \u043e\u043f\u0435\u043d\u0441\u043e\u0440\u0441\u043d\u044b\u0439 \u043f\u0440\u043e\u0435\u043a\u0442 \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043d\u0430\u0440\u043e\u0434 \u043f\u0438\u0448\u0435\u0442 \u0442\u0430\u043a\u0438\u0435 \u0434\u0435\u0444\u0438\u043d\u0438\u0448\u0435\u043d\u044b \u0434\u043b\u044f \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432. \u0418\u0445 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043a\u0430\u0442\u044c \u0438 \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u0442\u044c \u043d\u0430 <a href=\"http:\/\/definitelytyped.org\/tsd\/\">\u0441\u0430\u0439\u0442\u0435<\/a>, \u0430 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043a\u043e\u043d\u0441\u043e\u043b\u044c\u043d\u0443\u044e \u0443\u0442\u0438\u043b\u0438\u0442\u0443 \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u044d\u0442\u043e\u0442 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0443\u043f\u0440\u043e\u0441\u0442\u0438\u0442:<\/p>\n<pre><code>npm install -g tsd <\/code><\/pre>\n<p>  \u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u044d\u0442\u043e\u0439 \u0443\u0442\u0438\u043b\u0438\u0442\u044b \u043c\u044b \u0441\u043a\u0430\u0447\u0430\u0435\u043c definitions \u0434\u043b\u044f React \u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u043c \u0432 \u0444\u0430\u0439\u043b <b>tsd.json<\/b> \u0437\u0430\u043f\u0438\u0441\u044c \u043e TypeScript Definition:<\/p>\n<pre><code>tsd query react --action install --save <\/code><\/pre>\n<p>  <\/p>\n<blockquote><p> <b>\u0417\u0430\u043c\u0435\u0442\u043a\u0430:<\/b><\/p>\n<p>  \u041f\u0440\u043e\u0435\u043a\u0442 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 open-source, \u0440\u0430\u0437\u0432\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0438 \u0430\u043a\u0442\u0438\u0432\u043d\u043e \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0441\u043e\u043e\u0431\u0449\u0435\u0441\u0442\u0432\u043e\u043c \u2014 <a href=\"https:\/\/github.com\/borisyankov\/DefinitelyTyped\">borisyankov\/DefinitelyTyped<\/a>.  <\/p><\/blockquote>\n<p>  <a name=\"tsconfigjson\"><\/a>  <\/p>\n<h3><font color=\"#cc0000\">\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 tsconfig.json<\/font><\/h3>\n<p>  \u0424\u0430\u0439\u043b <b>tsconfig.json<\/b> \u0445\u0440\u0430\u043d\u0438\u0442 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 \u0434\u043b\u044f \u0432\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430. \u0422\u0430\u043a\u043e\u0439 \u0444\u0430\u0439\u043b \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u043e\u043c \u043d\u0430\u0447\u0438\u043d\u0430\u044f \u0441 \u0432\u0435\u0440\u0441\u0438\u0438 1.5. \u041c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 <b>tsconfig.json<\/b>, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0438\u0439 \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0444\u0430\u0439\u043b\u044b \u0434\u043b\u044f React\/JSX \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<pre><code class=\"javascript\">{    &quot;compilerOptions&quot; :  {      &quot;module&quot; :  &quot;umd&quot;,      &quot;jsx&quot; :  &quot;react&quot;    }  } <\/code><\/pre>\n<p>  <a name=\"react-code\"><\/a>  <\/p>\n<h2><font color=\"#cc0000\">React-\u043a\u043e\u0434<\/font><\/h2>\n<p>  \u0414\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u0440\u0430\u0431\u043e\u0442\u044b \u0441\u0432\u044f\u0437\u043a\u0438 TypeScript + React \u043c\u044b \u043d\u0430\u043f\u0438\u0448\u0435\u043c \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 todo \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435.<\/p>\n<p>  <a name=\"todoitem-tsx\"><\/a>  <\/p>\n<h3><font color=\"#cc0000\">todoItem.tsx \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442<\/font><\/h3>\n<p>  \u041d\u0430\u0447\u043d\u0451\u043c \u0441 \u0441\u0430\u043c\u043e\u0433\u043e \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u043e\u0433\u043e \u043a\u0438\u0440\u043f\u0438\u0447\u0438\u043a\u0430, \u0430 \u0438\u043c\u0435\u043d\u043d\u043e \u2014 TodoItem. \u0414\u043e\u0431\u0430\u0432\u0438\u043c TypeScript Definition \u0434\u043b\u044f React \u0432 \u043d\u0430\u0447\u0430\u043b\u043e \u0444\u0430\u0439\u043b\u0430:<\/p>\n<pre><code class=\"javascript\">\/\/\/ &lt;reference path=&quot;..\/..\/typings\/react\/react.d.ts&quot; \/&gt; <\/code><\/pre>\n<p>  \u0417\u0430\u0442\u0435\u043c \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c React \u0432 \u043d\u0430\u0448 \u043a\u043b\u0430\u0441\u0441:  <\/p>\n<pre><code class=\"javascript\">import * as React from 'react'; <\/code><\/pre>\n<p>  \u041e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 <strong>ITodo<\/strong> \u0434\u043b\u044f \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430:<\/p>\n<pre><code class=\"javascript\">interface ITodo {     description: string; } <\/code><\/pre>\n<p>  \u0410 \u0442\u0430\u043a\u0436\u0435 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u044b \u0434\u043b\u044f \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f \u0438 \u0441\u0432\u043e\u0439\u0441\u0442\u0432 \u043d\u0430\u0448\u0435\u0433\u043e \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430:  <\/p>\n<pre><code class=\"javascript\">export interface ITodoItemState {}  export interface ITodoItemProps {     item: ITodo;     onRemove?: (todo: ITodo) =&gt; any;     key?: number; } <\/code><\/pre>\n<p>  \u0422\u043e\u0433\u0434\u0430 \u0441\u0430\u043c \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<pre><code class=\"javascript\">export class TodoItem extends React.Component&lt;ITodoItemProps, ITodoItemState&gt; {     constructor () {         super();         this.removeItem = this.removeItem.bind(this);     }      removeItem () {         this.props.onRemove(this.props.item);     }      render () {         return (             &lt;li&gt;               &lt;span&gt; {this.props.item.description} &lt;\/span&gt;               &lt;button onClick={this.removeItem} &gt;delete&lt;\/button&gt;             &lt;\/li&gt;         );     } } <\/code><\/pre>\n<p>  <a name=\"main-tsx\"><\/a>  <\/p>\n<h3><font color=\"#cc0000\">main.tsx \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442<\/font><\/h3>\n<p>  \u0414\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u043e\u0441\u043d\u043e\u0432\u043d\u0443\u044e \u043b\u043e\u0433\u0438\u043a\u0443 \u0440\u0430\u0431\u043e\u0442\u044b \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u041f\u0440\u0438\u043d\u0446\u0438\u043f \u0442\u043e\u0442 \u0436\u0435, \u0447\u0442\u043e \u0438 \u0432 TodoItem \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0435, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0440\u0438\u0432\u0435\u0434\u0443 \u043f\u043e\u043b\u043d\u044b\u0439 \u043b\u0438\u0441\u0442\u0438\u043d\u0433 \u0444\u0430\u0439\u043b\u0430:<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">main.tsx<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"javascript\">\/\/\/ &lt;reference path=&quot;..\/..\/typings\/react\/react.d.ts&quot; \/&gt;  import * as React from 'react'; import {TodoItem} from '.\/todoItem';  interface ITodo {     description: string;     key: number; }  export interface IMainState {     newItem?: {         description: string;     };     todoList?: ITodo[]; }  export interface IMainProps {}  export class Main extends React.Component&lt;IMainProps, IMainState&gt; {      state: IMainState = {newItem: {description: ''}, todoList: []}      constructor () {         super();         this.changeName = this.changeName.bind(this);         this.addItem = this.addItem.bind(this);         this.removeItem = this.removeItem.bind(this);     }      changeName (e: any) {         this.setState({             newItem: {                 description: e.target.value             }         });     }      addItem () {         var list = this.state.todoList;         list.push({             description: this.state.newItem.description,             key: new Date().getTime()         });         this.setState({             todoList: list,             newItem: {description: ''}         });     }      removeItem (item: ITodo) {         var list = this.state.todoList.filter(i =&gt; i.key !== item.key);         this.setState({todoList: list});     }      render () {         var todoItems = this.state.todoList.map(item =&gt; {             return &lt;TodoItem key={item.key} item={item} onRemove={this.removeItem} &gt;&lt;\/TodoItem&gt;;         });         return (             &lt;div&gt;                 &lt;div&gt;                     &lt;input type=&quot;text&quot; placeholder=&quot;input new item&quot; value={this.state.newItem.description} onChange={this.changeName} \/&gt;                     &lt;button onClick={this.addItem} &gt;add&lt;\/button&gt;                 &lt;\/div&gt;                 &lt;ul&gt;{todoItems}&lt;\/ul&gt;             &lt;\/div&gt;         );     } } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  <a name=\"bootstrap-ts\"><\/a>  <\/p>\n<h3><font color=\"#cc0000\">bootstrap.ts<\/font><\/h3>\n<p>  \u0414\u0430\u043d\u043d\u044b\u0439 \u0444\u0430\u0439\u043b \u0441\u043b\u0443\u0436\u0438\u0442 \u0442\u043e\u0447\u043a\u043e\u0439 \u0434\u043b\u044f \u0441\u0442\u0430\u0440\u0442\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0438 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043b\u043e\u0433\u0438\u043a\u0443 \u0434\u043b\u044f \u0432\u044b\u0437\u043e\u0432\u0430 \u043e\u0441\u043d\u043e\u0432\u043e\u0433\u043e \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430:<\/p>\n<pre><code class=\"javascript\">\/\/\/ &lt;reference path=&quot;..\/typings\/react\/react.d.ts&quot; \/&gt;  import * as React from 'react'; import {Main} from '.\/Main\/main';  React.render(React.createElement(Main), document.getElementById('main')); <\/code><\/pre>\n<p>  <a name=\"index-html-source\"><\/a>  <\/p>\n<h3><font color=\"#cc0000\">index.html<\/font><\/h3>\n<p>  \u0422\u0430\u043a \u043a\u0430\u043a \u043c\u044b \u043d\u0435 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u043b\u044f\u043b\u0438 \u043d\u0438\u043a\u0430\u043a\u0438\u0445 \u0441\u0442\u0438\u043b\u0435\u0439 \u0438 \u0442\u0434, \u0442\u043e \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u0444\u0430\u0439\u043b\u0430 \u0431\u0443\u0434\u0435\u0442 \u0442\u0430\u043a\u0438\u043c:<\/p>\n<pre><code class=\"html\">&lt;!DOCTYPE html&gt; &lt;html&gt;     &lt;head&gt;         &lt;meta charset=&quot;UTF-8&quot;&gt;         &lt;title&gt;tsc-react-example&lt;\/title&gt;     &lt;\/head&gt;     &lt;body&gt;         &lt;div id=&quot;main&quot;&gt;&lt;\/div&gt;         &lt;script src=&quot;bundle.js&quot;&gt;&lt;\/script&gt;     &lt;\/body&gt; &lt;\/html&gt; <\/code><\/pre>\n<p>  <a name=\"run-and-fun\"><\/a>  <\/p>\n<h2><font color=\"#cc0000\">\u0417\u0430\u043f\u0443\u0441\u043a \u0438 \u0444\u0435\u0439\u0435\u0440\u0432\u0435\u0440\u043a\u0438<\/font><\/h2>\n<p>  <a name=\"install\"><\/a>  <\/p>\n<h3><font color=\"#cc0000\">\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0438 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u044f<\/font><\/h3>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e \u043a\u0430\u043a \u0431\u044b\u043b\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u044b \u0432\u0441\u0435 \u0444\u0430\u0439\u043b\u044b, \u043f\u0430\u043f\u043a\u0438 \u0438 \u0442\u0430\u0441\u043a\u0438, \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u043c:<\/p>\n<pre><code>npm install <\/code><\/pre>\n<p>  \u0434\u043b\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0432\u0441\u0435\u0445 \u043f\u0430\u043a\u0435\u0442\u043e\u0432 \u0438:  <\/p>\n<pre><code>gulp bundle <\/code><\/pre>\n<p>  \u0434\u043b\u044f \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 \u043d\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f.<\/p>\n<p>  <a name=\"http-server\"><\/a>  <\/p>\n<h3><font color=\"#cc0000\">\u0417\u0430\u043f\u0443\u0441\u043a<\/font><\/h3>\n<p>  \u0422\u0443\u0442 \u0432\u0441\u0451 \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0437\u0430\u0438\u0447\u043d\u043e \u2014 \u043d\u0430\u0442\u0440\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u043b\u044e\u0431\u0438\u043c\u044b\u0439 \u0441\u0435\u0440\u0432\u0435\u0440 \u043d\u0430 \u043f\u0430\u043f\u043a\u0443 <strong>dist<\/strong> \u0438 \u0440\u0430\u0434\u0443\u0435\u043c\u0441\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430\u043c, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0442\u0430\u043a:<\/p>\n<pre><code>cd dist npm install -g http-server http-server -p 3000 <\/code><\/pre>\n<p>  \u0417\u0430\u0442\u0435\u043c \u0438\u0434\u0451\u043c \u043d\u0430 <strong>localhost:3000\/index.html<\/strong> \u0438 \u0442\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u043c.<\/p>\n<p>  <a name=\"end\"><\/a>  <\/p>\n<h2><font color=\"#cc0000\">\u0412\u043c\u0435\u0441\u0442\u043e \u0437\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f<\/font><\/h2>\n<p>  \u0412\u0435\u0441\u044c \u043a\u043e\u0434 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0439 \u0432 \u044d\u0442\u043e\u043c \u043c\u0438\u043d\u0438-\u0433\u0430\u0439\u0434\u0435 \u043c\u043e\u0436\u043d\u043e <a href=\"https:\/\/github.com\/forcewake\/tsc-react-gulp-example\">\u043d\u0430\u0439\u0442\u0438 \u043f\u043e \u0441\u0441\u044b\u043b\u043a\u0435<\/a>. \u041b\u044e\u0431\u044b\u0435 \u0437\u0430\u043c\u0435\u0447\u0430\u043d\u0438\u044f \u0438 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0438\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0442\u0441\u044f.<\/p>\n<p>  \u0421\u043f\u0430\u0441\u0438\u0431\u043e \u0437\u0430 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435.<\/p>\n<p>  Happy coding!       <\/p>\n<div class=\"clear\"><\/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=\"http:\/\/habrahabr.ru\/post\/266665\/\"> http:\/\/habrahabr.ru\/post\/266665\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>       \u041d\u0435 \u0442\u0430\u043a \u0434\u0430\u0432\u043d\u043e Microsoft <a href=\"http:\/\/blogs.msdn.com\/b\/typescript\/archive\/2015\/09\/02\/announcing-typescript-1-6-beta-react-jsx-better-error-checking-and-more.aspx\">\u043e\u0431\u044a\u044f\u0432\u0438\u043b\u0430 \u043e \u0432\u044b\u043f\u0443\u0441\u043a\u0435 TypeScript 1.6 Beta<\/a>, \u043e\u0434\u043d\u0438\u043c \u0438\u0437 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0445, \u043d\u0430 \u043c\u043e\u0439 \u0432\u0437\u0433\u043b\u044f\u0434, \u043d\u043e\u0432\u043e\u0432\u0432\u0435\u0434\u0435\u043d\u0438\u0435\u043c \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 React\/JSX, \u0447\u0442\u043e \u0432 \u0441\u043e\u0432\u043e\u043a\u0443\u043f\u043d\u043e\u0441\u0442\u0438 \u0441 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044f\u043c\u0438 TypeScript&#8217;\u0430 \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u0442 \u043d\u043e\u0432\u044b\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/712\/71b\/f94\/71271bf94cb442c29578df43ee6844c9.jpg\"\/><\/p>\n<p>  \u042f \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u043e \u043b\u0438\u0447\u043d\u043e\u043c \u043e\u043f\u044b\u0442\u0435 \u2014 \u043a\u0430\u043a \u043d\u0430\u0447\u0430\u043b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u0432\u044f\u0437\u043a\u0443 TypeScript + React, \u0441 \u043a\u0430\u043a\u0438\u043c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430\u043c\u0438 \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0441\u044f \u0438 \u043a\u0430\u043a \u0438\u0445 \u0440\u0435\u0448\u0430\u043b. \u0410 \u0442\u0430\u043a \u0436\u0435 \u043f\u043e\u043a\u0430\u0436\u0443 \u043f\u0440\u0438\u043c\u0435\u0440\u044b gulp-\u0442\u0430\u0441\u043a\u043e\u0432 \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u044d\u0442\u043e \u0432\u0441\u0435 \u0437\u0430\u0440\u0430\u0431\u043e\u0442\u0430\u043b\u043e \u0438 \u043f\u0440\u043e\u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0438\u0440\u0443\u044e \u043a\u043e\u0434 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0433\u043e todo \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043d\u0430 TypeScript + React (<a href=\"https:\/\/github.com\/forcewake\/tsc-react-gulp-example\">\u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 Github<\/a>).<\/p>\n<p>  \u0415\u0441\u043b\u0438 \u0432\u0430\u043c \u044d\u0442\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e \u2014 \u043f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430, \u0437\u0430\u0445\u043e\u0434\u0438\u0442\u0435 \u043f\u043e\u0434 \u043a\u0430\u0442.  <\/p>\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-265436","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/265436","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=265436"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/265436\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=265436"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=265436"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=265436"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}