No More Posting New Topics!

If you have a question or an issue, please start a thread in our Github Discussions Forum.
This forum is closed for new threads/ topics.

Navigation

    Quasar Framework

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    is there anyway to import only selected components?

    Framework
    4
    11
    4200
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • A
      AhsanAbrar last edited by

      Hi,

      this is awesome framework but one problem here.

      i want to import selected components only due to reduce some file size.

      for example, if we only need Layout and Buttons so why we should get import all components by default who we are not using.

      is there any solution?

      rstoenescu 1 Reply Last reply Reply Quote 0
      • rstoenescu
        rstoenescu Admin @AhsanAbrar last edited by

        @AhsanAbrar One step at a time. This is in the roadmap since we jumped to Webpack 2 which has tree-shaking: https://github.com/quasarframework/quasar/projects/3 (Miscellaneous section)

        Next Quasar version will allow apps to be 44kB smaller due to Velocity not being needed anymore.

        druppy 1 Reply Last reply Reply Quote 0
        • druppy
          druppy @rstoenescu last edited by

          @rstoenescu The combination of Vue.use( Quasar ) and WebPack2 seems like working against each other, I mean …

          If all components are registered into Vue core as global components, then WebPack2 can shake all the tree’s it likes to, these components will not be seen as dead leaves, as noone can check if they have been used inside some templates ?

          Or am I on the wrong track here ?

          rstoenescu 1 Reply Last reply Reply Quote 0
          • rstoenescu
            rstoenescu Admin @druppy last edited by

            @druppy Yeah, this will change. I haven’t said it’s ready anywhere 🙂 I am thinking about 2 options:

            1. importing components just as you would with any Vue components. On demand, starting with root component

            2. Importing in main.js and registering them globally on Vue

            We’ll see.

            druppy 1 Reply Last reply Reply Quote 0
            • druppy
              druppy @rstoenescu last edited by

              @rstoenescu With a little luck we may get both 🙂

              But the last one makes a lot of sense, I love it when things are modular, but we may change the name of the Quasar components, and then any future type definitions will then not work.

              1 Reply Last reply Reply Quote 0
              • s.molinari
                s.molinari last edited by s.molinari

                You know I am still learning, so go easy on me. 😄

                importing components just as you would with any Vue components. On demand, starting with root component

                Is there any other problem with this, other than possible duplication of code for the developer? ( I think I remember you mentioning this is what is being avoided with the global implementation of components.)

                And, what if I want to introduce new components outside of the Quasar built ones? Would I have to refactor them to fit into the Quasar system, to then introduce them globally in some way?

                Scott

                rstoenescu 1 Reply Last reply Reply Quote 0
                • rstoenescu
                  rstoenescu Admin @s.molinari last edited by

                  @s.molinari Haven’t decided yet on the best way to go, so the design is in progress. No duplication will occur if we go with registering Quasar components on global Vue on main.js. Importing Quasar components works just the same as importing ANY other components. We’re using Webpack for this, so nothing specific between importing a Quasar component or other components.

                  1 Reply Last reply Reply Quote 0
                  • s.molinari
                    s.molinari last edited by

                    Ok. Well, with my experience of templating systems (ala Twig and home-made systems), I’d be for declaring components locally. I personally haven’t known it any other way. 😄

                    Scott

                    1 Reply Last reply Reply Quote 0
                    • A
                      AhsanAbrar last edited by

                      @rstoenescu please can you tell me approx time when you will release stable version or webpack 2 version ?

                      please tell me, actually i want to start project so i can get idea.

                      1 Reply Last reply Reply Quote 0
                      • s.molinari
                        s.molinari last edited by s.molinari

                        @AhsanAbrar - Quasar uses Webpack 2. And the framework is pretty stable. 😄

                        Scott

                        1 Reply Last reply Reply Quote 1
                        • rstoenescu
                          rstoenescu Admin last edited by

                          @AhsanAbrar Hi, like Scott indicated, the framework is pretty stable and usable as it is now. v1.0 will only mean a few features more and (probably) some very minor API changes that will be easy to upgrade to.

                          1 Reply Last reply Reply Quote 0
                          • First post
                            Last post