From 39d316bde17e327e95867bc33e0ac2b942f089d9 Mon Sep 17 00:00:00 2001 From: Marc Henry Schultz <85400359+mhsdesign@users.noreply.github.com> Date: Tue, 25 Apr 2023 14:36:11 +0200 Subject: [PATCH] Apply suggestions from code review Co-authored-by: Sebastian Helzle --- packages/neos-ui-extensibility-webpack-adapter/README.md | 4 ++-- packages/neos-ui-extensibility/README.md | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/neos-ui-extensibility-webpack-adapter/README.md b/packages/neos-ui-extensibility-webpack-adapter/README.md index aa761adc08..f5c14186f2 100644 --- a/packages/neos-ui-extensibility-webpack-adapter/README.md +++ b/packages/neos-ui-extensibility-webpack-adapter/README.md @@ -10,7 +10,7 @@ yarn add -D @neos-project/neos-ui-extensibility-webpack-adapter ## Alternative: Esbuild, vanilla Webpack5 (or any buildsystem with alias resolution) If you prefer a less opinionated and modern build stack - or better, just want to choose and fully configure the bundler yourself - visit [@neos-project/neos-ui-extensibility](https://github.com/neos/neos-ui/blob/8.3/packages/neos-ui-extensibility) to use the Neos UI plugin API directly. -Note that this adapter uses a build stack created some time ago (webpack4 + babel) and exists mostly for convenience/backwards-compatibility, but is not state of the art and might never be again. So in case you're thinking about patching a new loader/option into the `webpack.config.js` you might as well just use webpack directly or try out esbuild ;). +Note that this adapter uses a build stack created some time ago (Webpack4 + Babel) and exists mostly for convenience/backwards-compatibility, but is not state of the art and might never be again. So in case you're thinking about patching a new loader/option into the `webpack.config.js` you might as well just use Webpack directly or try out esbuild ;). ## Migrating from Neos =< 8.2 `@neos-project/neos-ui-extensibility` @@ -32,7 +32,7 @@ This package provides an opinionated Webpack build stack to access the bespoken All available aliases are listed here: [@neos-project/neos-ui-extensibility/extensibilityMap.json](https://github.com/neos/neos-ui/blob/8.3/packages/neos-ui-extensibility/extensibilityMap.json). You only need to import the modules, and they will work as if you installed those packages. -So `import React from "react"` will import react at runtime from the Neos UI host and you don't need to install it. (Also the same instance is used, which is important) +So `import React from "react"` will import React at runtime from the Neos UI host and you don't need to install it. (Also the same instance is used, which is important) ## Usage / Technial Neos Ui plugin setup diff --git a/packages/neos-ui-extensibility/README.md b/packages/neos-ui-extensibility/README.md index 788b4df4f6..486c07da29 100644 --- a/packages/neos-ui-extensibility/README.md +++ b/packages/neos-ui-extensibility/README.md @@ -12,7 +12,7 @@ If you're here looking for the previously original shipped webpack build stack s ## Features -You don't need to recompile the Neos UI to integrate your own Plugins. Many Core functionalities are accessible through the `@neos-project/neos-ui-extensibility` API. +You don't need to recompile the Neos UI to integrate your own Plugins. Many core functionalities are accessible through the `@neos-project/neos-ui-extensibility` API. This package provides the shims to access to the bespoken API and the alias map: `extensibilityMap.json` to be used for building a plugin. All aliases are listed here: [@neos-project/neos-ui-extensibility/extensibilityMap.json](https://github.com/neos/neos-ui/blob/8.3/packages/neos-ui-extensibility/extensibilityMap.json). @@ -22,10 +22,10 @@ So `import React from "react"` will import react at runtime from the Neos UI hos ## General usage and Concept -A Neos UI plugin must get access to certain important objects and methods like react, CKEditor, and also the bootstrap function. +A Neos UI plugin must get access to certain important objects and methods like React, CKEditor, and also the bootstrap function. **Concept** -To access the same instance f.x. of React that the Neos UI Host is using, we technically want to do something like: `const {React} = window.NeosUiPluginApi`. The problem being: when we use 3rd party NPM packages in our plugin, they will import react as usual `import React from "react"` which will fail. +To access the same instance f.x. of React that the Neos UI Host is using, we technically want to do something like: `const {React} = window.NeosUiPluginApi`. The problem being: when we use 3rd party NPM packages in our plugin, they will import React as usual `import React from "react"` which will fail. To solve this issue and also make creating plugins a bit more fancy ✨ we make use of your bundlers import alias feature. The alias resolution will match any imported path against the `extensibilityMap.json` and redirect it to a shim. The shim will then access the Neos UI plugin API at runtime. @@ -167,7 +167,7 @@ By convention your `src/index.js` will import the manifest: import './manifest.js' ``` -In the manifest `src/manifest.js` we will register our plugin with access to the globalRegistry: +In the manifest `src/manifest.js` we will register our plugin with access to the `globalRegistry`: ```js import manifest from '@neos-project/neos-ui-extensibility';