What is metro bundler in react-native?











up vote
8
down vote

favorite
1












I am learning react-native.



I don't find proper documentation for metro bundler.So, I have few questions on it.



As the name suggest it creates a bundle.




  1. But where is the bundle file located ?

  2. Is this same as webpack ?

  3. What is the use of that bundle file ?










share|improve this question




























    up vote
    8
    down vote

    favorite
    1












    I am learning react-native.



    I don't find proper documentation for metro bundler.So, I have few questions on it.



    As the name suggest it creates a bundle.




    1. But where is the bundle file located ?

    2. Is this same as webpack ?

    3. What is the use of that bundle file ?










    share|improve this question


























      up vote
      8
      down vote

      favorite
      1









      up vote
      8
      down vote

      favorite
      1






      1





      I am learning react-native.



      I don't find proper documentation for metro bundler.So, I have few questions on it.



      As the name suggest it creates a bundle.




      1. But where is the bundle file located ?

      2. Is this same as webpack ?

      3. What is the use of that bundle file ?










      share|improve this question















      I am learning react-native.



      I don't find proper documentation for metro bundler.So, I have few questions on it.



      As the name suggest it creates a bundle.




      1. But where is the bundle file located ?

      2. Is this same as webpack ?

      3. What is the use of that bundle file ?







      react-native native react-native-android react-native-ios






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited 18 hours ago









      Md. Mokammal Hossen Farnan

      293316




      293316










      asked Jun 30 at 16:52









      Piyush

      100112




      100112
























          2 Answers
          2






          active

          oldest

          votes

















          up vote
          2
          down vote













          A React Native app is a compiled app that is running some Javascript. Whenever you build and run your React Native project, a packager starts up called Metro. You’ve probably seen this output in your terminal before, letting your know the packager is running.



          The packager does a few things:



          Combines all your Javascript code into a single file, and translates any Javascript code that your device won’t understand (like JSX or some of the newer JS syntax).



          Converts assets (e.g. PNG files) into objects that can be displayed by an Image component.



          reference:
          https://hackernoon.com/understanding-expo-for-react-native-7bf23054bbcd






          share|improve this answer




























            up vote
            0
            down vote













            Metro is a JavaScript bundler which takes in options, an entry file, and gives you a JavaScript file including all JavaScript files back. Every time you run a react native project, a compilation of many javascript files are done into a single file. This compilation is done by a bundler which is called Metro.



            Answers to your questions:



            1> Bundled file is located on the device itself on which you are building your app and is stored in different formats like in case of Android Plain bundling in which .bundle is created. Another format is of Indexed RAM bundle in which file is stored as binary file.



            2> Webpack is also a similar type of module bundler which does bundling to ReactJS web platform and its modules are accessible through browser. Bundling process is while similar to metro.



            3> These bundled files are indexed and stored in a particular numerical format and thus its easy at the run time to arrange JS files in order.



            There are multiple functions of Metro bundler and you can read about the role of Metro in React Native here : https://medium.com/@rishabh0297/role-of-metro-bundler-in-react-native-24d178c7117e



            Hope it helps.






            share|improve this answer





















              Your Answer






              StackExchange.ifUsing("editor", function () {
              StackExchange.using("externalEditor", function () {
              StackExchange.using("snippets", function () {
              StackExchange.snippets.init();
              });
              });
              }, "code-snippets");

              StackExchange.ready(function() {
              var channelOptions = {
              tags: "".split(" "),
              id: "1"
              };
              initTagRenderer("".split(" "), "".split(" "), channelOptions);

              StackExchange.using("externalEditor", function() {
              // Have to fire editor after snippets, if snippets enabled
              if (StackExchange.settings.snippets.snippetsEnabled) {
              StackExchange.using("snippets", function() {
              createEditor();
              });
              }
              else {
              createEditor();
              }
              });

              function createEditor() {
              StackExchange.prepareEditor({
              heartbeatType: 'answer',
              convertImagesToLinks: true,
              noModals: true,
              showLowRepImageUploadWarning: true,
              reputationToPostImages: 10,
              bindNavPrevention: true,
              postfix: "",
              imageUploader: {
              brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
              contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
              allowUrls: true
              },
              onDemand: true,
              discardSelector: ".discard-answer"
              ,immediatelyShowMarkdownHelp:true
              });


              }
              });














               

              draft saved


              draft discarded


















              StackExchange.ready(
              function () {
              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f51116811%2fwhat-is-metro-bundler-in-react-native%23new-answer', 'question_page');
              }
              );

              Post as a guest
































              2 Answers
              2






              active

              oldest

              votes








              2 Answers
              2






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes








              up vote
              2
              down vote













              A React Native app is a compiled app that is running some Javascript. Whenever you build and run your React Native project, a packager starts up called Metro. You’ve probably seen this output in your terminal before, letting your know the packager is running.



              The packager does a few things:



              Combines all your Javascript code into a single file, and translates any Javascript code that your device won’t understand (like JSX or some of the newer JS syntax).



              Converts assets (e.g. PNG files) into objects that can be displayed by an Image component.



              reference:
              https://hackernoon.com/understanding-expo-for-react-native-7bf23054bbcd






              share|improve this answer

























                up vote
                2
                down vote













                A React Native app is a compiled app that is running some Javascript. Whenever you build and run your React Native project, a packager starts up called Metro. You’ve probably seen this output in your terminal before, letting your know the packager is running.



                The packager does a few things:



                Combines all your Javascript code into a single file, and translates any Javascript code that your device won’t understand (like JSX or some of the newer JS syntax).



                Converts assets (e.g. PNG files) into objects that can be displayed by an Image component.



                reference:
                https://hackernoon.com/understanding-expo-for-react-native-7bf23054bbcd






                share|improve this answer























                  up vote
                  2
                  down vote










                  up vote
                  2
                  down vote









                  A React Native app is a compiled app that is running some Javascript. Whenever you build and run your React Native project, a packager starts up called Metro. You’ve probably seen this output in your terminal before, letting your know the packager is running.



                  The packager does a few things:



                  Combines all your Javascript code into a single file, and translates any Javascript code that your device won’t understand (like JSX or some of the newer JS syntax).



                  Converts assets (e.g. PNG files) into objects that can be displayed by an Image component.



                  reference:
                  https://hackernoon.com/understanding-expo-for-react-native-7bf23054bbcd






                  share|improve this answer












                  A React Native app is a compiled app that is running some Javascript. Whenever you build and run your React Native project, a packager starts up called Metro. You’ve probably seen this output in your terminal before, letting your know the packager is running.



                  The packager does a few things:



                  Combines all your Javascript code into a single file, and translates any Javascript code that your device won’t understand (like JSX or some of the newer JS syntax).



                  Converts assets (e.g. PNG files) into objects that can be displayed by an Image component.



                  reference:
                  https://hackernoon.com/understanding-expo-for-react-native-7bf23054bbcd







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Aug 18 at 7:19









                  mahdi sharifi

                  212




                  212
























                      up vote
                      0
                      down vote













                      Metro is a JavaScript bundler which takes in options, an entry file, and gives you a JavaScript file including all JavaScript files back. Every time you run a react native project, a compilation of many javascript files are done into a single file. This compilation is done by a bundler which is called Metro.



                      Answers to your questions:



                      1> Bundled file is located on the device itself on which you are building your app and is stored in different formats like in case of Android Plain bundling in which .bundle is created. Another format is of Indexed RAM bundle in which file is stored as binary file.



                      2> Webpack is also a similar type of module bundler which does bundling to ReactJS web platform and its modules are accessible through browser. Bundling process is while similar to metro.



                      3> These bundled files are indexed and stored in a particular numerical format and thus its easy at the run time to arrange JS files in order.



                      There are multiple functions of Metro bundler and you can read about the role of Metro in React Native here : https://medium.com/@rishabh0297/role-of-metro-bundler-in-react-native-24d178c7117e



                      Hope it helps.






                      share|improve this answer

























                        up vote
                        0
                        down vote













                        Metro is a JavaScript bundler which takes in options, an entry file, and gives you a JavaScript file including all JavaScript files back. Every time you run a react native project, a compilation of many javascript files are done into a single file. This compilation is done by a bundler which is called Metro.



                        Answers to your questions:



                        1> Bundled file is located on the device itself on which you are building your app and is stored in different formats like in case of Android Plain bundling in which .bundle is created. Another format is of Indexed RAM bundle in which file is stored as binary file.



                        2> Webpack is also a similar type of module bundler which does bundling to ReactJS web platform and its modules are accessible through browser. Bundling process is while similar to metro.



                        3> These bundled files are indexed and stored in a particular numerical format and thus its easy at the run time to arrange JS files in order.



                        There are multiple functions of Metro bundler and you can read about the role of Metro in React Native here : https://medium.com/@rishabh0297/role-of-metro-bundler-in-react-native-24d178c7117e



                        Hope it helps.






                        share|improve this answer























                          up vote
                          0
                          down vote










                          up vote
                          0
                          down vote









                          Metro is a JavaScript bundler which takes in options, an entry file, and gives you a JavaScript file including all JavaScript files back. Every time you run a react native project, a compilation of many javascript files are done into a single file. This compilation is done by a bundler which is called Metro.



                          Answers to your questions:



                          1> Bundled file is located on the device itself on which you are building your app and is stored in different formats like in case of Android Plain bundling in which .bundle is created. Another format is of Indexed RAM bundle in which file is stored as binary file.



                          2> Webpack is also a similar type of module bundler which does bundling to ReactJS web platform and its modules are accessible through browser. Bundling process is while similar to metro.



                          3> These bundled files are indexed and stored in a particular numerical format and thus its easy at the run time to arrange JS files in order.



                          There are multiple functions of Metro bundler and you can read about the role of Metro in React Native here : https://medium.com/@rishabh0297/role-of-metro-bundler-in-react-native-24d178c7117e



                          Hope it helps.






                          share|improve this answer












                          Metro is a JavaScript bundler which takes in options, an entry file, and gives you a JavaScript file including all JavaScript files back. Every time you run a react native project, a compilation of many javascript files are done into a single file. This compilation is done by a bundler which is called Metro.



                          Answers to your questions:



                          1> Bundled file is located on the device itself on which you are building your app and is stored in different formats like in case of Android Plain bundling in which .bundle is created. Another format is of Indexed RAM bundle in which file is stored as binary file.



                          2> Webpack is also a similar type of module bundler which does bundling to ReactJS web platform and its modules are accessible through browser. Bundling process is while similar to metro.



                          3> These bundled files are indexed and stored in a particular numerical format and thus its easy at the run time to arrange JS files in order.



                          There are multiple functions of Metro bundler and you can read about the role of Metro in React Native here : https://medium.com/@rishabh0297/role-of-metro-bundler-in-react-native-24d178c7117e



                          Hope it helps.







                          share|improve this answer












                          share|improve this answer



                          share|improve this answer










                          answered 20 hours ago









                          Rishabh Sharma

                          263




                          263






























                               

                              draft saved


                              draft discarded



















































                               


                              draft saved


                              draft discarded














                              StackExchange.ready(
                              function () {
                              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f51116811%2fwhat-is-metro-bundler-in-react-native%23new-answer', 'question_page');
                              }
                              );

                              Post as a guest




















































































                              Popular posts from this blog

                              Bressuire

                              Vorschmack

                              Quarantine