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

Show a warning if a variable is not being used in a component #642

Closed
emilos opened this issue May 20, 2020 · 3 comments
Closed

Show a warning if a variable is not being used in a component #642

emilos opened this issue May 20, 2020 · 3 comments
Labels
enhancement New feature or request

Comments

@emilos
Copy link
Contributor

emilos commented May 20, 2020

No description provided.

@emilos emilos added the enhancement New feature or request label May 20, 2020
@inikonorov
Copy link
Contributor

hey, I wanna help you with this issue, can you shortly explain what should I do? and can you talk a little bit about project structure? I wanna help you with other issues!

@emilos
Copy link
Contributor Author

emilos commented Aug 21, 2020

hey @inikonorov, thanks for asking, happy to see you again! :) I'll try to update the descriptions of other tasks today to make it more obvious what is needed

For this task, we'd like to handle the following case:

Step 1:

Define a simple component, like link.html

<a {class} {id}><slot /></a>

Step 2:

Load this component in other place and pass a variable that is not handled by the component.

<import link from "components/link.html" />

<link class="foo" id="bar" href="some-url.html">baz</link>

href attribute is currently not handled inside of the component, so it's unused. We'd like to show an error in this case, something like:

href attribute is not required by the link component

This way the developer can find out where he missed something.

This task might be pretty hard, but potentially good to try to understand the code base a little bit :).

To see how the compiler works, it would be good to check out test cases first. You can try checking unit tests first and acceptance specs after that.

After seeing that you can potentially start be looking how Compiler Renderer and utilities/collect.js work. The code is basically iterating over an html tree and generating a js abstract syntax tree based on that, which is later used as a rendering function.

Knowledge about html/css/javascript syntax trees is required to start, in package.json you can check the dependencies and go through their docs to understand a bit more :).

Thanks!

@inikonorov
Copy link
Contributor

Okay, thanks! I'll try my best :)

@emilos emilos closed this as completed Sep 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants