@startupjs/babel-plugin-startupjs-debug

0.55.8 • Public • Published

@startupjs/babel-plugin-startupjs-debug

Additional transformations for development and debugging

Usage

For internal usage only.

Options

// defaults
{
  fixObserverHotReloading: true,
  addFilenamesToObserver: true
}

Example

fix hot reloading of observer() and add filename

import { observer } from 'startupjs'

export default observer(function Main ({ title }) {
  return <span>Hello</span>
}, { forwardRef: true, suspenseProps: { loader: <span>Loading</span> } })

↓ ↓ ↓ ↓ ↓ ↓

import { observer } from "startupjs";
export default observer.__wrapObserverMeta(
  observer.__makeObserver(
    function Main({ title }) {
      return <span>Hello</span>;
    },
    {
      forwardRef: true,
      suspenseProps: {
        loader: <span>Loading</span>,
      },
      filename: "/ws/dummy-project/component.js",
    }
  )
);

License

MIT

Package Sidebar

Install

npm i @startupjs/babel-plugin-startupjs-debug

Weekly Downloads

278

Version

0.55.8

License

MIT

Unpacked Size

4.44 kB

Total Files

3

Last publish

Collaborators

  • cray0000
  • yska
  • zag2art
  • fctsvirus
  • maestro.sc
  • byshock