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.

Haul packager updates are very slow to load

See original GitHub issue

Current Behavior

When making a change to my source code and reloading, the app takes 5-10 seconds to actually download the changes and restart the app (this is after a 10 second webpack rebuild).

Expected Behavior

The reloading should be just as fast as it is when using the metro bundler (nearly instantaneous)

Haul Configuration (webpack.haul.js)

import { createWebpackConfig } from 'haul';
import merge from 'webpack-merge';

const ALIASED_MODULES = [
  'react-native-linear-gradient',
  'galmorous-react-native',
  'react-native-svg',
  'lottie-react-native',
  'react-navigation',
];

export default {
  webpack: env => {
    const config = createWebpackConfig(({ platform }) => ({
      entry: ['babel-polyfill', `./index.${platform}.js`],
    }))(env);

    const moduleAliases = ALIASED_MODULES.reduce((acc, moduleName) => {
      acc[moduleName] = path.resolve(`./node_modules/${moduleName}`);
      return acc;
    }, {});

    const customConfig = {
      resolve: {
        symlinks: false,
        alias: moduleAliases,
      },
    };
    // eslint-disable-next-line no-useless-escape
    const customExclude = /node_modules(?!.*[\/\\](react|pretty-format|haul|metro|shared-mobile|glamorous-native|static-container))/;

    // Create a custom webpack configuration based on a deep merge of the default
    // configuration and our custom build settings from above.
    const jsLoader = config.module.rules.find(
      rule => rule.test && rule.test.test('foo.js')
    );

    jsLoader.exclude = customExclude;
    jsLoader.use.find(loader =>
      loader.loader.includes('thread')
    ).options.workerParallelJobs = 50;

    const mergedConfig = merge(config, customConfig);
    return mergedConfig;
  },
};

Your Environment

software version
Haul 1.0.0-rc.9
react-native 0.57.4
node 10.0.0
npm or yarn 6.4.1

Issue Analytics

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

github_iconTop GitHub Comments

3reactions
tido64commented, Jan 17, 2019

I can try taking a stab at it over the weekend if nobody has picked it up by then.

2reactions
thymikeecommented, Feb 12, 2019

Update to the latest RC.12

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why is AliExpress shipping very slow and doesn't ... - Quora
Several factors influence the speed of Aliexpress orders' delivery or their delay: 1. Choice of delivery service: * Free AliExpress Standart Shipping.
Read more >
Xcode 13.2.1 unable to resolve Swift Package Manager
use Xcode "File" -> "Packages" -> "Resolve Packages"; alternately, close the project, then reopen it. You will probably get some warnings when ...
Read more >
Freight Market & Rate Trends | North America - C.H. Robinson
Get the latest North American freight trends, spot market freight rates, supply and demand, and other shipping industry factors that can ...
Read more >
How We Reduced Our React App's Load Time by 60% - InfoQ
Loading extra code means slower downloads and more work for the browser, leading to slower response times. This is far more noticeable on...
Read more >
I tried short hauls for 2 days - Hotshot trucking - YouTube
... Mailing Address Tow Piglet LLC 12333 Sowden Rd Suite B 56249 Houston, TX 77080 ❌ Disclaimer ❌ All information in this video...
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