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.

Figure out multiple configs passed to compiler

See original GitHub issue

Currently we create an array of configs, one for each platform. We used to pass that array to webpack compiler, but switched to passing a single one (current platform you are building) for performance reasons.

When Webpack compiler receives an array of configs, it enters multi-config mode and handles them all w/o restarting. That allows us to serve all platform bundles at the same time, just like packager.

Unfortunately, it has a couple of limitations:

  • It builds all configs at once
  • It recompiles all configs at once, even if one bundle didn’t change
  • It’s sync - android gets build after ios
  • Default devMiddleware waits for all builds to finish, even if you requested ios. That means you wait for 20 seconds even if iOS was ready after 5 seconds
  • All bundles are built w/o waiting for a request (no lazy option)

All the above makes the development time significantly slower for a very specific use-case (having two simulators open at the same time). However, that use-case is important and we need to support it in a better way.

I’ll chat with Webpack team to understand how it works currently, if we are correct and how to fix that. Generally speaking, we might need to write our own dev middleware that does these things.

A solution would be to add a feature to bundle lazily as soon as you request platform bundle. That means we wouldn’t bundle android until you load Genymotion and request it. However, as I said above, currently turning on lazy option has two issues:

  • It is lazy for all configs - if you request ios, android also gets built
  • When lazy is turned on, watch doesn’t work (recompile on file change)

Current solution requires passing --platform flag.

This is very important to sort out now as it’s going to be an important workflow detail - whether to pass platform flags or not.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:14 (10 by maintainers)

github_iconTop GitHub Comments

3reactions
evenstensbergcommented, Mar 30, 2017

I’ll see if I can squeeze some time to look into the source code, got a ton of work ahead of me, sadly. Maybe @TheLarkInn has some immediate feedback, but I need to see the source code myself before coming up with a fix. One thing you mentioned was that it builds all configs at once. One thing I’ve seen is that you can use webpack-merge to generate a config, that could be of use for the async functionality or even switch between ios and android builds. If webpack compiles regardless of changes, we’ve got a thread on webpack-cli on how to avoid this. Hope it helps!

2reactions
evenstensbergcommented, May 24, 2017

I’ve got some time in 2-3 weeks, got a hectic period of exams right now. If ok, can look into it then 👍

Read more comments on GitHub >

github_iconTop Results From Across the Web

Compile-time configuration across several c++ projects
A couple of things you can do: When compiling pass the defines from the command line and compile a separate version of the...
Read more >
CMake: How to Inspect and Configure the Compiler - Dane Bulat
Inspecting the Default Compiler This section details how to find out which compiler and compiler flags CMake uses on your system by default....
Read more >
Apache Maven Compiler Plugin
Sets the unformatted single argument string to be passed to the compiler. To pass multiple arguments such as -Xmaxerrs 1000 (which are ...
Read more >
Set C++ compiler and build properties in Visual Studio
C++ compiler and linker options are located under the C/C++ and Linker nodes in the left pane under Configuration Properties. These options ...
Read more >
Obtain the Cargo compiler configuration for use in ... - GitHub
As a workaround, I think cargo metadata and cargo rustc --unit-graph need to be used to obtain the target triples to manually pass...
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