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

Intercept and suppress specific errors #6432

Open
Kansuler opened this issue Jun 23, 2021 · 1 comment
Open

Intercept and suppress specific errors #6432

Kansuler opened this issue Jun 23, 2021 · 1 comment
Labels
compiler Changes relating to the compiler feature request stale-bot

Comments

@Kansuler
Copy link

Kansuler commented Jun 23, 2021

Is your feature request related to a problem? Please describe.
I'm using a library named three-elements that creates custom elements with directives, one of those directives are ref:xxx. However this creates an unnecessary complication as Svelte emits a deprecation error with no way of suppressing it.

The ref directive is no longer supported — use `bind:this={xxx}` instead
ParseError: The ref directive is no longer supported — use `bind:this={xxx}` instead
    at error (file:///home/xxx/workspace/node_modules/svelte/compiler.mjs:16746:19)
    at Parser$1.error (file:///home/xxx/workspace/node_modules/svelte/compiler.mjs:16822:9)
    at read_attribute (file:///home/xxx/workspace/node_modules/svelte/compiler.mjs:16037:20)
    at tag (file:///home/xxx/workspace/node_modules/svelte/compiler.mjs:15856:25)
    at new Parser$1 (file:///home/xxx/workspace/node_modules/svelte/compiler.mjs:16781:21)
    at parse$3 (file:///home/xxx/workspace/node_modules/svelte/compiler.mjs:16913:20)
    at compile (file:///home/xxx/workspace/node_modules/svelte/compiler.mjs:30006:17)
    at compileSvelte (file:///home/xxx/workspace/node_modules/@sveltejs/vite-plugin-svelte/dist/index.js:264:20)
    at async TransformContext.transform (file:///home/xxx/workspace/node_modules/@sveltejs/vite-plugin-svelte/dist/index.js:873:27)
    at async Object.transform (/home/xxx/workspace/node_modules/vite/dist/node/chunks/dep-bc228bbb.js:44765:30)

Describe the solution you'd like
A way to access and suppress individual error types. The purpose for this error is to give deprecation notice, but it does needlessly occupy a directive that might collide with other libraries. ref is not uncommon as a directive.

Describe alternatives you've considered
I've put forward a suggestion to three-elements of prefixing their directive to avoid collisions with frameworks/libraries.

How important is this feature to you?
As it stands right now, I cannot use this library to create declarative 3d scenes.

Additional context
The error in svelte code base: https://github.com/sveltejs/svelte/blob/master/src/compiler/parse/state/tag.ts#L394-L399

@stale
Copy link

stale bot commented Dec 24, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale-bot label Dec 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler Changes relating to the compiler feature request stale-bot
Projects
None yet
Development

No branches or pull requests

2 participants