-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reexport preact && bundle library #124
Conversation
This adjusts the imports according to the new structure implemented via bpmn-io/properties-panel#124
This adjusts the imports according to the new structure implemented via bpmn-io/properties-panel#124
4585966
to
ebbaa1d
Compare
This allows to make sure any packages depending on the project as well as user's extension use the same instance of the preact package, thus making hooks and other features work smoothly. Instead of installing and import preact in your project, import the library from the properties panel package, e.g. ```javascript import { h } from '@bpmn-io/properties-panel/preact'; function CustomComponent(props) { return h('div', 'hello world!'); } ``` If you transpile from JSX, the babel `importSource` should be set accordingly: ```json { "plugins": [ [ "@babel/plugin-transform-react-jsx", { "importSource": "@bpmn-io/properties-panel/preact", "runtime": "automatic" } ] ```
ebbaa1d
to
26e11c4
Compare
@@ -0,0 +1,15 @@ | |||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Renamed so that it can be automatically parsed via require
in the karma config.
.eslintignore
Outdated
/node_modules | ||
/lib |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Prepending slash means that the ignore will be applied only to the root of the repo.
The library no longer exposes its internal structure in `lib`. Instead, exports can be accessed from the root. ```javascript import { Group, TextFieldEntry } from @bpmn-io/properties-panel; const myGroup = { id: myGroup, component: Group, entries: [ { id: customEntry, component: <TextFieldEntry /* ... */ /> } ] }; ``` BREAKING CHANGES: * Internal structure of the library is no longer exposed. Use root exports instead.
79c2483
to
4d6eeb0
Compare
This adjusts the imports according to the new structure implemented via bpmn-io/properties-panel#124
This adjusts the imports according to the new structure implemented via bpmn-io/properties-panel#124
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A fundamental improvement. 👍
This adjusts the imports according to the new structure implemented via bpmn-io/properties-panel#124
This adjusts the imports according to the new structure implemented via bpmn-io/properties-panel#124
This adjusts the imports according to the new structure implemented via bpmn-io/properties-panel#124
This PR introduces bundling to the library so that it's easier to re-export
its contents in the context of a pluggable application (Camunda Modeler).
We re-export
preact
package together with subpackages to make sureplugin creators can depend on the same instance which is essential
for the hooks to work correctly.
Some examples of the new way (copied from the commit messages):
For
preact
If you transpile from JSX, the babel
importSource
should be setaccordingly:
BREAKING CHANGES:
Use root exports instead.