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

    [v0.14] Removed "src" folder from Quasar package

    Announcements
    5
    11
    3223
    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.
    • rstoenescu
      rstoenescu Admin last edited by

      Hi All,

      I see too many people importing from 'quasar/src/*" which is NOT the way to do it.
      If you update to latest edge (v0.14) build and your app gets broken, it means you are importing from Quasar’s src folder which I just removed.

      Example. Instead of:
      import QLayout from 'quasar/src/components/layout/QLayout'
      you should do:
      import { QLayout } from 'quasar'

      -Razvan

      1 Reply Last reply Reply Quote 2
      • N
        nueko last edited by

        material-ui and semantic
        said This will make your build process faster and your build output smaller
        if we import specific file instead of import { QLayout } from ‘quasar’

        is it better idea to remove the src folder?

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

          @nueko Quasar has better internal mechanics. Importing like suggested will kick in tree-shaking, so it’s same thing.

          1 Reply Last reply Reply Quote 1
          • N
            nueko last edited by

            great to hear that.
            I hope I read that statement on the docs

            1 Reply Last reply Reply Quote 0
            • StrikerUnit
              StrikerUnit last edited by StrikerUnit

              Great point showing that importing from ‘quasar’ is more efficient,

              But what is the suitable way if I wanted to use quasar mixins such as ‘slider-mixin’ from ‘src/vue-components/slider/slider-mixin’?

              Thanks.

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

                @StrikerUnit that’s part of v0.13. If you are on v0.13 the “src” folder is still there.

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

                  @rstoenescu

                  Thanks, I just start trying out 0.14 so I wonder how it should be implement/import in this kind of situation.

                  1 Reply Last reply Reply Quote 0
                  • J
                    jesus last edited by

                    I am seeing this way of no src in others too. It is ok but as developers we need to have src for several reasons:
                    a) Sometimes we need to read code and to know what it is happening rather than guessing, etc
                    b) Sometimes we need to raise an exception and to do strange and stupid things like to use src files directly or why not overload or fork code for whatever arise.
                    c) For me to have src is guarantee of being in a open and not blind software, it is how things stand up behind scene. It is not only what we do it is also what support us, so we need to make very smart choices like quasar 🙂
                    So in my humble opinion for development src should be there or accesible anywhere, but deployment is a complete different animal who needs to be fed in other way.

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

                      @jesus

                      The whole framework is open source, meaning you can see its code on github. All of it. Nothing is hidden. So you used to read it from node_modules, ok, I get that, but nothing is stopping you from reading it from “dev” branch of Quasar github repo. So points a) and c) are covered anyway.

                      Now on to point b). Again, nothing stopping you from extending current Quasar components. Import the component you want then change it accordingly and possibly reexport it with your own name.

                      Removing “src” folder is just a way to force developers correctly import Quasar components, nothing more. I’ve seen enough of “src” imports that I just can’t take it anymore 🙂 On top of that, “bugs” like “I’m importing Quasar components and when I build it says line X breaks UglifyJS”. And I’m like “huh? that is not possible…” Well, yeah, it is possible if you don’t follow the documentation and import Quasar the right way 🙂

                      Unless a very solid case of using “src” folder does not pop out, devs should import Quasar in the documented way. I currently do not see something that you could do with “src” but can’t do with how things are now. If I missed something please do tell.

                      Regards,
                      Razvan

                      StrikerUnit 1 Reply Last reply Reply Quote 2
                      • StrikerUnit
                        StrikerUnit @rstoenescu last edited by

                        @rstoenescu

                        I’m interested in how to do the “b” point, but I don’t know how to start or how to do it properly.

                        Do you have any example or link that I can follow or read?

                        Thanks.

                        1 Reply Last reply Reply Quote 2
                        • J
                          JCharante last edited by

                          @rstoenescu When you get back from vacation I’d appreciate an example for point b.

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