epicmaxco / vuestic-ui

Free and Open Source UI Library for Vue 3 🀘
https://vuestic.dev
MIT License
3.34k stars 324 forks source link

Remove withTransportConfig wrapper #1634

Closed m0ksem closed 2 years ago

m0ksem commented 2 years ago

closes #1297 closes #1631 closes #1581

General

Patch instance props with vue reactive proxy. I looked in vue source code, Setup called, where we can access instance and patch it. Props in render function used from instance, so render function uses patched props. Same for DevTools. I believe using proxy is a nice approach, because we don't modify any object.

List of changes

Test

Check this PR

Derranion commented 2 years ago

VaAffix doesn't work. (works in the dev branch)

VaAffixError

Derranion commented 2 years ago

VaConfig -> Global config works while using dev variables (yarn serve) But does not work in the production mode (yarn serve:production) same behavior we can expect after the build.

Steps to reproduce:

  1. Press "Should set dark red color on click" button in the VaConfig
  2. "Must change" should be red after this in production

Production mode: VaConfigProductionMode

Expected: VaConfigExpected

Derranion commented 2 years ago

VaToast is broken - does not show any toasts.

Derranion commented 2 years ago

VaDateInput text displays function body instead of expected visual representation of the date. Displayed function seems to not be executed.

DateInputTextIsBroken

Derranion commented 2 years ago

VaConfig local config does not update after change and uses default values instead.

Steps to repdoduce:

  1. Change config color to any value.

localConfigUpdateIssue

Derranion commented 2 years ago

Please tell if you need some help or busy to update this.

m0ksem commented 2 years ago

@Derranion, pretty funny thing! 😁Nice catch.

withTransportConfigWrapper has resolved Function type as Object, But in vue docs I can see that Function type default value is resolved as Function, not like object fabric.

https://vuejs.org/guide/components/props.html#prop-validation

  // Function with a default value
  propG: {
    type: Function,
    // Unlike object or array default, this is not a factory function - this is a function to serve as a default value
    default() {
      return 'Default function'
    }
  }

I will change all components with () => () => result default value for Function props to () => result.

m0ksem commented 2 years ago

VaDateInput text displays function body instead of expected visual representation of the date. Displayed function seems to not be executed.

DateInputTextIsBroken

Marked all other comments with πŸš€ reaction as resolved.

m0ksem commented 2 years ago

Usage of incorrect prop value inside of the Local config breaks component completely and makes it disappear.

Steps to reproduce:

1. Open `VaConfig` demo

2. In the `local config` color input field remove one symbol

3. Hover `VaButton` component.

localConfigInvalidValueBreaskComponent

It's correct behavior πŸ˜‹, First, it wasn't disappearing on hover - #ff00 is cast to white color for some reason.
Having error during rendering process will stop component rendering. This issue is present even in develop.