question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Rpt2 slow as hell

See original GitHub issue

Demo repository: https://github.com/zerkalica/rpt2-bug package.json

  "devDependencies": {
    "rollup": "^0.57.1",
    "rollup-plugin-commonjs": "^8.4.1",
    "rollup-plugin-node-resolve": "^3.3.0",
    "rollup-plugin-typescript2": "git+https://github.com/ezolenko/rollup-plugin-typescript2#823fea9525f274db0512947dd7bb77b916d7bba1",
    "typescript": "^2.8.3"
}

rollup.config.js

import resolve from 'rollup-plugin-node-resolve'
import common from 'rollup-plugin-commonjs'
import tsPlugin from 'rollup-plugin-typescript2'

import path from 'path'

const tsOptions = {
  abortOnError: true,
  check: false,
  clean: false,
  tsconfig: path.join(process.cwd(), 'tsconfig.json'),
  //verbosity: 5,
  tsconfigOverride: {
      compilerOptions: {
        rootDir: path.join(process.cwd(), 'src'),
        declaration: false
      },
      include: [ path.join(process.cwd(), 'src') ]
   }
}

export default [
  {
    plugins: [
      resolve(),
      common({
        namedExports: {
          react: ['createElement', 'Component'],
          'react-dom': ['render'],
        }
      }),
      tsPlugin(tsOptions)
    ],
    input: 'src/index.tsx',
    output: {file: 'dist/index.js', format: 'iife', name: 'myApp'}
  }
]

src/index.tsx

import * as React from 'react'
import * as ReactDOM from 'react-dom'

class DevErrorCatch extends React.Component<{}, {error?: Error, componentStack: any}> {
    state = {error: null, componentStack: null}

    componentDidCatch(error, {componentStack}) {
        this.setState({error, componentStack})
    }

    render() {
        const {error, componentStack} = this.state
        if (error) {
            return <div>
                <h1>{error.message}</h1>
                <pre>{componentStack}</pre>
                <br/>
                <pre>{error.stack}</pre>
            </div>
        }
        return <div>test</div>
    }
}

export default function main(node: Element) {
    ReactDOM.render(<DevErrorCatch/>, node)
}
npm run watch.rpt2

Build time: 3.6s, Warm rebuild time: 2.1s

npm run watch.parcel

Build time: 5.4s, Warm rebuild time: 0.6s

In my project about 2K SLOC, rebuild time in watch mode about 5-6 s in rpt2. Parcel - about 930ms.

If enable verbosity: 5 - process crashed with out of memory or do inifite writes to console after changing file in watch mode.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:9 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
marijnhcommented, Jun 1, 2018

Oh, it’s related to rollup -w – I do see the speedup in non-watch mode. See #82

1reaction
ezolenkocommented, Jun 1, 2018

@marijnh yep, already there, set check: false in plugin options. Let me know if it improves things, could be slightly faster than original plugin on rebuilds.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Some more shit by sparkone records | SoundClick
Clear cache. Dark mode. Some more shit. sparkone records. Free download ... DezG style 2.rpt 2..mp3 ... Slow rap. #instrumental #trap #deejaydezg. Bomb...
Read more >
1/2 day whistler slow | Bloodydecks - BDoutdoors
I don't think deadheads should be allowed to win the jackpot. I do think they should contribute to it. The paying passengers should...
Read more >
TriMore (@TriM0RE) / Twitter
Quiz: If u are poor, can't afford new batteries for your flashy shit but need to walk somewhere, do you steal another person's...
Read more >
Kenner Fire Chief John Hellmers under investigation, placed ...
The city of Kenner announced Wednesday (Sept. 6) that Fire Chief John Hellmers has been placed on administrative leave while he is under...
Read more >
Running speed unrealistically slow? : r/HellLetLoose - Reddit
The run speed is so much slower than I remember, what happened? ... r/HellLetLoose - If there was a hell let loose 2,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found