Merged
Conversation
If a component is functional and does not have a script tag, do not try to parse the non-existent script tag.
doesn't seem to be doing its job
so have to console.log json and then copy to local for testing...
don't edit in vim editor its bad mmkay
gimme back the last 4 minutes of my life
IT WAS AN OBJECT NOT A STRING
cuz the package I forked from seems to like that kinda style ;)
Codecov Report
@@ Coverage Diff @@
## master #50 +/- ##
=====================================
Coverage 100% 100%
=====================================
Files 2 2
Lines 4 4
=====================================
Hits 4 4Continue to review full report at Codecov.
|
Owner
|
@candyapplecorn thank you for your contrib, I see it's a small change, but could you introduce a test pls for this particular code you've added? Otherwise LGTM |
Contributor
Author
|
Sure, I will add a test today. |
added 3 commits
March 10, 2018 12:38
removed newlines no breaking changes
a test documenting Vue's inability to cope with functional components. throws a warning every time Vue tries to mount one. $el is not defined. breaking changes: none, but in the future $el should be defined, as it can't be used for testing if it's undefined
Contributor
Author
added 6 commits
March 10, 2018 16:07
test behaves differently on travis-ci than on my local machine, so now there is a test to document that breaking changes none
tried to use typeof, decided to use casting no breaking changes
context is needed for mounting functional components but not as an option for a render function no breaking changes
was passing an expression not a function to onClick handler no breaking changes
can't reproduce $el.querySelector being defined locally, yet on travis-ci it's defined. Without it being defined I can't debugger and figure out what the mock function isn't being called. Breaking changes: none; objeys all test criteria except for testing that mockFn was called
Owner
vire
added a commit
that referenced
this pull request
Mar 13, 2018
* Revert "chore(jest): Remove `mapCoverage` from jest settings (#56)" This reverts commit 06008e1. * Revert "ci(travis): Remove yarn installation on travis (#54)" This reverts commit df9d528. * Revert "chore(node): Update node engines in package.json to 8.9 (#53)" This reverts commit 75d5f37. * Revert "Support for Functional Components (#50)" This reverts commit c0c0590.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Please check if the PR fulfills these requirements
yarn lint)I wrote pretty descriptive comments so that should count as docs right?
What kind of change does this PR introduce? (check one with "x")
What is the current behavior? (You can also link to an open issue here)
functional components aren't supported; jest-vue-preprocessor would throw an error. This would break any tests that involved a functional component. So automated build systems would reject any builds that have tests for code that has functional components, even though the functional components work just fine for every other use (like rendering them on a webpage).
What is the new behavior?
functional components are semi-supported. Error 'no script available to transform' is no longer thrown. HOWEVER, the return value of Vue.compile does NOT have an $el.querySelector. This is a big problem as it makes it very hard to actually test functional components.
I wrote a test in my company's codebase for a functional component and it involved recursively delving through its childrens' vNode lists and piecing their
textkeys together... It's nasty.The test I've added for this PR specifically expects there to NOT be a querySelector on $el. Hopefully in the future this test will fail, which means functional components will have gained more support.
Does this PR introduce a breaking change? (check one with "x")
If this PR contains a breaking change, please describe the impact and migration path for existing applications: ...
Other information: