This reverts commit 56455738e5.
Unfortunately, this prepublishOnly script wasn't working properly. The
published package.json was still including the properties that were
supposed to be stripped out by this script, as seen here:
https://unpkg.com/preact@8.2.4/package.json
So instead, to solve #820, we moved the babel settings to a .babelrc
which is not included in the published package:
d6ab85cb12
Thus, we can remove this prepublishOnly script
* Implement React DevTools integration
Add an emulation of the interfaces exposed by React to the devtools,
enabling React DevTools to inspect the preact component tree.
* Add hooks for mounting, updating and unmounting components
Add hooks that can be used by debugging tools to respond to preact
components being mounted, updated or unmounted.
Note that updates are only reported for stateful components, since no
state is persisted in the application about functional components.
* Add polyfills for ES2015 Map class used in devtools integration
* Move devtools integration to a separate bundle
To enable using the React Developer Tools with preact without increasing
the size of the preact bundle, build the React DevTools integration
module as a separate bundle.
* Simplify setting functional component display names
Re-export the original name of a functional component via the
`displayName` static class property, which doesn't suffer from the
problem of being non-writable in certain environments.
* Build React dev tools integration as a UMD build
This allows the dev tools to be used with Preact without any module
bundler just by including preact(.min).js and devtools.js as script tags
and then invoking `preactDevTools.initDevTools()`.
eg:
```js
// Include preact.js / devtools.js via <script> tags
function Label({label}) {
return preact.h('div',{},'Hello World');
}
preactDevTools.initDevTools();
preact.render(preact.h(Label), document.getElementById('app'));
```
* Add TypeScript definitions for preact/devtools
* Expose Preact component as _instance property
As suggested in https://github.com/developit/preact/pull/339#discussion_r82624951
expose the Preact component instance as the _instance property.
This enables calling methods on the component from the dev tools console
by selecting it in the React Dev Tools inspector and using `$r` in the
console.
* Initialize devtools automatically
Initialize the React Developer Tools integration automatically when
'preact/devtools' is required.
This makes for simpler usage for most users. Anyone who needs to be able
to unregister the devtools integration, such as the tests, can reach
into the module and invoke `initDevTools()` directly.