Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build mode #154

Closed
kevinmarrec opened this issue Sep 6, 2019 · 15 comments
Closed

Build mode #154

kevinmarrec opened this issue Sep 6, 2019 · 15 comments
Assignees
Labels
feature request Feature request

Comments

@kevinmarrec
Copy link
Member

kevinmarrec commented Sep 6, 2019

Is your feature request related to a problem? Please describe.
We're currently not being able to use something else than (dist/vuetify.js + dist/vuetify.css) or vuetify-loader

Describe the solution you'd like
Be able to specify the "build" mode, including the following options :

  • full
    • full Vuetify pre-build files
  • treeShake
    • tree-shaking with vuetify-loader
  • manual
    • Does nothing, user will need to manually import Vuetify components in the whole project
  • auto (Current behavior)
    • Fallback to full mode in development(nuxt dev) for faster development
    • Fallback to treeShake in production(nuxt build)

Info: Mode names are susceptible to change

Related issues that should be resolvable with this feature (not using vuetify-loader but manually importing components for more granular control)
#169
#143
#148

@kevinmarrec kevinmarrec added the feature request Feature request label Sep 6, 2019
@kevinmarrec kevinmarrec changed the title Be able to neither use dist/vuetify.js or vuetify-loader Build mode Sep 6, 2019
@MrJmpl3
Copy link
Contributor

MrJmpl3 commented Sep 7, 2019

You need add a warning in the auto mode, because full mode and treeShake mode can be different CSS order.

@kevinmarrec
Copy link
Member Author

kevinmarrec commented Sep 7, 2019

@MrJmpl3 I'm not sure to understand, auto is already current behavior (last module version), why add a warning ? Could you explain a bit further the CSS order you're talking about ? Thanks :) !

@MrJmpl3
Copy link
Contributor

MrJmpl3 commented Sep 7, 2019

Related: vuetifyjs/vuetify#7933

In the full mode, import css and js pre builded , the order of css is correct.

But in tree-shake is if you are not cautious with imports the order of css broken the app

@kevinmarrec
Copy link
Member Author

kevinmarrec commented Sep 8, 2019

@MrJmpl3 Is the bug of CSS order still reproducible ? (The issue has been closed so..) I would be interested trying to figure out what's going on

@MrJmpl3
Copy link
Contributor

MrJmpl3 commented Sep 8, 2019

The issue was closed because the solution is be cautious with imports.

For example..

import Toolbar from '@/components/organisms/Toolbar.vue';
import Footer from '@/components/organisms/Footer.vue';

The styles of Toolbar is loaded first and second the Footer

OR

import Footer from '@/components/organisms/Footer.vue';
import Toolbar from '@/components/organisms/Toolbar.vue';

The styles of Footer is loaded first and second the Toolbar

Some times don't have problems because the styles don't override , but sometime has problem because the styles of Vuetify Component import global CSS , don't encapsulate the CSS for obvious reason.

The Vuetify team say: "We don't specify any order, it's dependant on the build configuration." in others words, depends of the order of the imports

@kevinmarrec
Copy link
Member Author

kevinmarrec commented Sep 8, 2019

@MrJmpl3 They are right, I mean it's user problem if his CSS can go crazy with its own customizations.
If you're talking about custom component matching of Vuetify loader options, this is not something we're responsible of if CSS order matters cause your components do some CSS weird things.

That probably what they meant cause Vuetify components imports don't need specific order to work, so it's only user problem if his CSS is not correctly written.

@MrJmpl3
Copy link
Contributor

MrJmpl3 commented Sep 8, 2019

For this reason , i recommend add a warning, because , in dev mode you project can be all correct, because the order of the imports don't import , but in production mode, the project will broken because the order of the imports start work.

@KaelWD
Copy link
Contributor

KaelWD commented Sep 9, 2019

Auto would also mean wider browser support in dev than in prod if babel isn't configured properly, and sass variables can't be changed with the full build.

@kevinmarrec
Copy link
Member Author

@KaelWD treeShaking should better always be on by default then right ?

@MrJmpl3
Copy link
Contributor

MrJmpl3 commented Sep 9, 2019

In Vue CLI Vuetify , tree-shaking is the default option: https://github.com/vuetifyjs/vue-cli-plugin-vuetify/blob/dev/presets/default.json

@kevinmarrec
Copy link
Member Author

Sounds right to be in treeShake mode by default and let user use full if it wants to through options ?

@MrJmpl3
Copy link
Contributor

MrJmpl3 commented Sep 11, 2019

Sounds right to be in treeShake mode by default and let user use full if it wants to through options ?

For me, sound good

@1hakr
Copy link

1hakr commented Sep 28, 2019

Manual build mode is very much required. Currently the tree-shaking components are imported for every page even though they are not used.

@kevinmarrec
Copy link
Member Author

I'm working on it @1hakr :)

#177
https://twitter.com/K_Marrec/status/1178039799078408192

@kevinmarrec
Copy link
Member Author

Closed by #177 (possibility to disable automaticImports)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Feature request
Projects
None yet
Development

No branches or pull requests

4 participants