@aacassandra/vue-parse-sdk 中文文档教程
Parse SDK for JavaScript
一个库,可让您从 JavaScript 应用程序访问强大的 Parse Server 后端。
有关 Parse 及其功能的更多信息,请参阅网站,JavaScript 指南、Cloud Code 指南 或 API 参考。
Getting Started
将 Parse SDK 集成到您的 JavaScript 项目中的最简单方法是通过 npm 模块。 但是,如果你想使用预编译文件,你可以从 unpkg 获取它。 开发版本可在 https://unpkg.com/parse/dist/parse.js 获取,缩小生产版本位于 https://unpkg.com/parse/dist/parse.min.js .
Using Parse on Different Platforms
JavaScript 生态系统广泛,包含大量平台和执行环境。 为了解决这个问题,Parse npm 模块包含专门为在 Node.js 和 React Native 环境中使用而定制的特殊版本的 SDK . 并非所有功能在所有环境中都有意义,因此使用适当的包将确保本地存储、用户会话和 HTTP 请求等项目使用适当的依赖项。 对于服务器端呈现的应用程序,您可以设置 SERVER_RENDERING
变量以防止在运行时出现警告。
要将 npm 模块用于基于浏览器的应用程序,请像往常一样包含它:
const Parse = require('parse');
对于服务器端应用程序或 Node.js 命令行工具,包含 'parse/node'
:
// In a node.js environment
const Parse = require('parse/node');
对于 React Native 应用程序, include 'parse/react-native'
:
// In a React Native application
const Parse = require('parse/react-native');
// On React Native >= 0.50 and Parse >= 1.11.0, set the Async
const AsyncStorage = require('react-native').AsyncStorage;
Parse.setAsyncStorage(AsyncStorage);
对于微信小程序,include 'parse/weapp'
:
// In a WeChat miniprogram
const Parse = require('parse/weapp');
如果要使用预编译文件,可以从解包。 开发版本可在 https://unpkg.com/parse/dist/parse.weapp.js,缩小生产版本位于 https://unpkg.com/parse/dist/parse.weapp .min.js。
对于 TypeScript 应用程序,安装 '@types/parse'
:
$ npm install @types/parse
每次发布后都会手动更新类型。 如果定义不存在,请向 @types/parse 提交请求并
Upgrading to Parse SDK 2.0.0
解析SDK 2.0.0,主干样式回调和 Parse.Promises 消失了。
我们策划了一份迁移指南,可以帮助您迁移代码。
Want to ride the bleeding edge?
我们建议使用发布到 npm 的最新标记构建进行生产。 但是,您可以通过引用 package.json
中的特定分支来测试尚未发布的 Parse-SDK-JS 版本。 例如,要使用 master 分支:
npm install parse-community/Parse-SDK-JS.git#master
Experimenting
您也可以使用自己的分支,并通过指定它们进行工作分支:
npm install github:myUsername/Parse-SDK-JS#my-awesome-feature
不要忘记,如果您打算远程部署它,您应该运行 npm install 与
--save
选项。
Contributing
我们真的希望 Parse 成为你的,看到它在开源社区中成长壮大。 请参阅Contributing to Parse Javascript SDK guide。
License
Copyright (c) 2015-present, Parse, LLC.
All rights reserved.
This source code is licensed under the BSD-style license found in the
LICENSE file in the root directory of this source tree. An additional grant
of patent rights can be found in the PATENTS file in the same directory.
自 2017 年 4 月 5 日起,Parse, LLC 已将此代码转移到解析社区组织,并且将不再贡献或分发此代码。
[开放集体链接]:https://opencollective.com/parse-server
Parse SDK for JavaScript
A library that gives you access to the powerful Parse Server backend from your JavaScript app.
For more information on Parse and its features, see the website, the JavaScript guide, the Cloud Code guide or API Reference.
Getting Started
The easiest way to integrate the Parse SDK into your JavaScript project is through the npm module. However, if you want to use a pre-compiled file, you can fetch it from unpkg. The development version is available at https://unpkg.com/parse/dist/parse.js, and the minified production version is at https://unpkg.com/parse/dist/parse.min.js.
Using Parse on Different Platforms
The JavaScript ecosystem is wide and incorporates a large number of platforms and execution environments. To handle this, the Parse npm module contains special versions of the SDK tailored to use in Node.js and React Native environments. Not all features make sense in all environments, so using the appropriate package will ensure that items like local storage, user sessions, and HTTP requests use appropriate dependencies. For server side rendered applications, you may set the SERVER_RENDERING
variable to prevent warnings at runtime.
To use the npm modules for a browser based application, include it as you normally would:
const Parse = require('parse');
For server-side applications or Node.js command line tools, include 'parse/node'
:
// In a node.js environment
const Parse = require('parse/node');
For React Native applications, include 'parse/react-native'
:
// In a React Native application
const Parse = require('parse/react-native');
// On React Native >= 0.50 and Parse >= 1.11.0, set the Async
const AsyncStorage = require('react-native').AsyncStorage;
Parse.setAsyncStorage(AsyncStorage);
For WeChat miniprogram, include 'parse/weapp'
:
// In a WeChat miniprogram
const Parse = require('parse/weapp');
If you want to use a pre-compiled file, you can fetch it from unpkg. The development version is available at https://unpkg.com/parse/dist/parse.weapp.js, and the minified production version is at https://unpkg.com/parse/dist/parse.weapp.min.js.
For TypeScript applications, install '@types/parse'
:
$ npm install @types/parse
Types are updated manually after every release. If a definition doesn't exist, please submit a pull request to @types/parse
Upgrading to Parse SDK 2.0.0
With Parse SDK 2.0.0, gone are the backbone style callbacks and Parse.Promises.
We have curated a migration guide that should help you migrate your code.
Want to ride the bleeding edge?
We recommend using the most recent tagged build published to npm for production. However, you can test not-yet-released versions of the Parse-SDK-JS by referencing specific branches in your package.json
. For example, to use the master branch:
npm install parse-community/Parse-SDK-JS.git#master
Experimenting
You can also use your own forks, and work in progress branches by specifying them:
npm install github:myUsername/Parse-SDK-JS#my-awesome-feature
And don't forget, if you plan to deploy it remotely, you should run npm install
with the --save
option.
Contributing
We really want Parse to be yours, to see it grow and thrive in the open source community. Please see the Contributing to Parse Javascript SDK guide.
License
Copyright (c) 2015-present, Parse, LLC.
All rights reserved.
This source code is licensed under the BSD-style license found in the
LICENSE file in the root directory of this source tree. An additional grant
of patent rights can be found in the PATENTS file in the same directory.
As of April 5, 2017, Parse, LLC has transferred this code to the parse-community organization, and will no longer be contributing to or distributing this code.
[open-collective-link]: https://opencollective.com/parse-server