瀏覽代碼

Merge branch 'master' of https://github.com/ckeditor/ckeditor5

Anna Tomanek 8 年之前
父節點
當前提交
e130cc0fbe

+ 4 - 2
docs/builds/guides/development/custom-builds.md

@@ -37,6 +37,8 @@ git remote add upstream https://github.com/ckeditor/ckeditor5-build-classic.git
 
 <info-box hint>
 	If you do not want to fork the official build, you can just clone it. However, you will not be able to commit and push your customizations back to GitHub.
+
+	Alternatively, instead of creating a custom build you can {@link builds/guides/integration/advanced-setup#Scenario-2-Building-from-source integrate CKEditor 5 directly from source}. This option allows even greater flexibility and requires less overhead (you will not need to fork the official build).
 </info-box>
 
 ## Build anatomy
@@ -132,7 +134,7 @@ If you want to skip updating the entry file (in case you modified it manually),
 npm run build-ckeditor
 ```
 
-You can validate whether your new build works by opening the `sample/index.html` file in a browser (via HTTPS, not as a local file). Make sure to **clear the cache**.
+You can validate whether your new build works by opening the `sample/index.html` file in a browser (via HTTP, not as a local file). Make sure to **clear the cache**.
 
 ## Updating the build
 
@@ -151,6 +153,6 @@ You should handle eventual conflicts and verify the merged changes. After that,
 
 ## Publishing your builds
 
-If you think that your custom builds can be useful to others, it is a great idea to publish them on GitHub and npm. When doing so, just be sure to give them meaningful names that would fit the `ckeditor5-build-(the name)` pattern, making them easy to find. To avoid conflicts with other existing builds you can use [scoped packages](https://docs.npmjs.com/misc/scope). We also recommend using the "ckeditor5-build" [keyword](https://docs.npmjs.com/files/package.json#keywords) to make your build [easier to find](https://www.npmjs.com/search?q=keywords:ckeditor5-build&page=1&ranking=optimal).
+If you think that your custom builds can be useful to others, it is a great idea to publish them on GitHub and npm. When doing so, just be sure to give them meaningful names that would fit the `ckeditor5-build-(the name)` pattern, making them easy to find. To avoid conflicts with other existing builds you can use [scoped packages](https://docs.npmjs.com/misc/scope). We also recommend using the "ckeditor5" and "ckeditor5-build" [keywords](https://docs.npmjs.com/files/package.json#keywords) to make your build [easier to find](https://www.npmjs.com/search?q=keywords:ckeditor5-build&page=1&ranking=optimal).
 
 After your build is out, [ping us on Twitter](https://twitter.com/ckeditor)!

+ 51 - 0
docs/builds/guides/integration/advanced-setup.md

@@ -338,3 +338,54 @@ module.exports = {
 ```
 
 Webpack will now create a separate file called `styles.css` which you will need to load manually into your HTML (using the `<link rel="stylesheet">` tag).
+
+### Option: Building to ES5 target
+
+CKEditor 5 is written in ECMAScript 2015 (also called ES6). All browsers on which CKEditor 5 is {@link builds/guides/browser-compatibility currently supported} have sufficient ES6 support to run CKEditor 5. Thanks to that, CKEditor 5 Builds are also published in the original ES6 format.
+
+However, it may happen that your environment requires ES5. For instance, if you use tools like [UglifyJS](https://github.com/mishoo/UglifyJS) which do not support ES6+ yet, you may need to transpile CKEditor 5's source to ES5. This will create ~80% bigger builds but will ensure that your environment can process CKEditor 5's code.
+
+In order to create an ES5 build of CKEditor 5 you can use [Babel](https://babeljs.io/):
+
+```bash
+npm install --save babel-loader babel-core babel-preset-env regenerator-runtime
+```
+
+Then, add this item to webpack's [`module.rules`](https://webpack.js.org/configuration/module/#module-rules) section:
+
+```js
+module: {
+	rules: [
+		{
+			test: /\.js$/,
+			use: [
+				{
+					loader: 'babel-loader',
+					options: {
+						presets: [ require( 'babel-preset-env' ) ]
+					}
+				}
+			]
+		},
+		...
+	]
+}
+```
+
+And load [`regenerator-runtime`](https://www.npmjs.com/package/regenerator-runtime) (needed to make ES6 generators work after transpilation) by adding it as the first [entry point](https://webpack.js.org/configuration/entry-context/#entry):
+
+```js
+entry: [
+	require.resolve( 'regenerator-runtime/runtime.js' ),
+
+	// your entries...
+]
+```
+
+<info-box>
+	The above setup ensures that the source code is transpiled to ES5. However, it does not ensure that all ES6 polyfills are loaded. Therefore, if you would like to, for example, give [bringing IE11 compatibility](https://github.com/ckeditor/ckeditor5/issues/330) a try make sure to also load [`babel-polyfill`](https://babeljs.io/docs/usage/polyfill/).
+</info-box>
+
+<info-box>
+	The [`babel-preset-env`](https://github.com/babel/babel-preset-env) package let's you to choose environment which you want to support and transpiles ES6+ features to match that environment's capabilities. If not configured, it will produce ES5 builds.
+</info-box>

+ 1 - 1
docs/builds/guides/whats-new.md

@@ -90,4 +90,4 @@ Read more about {@linkTODO collaboration in the CKEditor 5 Framework documentati
 
 ## Modern
 
-CKEditor 5 has been totally rewritten in ES6, using the power of modules. It provides all the necessary tools to easily integrate it with modern applications and technologies.
+CKEditor 5 has been totally rewritten in ECMAScript 2015 (also called ES6), using the power of modules. It provides all the necessary tools to easily integrate it with modern applications and technologies.

+ 8 - 0
docs/umberto.json

@@ -117,6 +117,14 @@
 			"path": "packages/ckeditor5-autoformat",
 			"prefix": "autoformat"
 		},
+		{
+			"path": "packages/ckeditor5-core",
+			"prefix": "core"
+		},
+		{
+			"path": "packages/ckeditor5-engine",
+			"prefix": "engine"
+		},
 		{
 			"path": "packages/ckeditor5-heading",
 			"prefix": "heading"

+ 2 - 0
gulpfile.js

@@ -57,6 +57,8 @@ gulp.task( 'docs', () => {
 		} );
 	}
 
+	// Simple way to reuse existing api/output.json:
+	// return Promise.resolve()
 	return buildApiDocs()
 		.then( () => {
 			return runUmberto( {

+ 8 - 3
package.json

@@ -1,11 +1,16 @@
 {
   "name": "ckeditor5",
   "version": "0.11.0",
-  "description": "The development version of CKEditor; the best browser-based WYSIWYG editor.",
+  "description": "The development environment of CKEditor 5.",
   "keywords": [
     "CKEditor",
-    "Editor",
-    "WYSIWYG"
+    "ckeditor5",
+    "editor",
+    "WYSIWYG",
+    "text editor",
+    "rich-text editor",
+    "contentEditable",
+    "editing framework"
   ],
   "dependencies": {
     "@ckeditor/ckeditor5-adapter-ckfinder": "^0.1.1",