Finalize API
See original GitHub issueLet’s agree on a basic API and make an RFC so everyone can express their thoughts.
Proposed Wrapper API
method | status | notes |
---|---|---|
attributes | keep | |
classes | keep | |
exists | keep | |
contains | keep | |
destroy | keep | |
emitted | keep | |
find | keep | |
findAll | keep | |
html | keep | |
name | keep | |
trigger | keep | now returns nextTick . So you can do await wrapper.find('#button').trigger('click') . Nice! |
setChecked | keep | see trigger |
setSelected | keep | see trigger |
setValue | keep | see trigger |
vm | keep | |
element | keep |
Wrapper API - Deprecations
method | status | explanation |
---|---|---|
emittedByOrder | deprecate | emitted serves this purpose |
get | deprecate | This was added recently. similar to find - can we combine them? |
is | deprecate | just use native tagName property |
isEmpty | deprecate | Available via custom matcher, difficult to get 100% right |
isVisible | deprecate | Available via custom matcher, difficult to get 100% right |
isVueInstance | deprecate | |
props | deprecate | Anti-pattern. Test what a prop does, not its presence or value. |
setData | deprecate | Anti-pattern. Use data mounting option to set a specific state. |
setMethods | deprecate | Anti-pattern. Vue does not support arbitrarily changing methods, nor should VTU |
setProps | deprecate | See setData , setMethods |
text | deprecate | use toContain |
Mounting Options - Proposed API
method | status | explanation |
---|---|---|
data | keep | |
slots | keep | |
scopedSlots | deprecate | Slots are scoped by default in Vue 3. Use slots . |
context | deprecate | No longer needed |
stubs | keep | |
provide | keep | |
mixins | new | attach mixins by app.mixin , since you no longer attach these to Vue.prototype |
plugins | new | attach mixins by app.mixin , since you no longer attach these to Vue.prototype |
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:13 (13 by maintainers)
Top Results From Across the Web
Object (Java Platform SE 7 ) - Oracle Help Center
The finalize method of class Object performs no special action; it simply returns normally. Subclasses of Object may override this definition. The Java ......
Read more >Finalize an invoice – curl - Stripe API reference
Controls whether Stripe will perform automatic collection of the invoice. When false , the invoice's state will not automatically advance without an explicit ......
Read more >finalize - RxJS
Returns an Observable that mirrors the source Observable, but will call a specified function when the source terminates on complete or error.
Read more >Tutorial: The Finalize API (an Unsung Hero) | Corona Labs
In this tutorial, learn about the under-utilized but powerful "finalize" event and how it can be used to keep your app running smoothly....
Read more >Finalize - api
PROPERTY_SETTER]) @Incubating class Finalize. Denotes that the RuleSource method rule carrying this annotation finalizes the rule subject.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
That should be easy to implement - we just have
setValue
check the element type, then callsetSelected
,setChecked
etc under the hood. Not sure is there is some complexity I’m missing.I think this should be a (separate) RFC to the deprecation ones. A smaller, more simple API is definitely attractive to me.
Sounds good