Comments (4)
Hey @piehei
It is the default behaviour of vue-loader
in webpack
i think: webpack/webpack#3329.
Did you do benchmarking? What is the performance fall?
I have people using it in prod. as noone mentioned about bad performance so i am curious now.
On the matter, I can prob. add a separate building task using ExtractTextPlugin.
E.g. you will have to do something like
`include('vue-js-modal/index_stripped.css')`
`include('vue-js-modal/index_stripped.js')`
Will it help?
Thanks for kind words 👍 😄
from vue-js-modal.
It causes the browser to recalculate styles if I'm not mistaken. That could cause the page to flash white and/or some jank.
The point being:
- Browser fetches the css bundle, processes it and calculates everything
- Browser fetches the js bundle
- The js dynamically adds more styles to the head
- The browser has to do recalculation
My own Vue components don't insert any css, everything is included in the single css bundle webpack generates. I don't use any other 3rd party components so cannot compare.
One thing to note: when using webpack dev server, all the styles are inserted into the DOM no matter what component is in question. But this should only happen in dev mode, not production if I'm not completely mistaken.
There shouldn't be any reason to add the css dynamically when the app is running (if we leave out all code-splitting sorcery).
Any thoughts? Am I missing something?
:-)
from vue-js-modal.
Yeah, you have a point.
I am still not sure if it is a problem though, especially for the component that should be invisible by default and if you already use some framework like Vue or React. Recalculating styles once is not a biggie in comparison to other operations your browser has to do to run 200kb+ of javascript :D
I have been using it in production for a while and never faced any problems (please consider that my home internet is 10mb/s shared between 3 ppl 😃 😢 😢 )
from vue-js-modal.
I've looked through a dozen of component to figure out how to pack it for distribution (i'm a webpack noob) and all of them supplied just .js
and .js.map
files in their dist
.
Do you think the solution from my first answer will be useful for you?
Hope it will help you to bundle the css styles all together, but I do not want to break the plugin for other people who already have it in prod 😅
from vue-js-modal.
Related Issues (20)
- delete vm--overlay background opacity
- Disabling the escape key handler HOT 3
- The function of closing the modal window on Esc has no reactivity HOT 1
- vue3 support HOT 1
- Cannot read properties of undefined (reading '$modal') HOT 5
- Modal is not scrollable when adaptive is true HOT 1
- How to set border-radius HOT 1
- Problem with styles in component inside modal call
- vee-validate validation not working once wrapped with vue-js-modal
- Unable to preventDefault inside passive event listener due to target being treated as passive HOT 1
- Got "Incorrect or missing password" when installing this package HOT 1
- text-align on v-modal causes problems in RTL languages
- Can add the close button dynamically?
- Incorrect documentation on Events section
- TypeError: Cannot read properties of undefined (reading 'show') HOT 2
- Clunky behaviour on reloading pages with SSR nuxt HOT 1
- Preventing multiple modals opening at the same time HOT 2
- TypeError: undefined is not an object (evaluating 'e.prototype.$modal')
- Create for version three
- vue-js-modal supporting vue js 3latest version HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vue-js-modal.