本文目錄一覽:
- 1、如何單獨下載ui.core.js
- 2、react native gradle怎麼升級
- 3、別用babel-polyfill了,教你用core-js@3兼容IE瀏覽器
- 4、關於網站首頁與子頁面是否加載同一個js文件的問題
- 5、如何升級nodejs版本
如何單獨下載ui.core.js
在jQuery ui的官網頁面 有勾選項的。只勾選core那項就可以了。把其他的勾選去掉然後下載
react native gradle怎麼升級
更新版本的React Native將會讓你訪問更多的APIs, 這樣我們可以去使用更多的APIs,視圖Views,以及開發者工具以及其他一些好用的東西。瀏覽版本更新日誌就會發現整體FB官方開發進度還是非常緊張的,這樣就很容易導致舊版本會出現不能用的情況,後期可能會出現不可預料的情況,這邊建議大家盡量更新最新正式版本。
我們大家都知道一個React Native項目使用Android項目,iOS項目和JavaScript項目三部分進行組成的,而且三者都關聯打包在npm包內的,所以該項目版本進行更新是比較繁瑣的。下面我來給大家講解一下React Native項目的升級步驟。
一、查看當前版本
[plain] view plain copy
span style=”font-family:SimSun;font-size:14px;”pengchengxiang@ubuntu:~/AwesomeProject$ react-native –version
react-native-cli: 0.2.0
react-native: 0.22.2/span
二、查看最新的版本
[plain] view plain copy
span style=”font-family:SimSun;font-size:14px;”pengchengxiang@ubuntu:~/AwesomeProject$ npm info react-native
{ name: ‘react-native’,
‘dist-tags’: { latest: ‘0.25.1’, next: ‘0.26.0-rc’ },
versions:
[ ‘0.0.0’,
‘0.0.5’,
… …
‘0.24.1’,
‘0.25.0-rc’,
‘0.25.1’,
‘0.26.0-rc’ ],
maintainers:
… …
dist:
{ shasum: ‘4177e70e56281cec8fb5fe76218bf6606eeb34b8’,
tarball: ” },
directories: {} }/span
三、升級依賴的版本
[plain] view plain copy
span style=”font-family:SimSun;font-size:14px;”pengchengxiang@ubuntu:~/AwesomeProject$ npm install –save react-native@0.25.1
bufferutil@1.2.1 install /home/pengchengxiang/AwesomeProject/node_modules/react-native/node_modules/ws/node_modules/bufferutil
node-gyp rebuild
make: Entering directory `/home/pengchengxiang/AwesomeProject/node_modules/react-native/node_modules/ws/node_modules/bufferutil/build’
CXX(target) Release/obj.target/bufferutil/src/bufferutil.o
SOLINK_MODULE(target) Release/obj.target/bufferutil.node
COPY Release/bufferutil.node
make: Leaving directory `/home/pengchengxiang/AwesomeProject/node_modules/react-native/node_modules/ws/node_modules/bufferutil/build’
utf-8-validate@1.2.1 install /home/pengchengxiang/AwesomeProject/node_modules/react-native/node_modules/ws/node_modules/utf-8-validate
node-gyp rebuild
make: Entering directory `/home/pengchengxiang/AwesomeProject/node_modules/react-native/node_modules/ws/node_modules/utf-8-validate/build’
CXX(target) Release/obj.target/validation/src/validation.o
SOLINK_MODULE(target) Release/obj.target/validation.node
COPY Release/validation.node
make: Leaving directory `/home/pengchengxiang/AwesomeProject/node_modules/react-native/node_modules/ws/node_modules/utf-8-validate/build’
spawn-sync@1.0.15 postinstall /home/pengchengxiang/AwesomeProject/node_modules/react-native/node_modules/yeoman-generator/node_modules/cross-spawn/node_modules/spawn-sync
node postinstall
npm WARN optional dep failed, continuing fsevents@1.0.12
react-native@0.25.1 node_modules/react-native
├── regenerator-runtime@0.9.5
├── react-clone-referenced-element@1.0.1
├── absolute-path@0.0.0
├── graceful-fs@4.1.3
├── progress@1.1.8
├── stacktrace-parser@0.1.3
├── base64-js@0.0.8
├── event-target-shim@1.1.1
├── wordwrap@1.0.0
├── react-timer-mixin@0.13.3
├── immutable@3.7.6
├── semver@5.1.0
├── image-size@0.3.5
├── opn@3.0.3 (object-assign@4.1.0)
├── bser@1.0.2 (node-int64@0.4.0)
├── debug@2.2.0 (ms@0.7.1)
├── json-stable-stringify@1.0.1 (jsonify@0.0.0)
├── temp@0.8.3 (os-tmpdir@1.0.1, rimraf@2.2.8)
├── chalk@1.1.3 (escape-string-regexp@1.0.5, ansi-styles@2.2.1, supports-color@2.0.0, has-ansi@2.0.0, strip-ansi@3.0.1)
├── source-map@0.4.4 (amdefine@1.0.0)
├── mkdirp@0.5.1 (minimist@0.0.8)
├── rebound@0.0.13
├── optimist@0.6.1 (wordwrap@0.0.3, minimist@0.0.10)
├── worker-farm@1.3.1 (xtend@4.0.1, errno@0.1.4)
├── promise@7.1.1 (asap@2.0.3)
├── node-haste@2.9.6 (throat@2.0.2, denodeify@1.2.1)
├── sane@1.3.4 (fb-watchman@1.9.0, watch@0.10.0, minimist@1.2.0, exec-sh@0.2.0, minimatch@0.2.14, walker@1.0.7)
├── yargs@3.32.0 (decamelize@1.2.0, y18n@3.2.1, camelcase@2.1.1, window-size@0.1.4, cliui@3.2.0, string-width@1.0.1, os-locale@1.4.0)
├── node-fetch@1.5.1 (is-stream@1.1.0, encoding@0.1.12)
├── art@0.10.1
├── ws@0.8.1 (options@0.0.6, ultron@1.0.2, bufferutil@1.2.1, utf-8-validate@1.2.1)
├── json5@0.4.0
├── uglify-js@2.6.2 (async@0.2.10, uglify-to-browserify@1.0.2, source-map@0.5.6, yargs@3.10.0)
├── connect@2.30.2 (bytes@2.1.0, cookie-signature@1.0.6, utils-merge@1.0.0, content-type@1.0.1, on-headers@1.0.1, pause@0.1.0, fresh@0.3.0, parseurl@1.3.1, response-time@2.3.1, vhost@3.0.2, basic-auth-connect@1.0.0, cookie@0.1.3, cookie-parser@1.3.5, depd@1.0.1, qs@4.0.0, method-override@2.3.5, connect-timeout@1.6.2, serve-favicon@2.3.0, http-errors@1.3.1, morgan@1.6.1, finalhandler@0.4.0, express-session@1.11.3, type-is@1.6.12, csurf@1.8.3, serve-static@1.10.2, multiparty@3.3.2, errorhandler@1.4.3, compression@1.5.2, body-parser@1.13.3, serve-index@1.7.3)
├── jstransform@11.0.3 (object-assign@2.1.1, base62@1.1.1, esprima-fb@15001.1.0-dev-harmony-fb, commoner@0.10.4)
├── module-deps@3.9.1 (browser-resolve@1.11.1, through2@1.1.1, inherits@2.0.1, defined@1.0.0, duplexer2@0.0.2, xtend@4.0.1, concat-stream@1.4.10, parents@1.0.1, readable-stream@1.1.14, subarg@1.0.0, stream-combiner2@1.0.2, JSONStream@1.1.1, resolve@1.1.7, detective@4.3.1)
├── babel-plugin-external-helpers@6.8.0 (babel-runtime@6.6.1)
├── babel-register@6.8.0 (path-exists@1.0.0, home-or-tmp@1.0.0, source-map-support@0.2.10, babel-runtime@6.6.1)
├── babel-polyfill@6.8.0 (babel-regenerator-runtime@6.5.0, babel-runtime@6.6.1)
├── babel-types@6.8.1 (to-fast-properties@1.0.2, esutils@2.0.2, babel-traverse@6.8.0, babel-runtime@6.6.1)
├── babel-core@6.8.0 (slash@1.0.0, babel-messages@6.8.0, babel-template@6.8.0, shebang-regex@1.0.0, path-exists@1.0.0, path-is-absolute@1.0.0, babel-helpers@6.8.0, private@0.1.6, convert-source-map@1.2.0, babel-code-frame@6.8.0, source-map@0.5.6, minimatch@2.0.10, babel-generator@6.8.0, babel-traverse@6.8.0, babel-runtime@6.6.1)
├── babylon@6.8.0 (babel-runtime@6.6.1)
├── joi@6.10.1 (topo@1.1.0, isemail@1.2.0, hoek@2.16.3, moment@2.13.0)
├── lodash@3.10.1
├── fbjs@0.7.2 (ua-parser-js@0.7.10, loose-envify@1.1.0, isomorphic-fetch@2.2.1, core-js@1.2.6)
├── fbjs-scripts@0.4.0 (object-assign@4.1.0, through2@2.0.1, gulp-util@3.0.7, core-js@1.2.6, babel@5.8.38)
├── core-js@2.3.0
├── yeoman-environment@1.6.1 (escape-string-regexp@1.0.5, log-symbols@1.0.2, text-table@0.2.0, untildify@2.1.0, diff@2.2.2, mem-fs@1.1.2, globby@4.0.0, grouped-queue@0.3.2, inquirer@1.0.2, lodash@4.11.2)
├── react-transform-hmr@1.0.4 (global@4.3.0, react-proxy@1.1.8)
├── yeoman-generator@0.20.3 (detect-conflict@1.0.0, read-chunk@1.0.1, path-exists@1.0.0, yeoman-welcome@1.0.1, path-is-absolute@1.0.0, async@1.5.2, mime@1.3.4, text-table@0.2.0, class-extend@0.1.2, dargs@4.1.0, user-home@2.0.0, xdg-basedir@2.0.0, istextorbinary@1.0.2, nopt@3.0.6, diff@2.2.2, run-async@0.1.0, cli-table@0.3.1, shelljs@0.5.3, yeoman-assert@2.2.1, through2@2.0.1, glob@5.0.15, findup-sync@0.2.1, rimraf@2.5.2, mem-fs-editor@2.2.0, cross-spawn@2.2.3, underscore.string@3.3.4, sinon@1.17.4, pretty-bytes@2.0.1, github-username@2.1.0, dateformat@1.0.12, download@4.4.3, html-wiring@1.2.0, inquirer@0.8.5, gruntfile-editor@1.2.0)
└── babel-preset-react-native@1.7.0 (babel-plugin-syntax-flow@6.8.0, babel-plugin-syntax-async-functions@6.8.0, babel-plugin-transform-es2015-template-literals@6.8.0, babel-plugin-transform-class-properties@6.8.0, babel-plugin-syntax-class-properties@6.8.0, babel-plugin-transform-es2015-arrow-functions@6.8.0, babel-plugin-transform-es2015-destructuring@6.8.0, babel-plugin-transform-es2015-shorthand-properties@6.8.0, babel-plugin-transform-es2015-spread@6.8.0, babel-plugin-transform-flow-strip-types@6.8.0, babel-plugin-transform-es2015-for-of@6.8.0, babel-plugin-transform-react-display-name@6.8.0, babel-plugin-syntax-jsx@6.8.0, babel-plugin-check-es2015-constants@6.8.0, babel-plugin-transform-es2015-function-name@6.8.0, babel-plugin-transform-es2015-computed-properties@6.8.0, babel-plugin-transform-react-jsx@6.8.0, babel-plugin-transform-object-rest-spread@6.8.0, babel-plugin-transform-es2015-modules-commonjs@6.8.0, babel-plugin-transform-es2015-block-scoping@6.8.0, babel-plugin-transform-object-assign@6.8.0, babel-plugin-transform-es2015-parameters@6.8.0, babel-plugin-transform-es2015-classes@6.8.0, babel-plugin-syntax-trailing-function-commas@6.8.0, babel-plugin-transform-regenerator@6.8.0, babel-plugin-react-transform@2.0.2)/span
別用babel-polyfill了,教你用core-js@3兼容IE瀏覽器
最近新啟動了個pc端的項目,項目要求兼容IE,想必各位前端都清楚,要想拿下IE這個破地,必須用上babel。
個人平時對這方面也沒有過分的關注,於是乎各種網上尋找解決方案,這一找,發現有時候網絡就跟個歷史博物館一樣,大部分問題的解決方案基本都是過時了的。通篇看下來,基本全是推薦使用 babel-polyfill 的,於是我上npm看了下,發現這個插件最後一次提交是3年前。
然後在入口文件中加入以下內容:
再運行後,你會發現IE瀏覽器再也不會只能出來個標題,頁面一片空白了。
怎麼樣?是不是很簡單!
關於網站首頁與子頁面是否加載同一個js文件的問題
相同的文件客戶端只會向服務器請求一次,不必擔心這個,增加服務器負載的是你的頁面中的文件的多少,大小,順序,不同請求的次數和一些其他的問題
如何升級nodejs版本
首先安裝n模塊:
npm install -g n
第二步:
升級node.js到最新穩定版
n stable
是不是很簡單?
n後面也可以跟隨版本號比如:
n v0.10.26
或
n 0.10.26
分享幾個npm的常用命令
npm -v #顯示版本,檢查npm 是否正確安裝。
npm install express #安裝express模塊
npm install -g express #全局安裝express模塊
npm list #列出已安裝模塊
npm show express #顯示模塊詳情
npm update #升級當前目錄下的項目的所有模塊
npm update express #升級當前目錄下的項目的指定模塊
npm update -g express #升級全局安裝的express模塊
npm uninstall express #刪除指定的模塊
原創文章,作者:小藍,如若轉載,請註明出處:https://www.506064.com/zh-hant/n/278893.html