Skip to content
This repository has been archived by the owner on Jan 26, 2024. It is now read-only.

feature: registering ui components globally #584 #585

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

PawFV
Copy link

@PawFV PawFV commented Feb 11, 2021

Implements solution mentioned in #584

@CLAassistant
Copy link

CLAassistant commented Feb 11, 2021

CLA assistant check
All committers have signed the CLA.

@AishwaryShrivastav
Copy link
Contributor

Hey @PawFV, Isn't registering all the components globally affect the performance of the app ?

@PawFV
Copy link
Author

PawFV commented Apr 12, 2021

Hey @PawFV, Isn't registering all the components globally affect the performance of the app ?

What is the performance impact of doing this?

From my point of view, not much, you prioritize development speed, clean code structure and scalability over 100kb extra in your bundle size. I'm just using what I listed above and if any it eased a bit the chaos when developing, I'm more concerned about the performance of other setups if that makes sense. If you want a clean approach which it's documented in Vuejs docs

docs

It's essentially describing the issue I see here, where you have too many repetitions. First thing that clicks into my mind when I start to see repeated patterns, "If I'm doing that much repetition then I'm doing something wrong".

You can actually use a fancier solution which is registering them on-demand, it's linked in the docs I sent you, here is the example.

Another issue I see with the way this whole ecosystem is that isn't published as an npm packages, so it would be miles easier to let the user decide which component/mixin/functionality they want to use and just link the docs for its usage.

Another example you can look is, a well known UI library, Vuetify. Take a look at how it's built.

Here is an example, I built a vuejs app with default webpack config without vuetify, and then with Vuetify install option. (Which just comes with automatic registration of components, you don't have to import them).

Plain vue
webpack-plain

Vuetify installed
webpack-vuetify

I could actually help you with lot's of issues but my time is very limited at the moment, if you want to include me as maintainer then that's another discussion that my company it's probably able to afford, just let me know :).

@AishwaryShrivastav
Copy link
Contributor

Hey @Fifciu can you share your thoughts here ?

@Fifciu
Copy link
Collaborator

Fifciu commented Apr 14, 2021

Hello. I wouldn't import every component, it is too much. Obviously, developer experience is very important. However, I wouldn't like to force my users to load so many unused components.

In my opinion, in the future - SFUI should release its own loader that automatically loads only used components, e.g. basing on this one - https://github.com/vuetifyjs/vuetify-loader and with this solution, we should have both amazing user & developer experience.

@PawFV
Copy link
Author

PawFV commented Apr 16, 2021

SFUI should release its own loader that automatically loads only used components.

This, exactly!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants