svelte icon indicating copy to clipboard operation
svelte copied to clipboard

[fix]: Warn user when binding rest operator

Open RaiVaibhav opened this issue 3 years ago • 5 comments

Fioxes: https://github.com/sveltejs/svelte/issues/6860

  • [x] It's really useful if your PR references an issue where it is discussed ahead of time. In many cases, features are absent for a reason. For large changes, please create an RFC: https://github.com/sveltejs/rfcs
  • [x] Prefix your PR title with [feat], [fix], [chore], or [docs].
  • [x] This message body should clearly illustrate what problems it solves.
  • [x] Ideally, include a test that fails without this PR but passes with it.

Tests

  • [x] Run the tests with npm test and lint the project with npm run lint

RaiVaibhav avatar May 11 '22 15:05 RaiVaibhav

Hey @tanhauhau can you check the PR and help me with the test, I ran my changes locally and I can see the warning when I am using the same component on repl but on test it says there is no warning.

RaiVaibhav avatar May 11 '22 15:05 RaiVaibhav

Therefore you need to move the validation into parse part.

Hey @baseballyama please check the changes in the test repo

RaiVaibhav avatar May 15 '22 06:05 RaiVaibhav

Actually existing warning checks are at the parse step. (constructor of Node) I still didn't think alternative implementing idea. (So I'm sorry if there is no alternative implementing way) but personally, this change seems like architecture breaking. (But we need to wait for maintainer's thoughts)

And 75 tests failed. I think there are actual failures so maybe you need to fix them.

Thank you for the response, most checks are failing because of the test runner change, I will check and fix this.

RaiVaibhav avatar May 16 '22 19:05 RaiVaibhav

Actually existing warning checks are at the parse step. (constructor of Node)

i've moved the validation from the compile/render-dom/wrappers/Element/Binding to compile/nodes/Binding

tanhauhau avatar Jul 04 '22 02:07 tanhauhau

Hey, @tanhauhau thank you for the update and refactoring :+1:

RaiVaibhav avatar Jul 11 '22 06:07 RaiVaibhav