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

Refactor: refactor add-slots.js #556

Merged
merged 1 commit into from Apr 26, 2018
Merged

Refactor: refactor add-slots.js #556

merged 1 commit into from Apr 26, 2018

Conversation

lusarz
Copy link
Contributor

@lusarz lusarz commented Apr 24, 2018

No description provided.

elem = vm.$createElement(compileToFunctions(slotValue))
} else {
const compiledResult = compileToFunctions(`<div>${slotValue}{{ }}</div>`)
const _staticRenderFns = vm._renderProxy.$options.staticRenderFns
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed this 'replacing' of staticRenderFns and didn't experienced unit-test failures - is it ok to remove, or I miss something ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it's OK to remove, but we should add some tests to cover it. Can you write a test to check that a static slot is added correctly.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @eddyerburgh for information - I'll add appropriate tests for that

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I moved back staticRenderFns related code in pull request. To be honest I don't know what is static slot - I'm not yet familiar with everything related with Vue.

return Array.isArray(value) ? value : [value]
}

export function isObject (obj: mixed): boolean %checks {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This method is copied from Vue

@eddyerburgh eddyerburgh merged commit ce9e1bf into vuejs:dev Apr 26, 2018
@38elements 38elements mentioned this pull request May 5, 2018
eddyerburgh pushed a commit that referenced this pull request May 5, 2018
* Revert "refactor: refactor stub-components.js (#544)"

This reverts commit db5e07e.

* Revert "refactor: refactor add-slots.js (#556)"

This reverts commit ce9e1bf.

* delete packages/test-utils/src/shallow.js

* add functions

* add type SlotValue

* add test

* fix slotValue

* fix validateEnvironment

* add test

* fix lint

* Update slots.spec.js
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants