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

detect unused/misplaced components #1050

Merged
merged 1 commit into from
Dec 30, 2017
Merged

detect unused/misplaced components #1050

merged 1 commit into from
Dec 30, 2017

Conversation

Rich-Harris
Copy link
Member

Ref #1039. This issues a) a compile time warning if unused components are detected, and b) a dev mode run time warning if missing data properties are found on components, on the probability that the component author intends for those components to be used with <:Component>

@codecov-io
Copy link

codecov-io commented Dec 24, 2017

Codecov Report

Merging #1050 into master will increase coverage by 0.02%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1050      +/-   ##
==========================================
+ Coverage   92.02%   92.04%   +0.02%     
==========================================
  Files         121      121              
  Lines        4376     4388      +12     
  Branches     1410     1415       +5     
==========================================
+ Hits         4027     4039      +12     
  Misses        148      148              
  Partials      201      201
Impacted Files Coverage Δ
src/generators/server-side-rendering/index.ts 95.77% <ø> (ø) ⬆️
src/validate/index.ts 88.67% <100%> (+2.01%) ⬆️
src/generators/dom/index.ts 95.48% <100%> (+0.05%) ⬆️
src/validate/html/validateElement.ts 89.13% <100%> (+0.24%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 37f8f8a...146f645. Read the comment docs.

@tomcon
Copy link

tomcon commented Dec 27, 2017

Had a silly error where I'd cut and pasted a ActiveItems component like so:

<ActiveItems><ActiveItems>

(i.e. didn't close off the component tag)

rollup was watching and re-compiled it ok but the runtime error wasn't the best and it took quite some time to track this one down

Uncaught TypeError: Cannot read property 'default' of undefined
    at Object.mount [as m] (App.html:24)
    at new App (App.html:24)
    at main.js:6
    at main.js:22

@Rich-Harris
Copy link
Member Author

@tomcon can you create a repro please (in a separate issue, as it's not strictly related to this PR)? I can't seem to get the same error. Thanks

@Rich-Harris Rich-Harris merged commit f7c68be into master Dec 30, 2017
@Rich-Harris Rich-Harris deleted the gh-1039 branch December 30, 2017 15:46
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.

3 participants