0
0
mirror of https://github.com/sveltejs/svelte.git synced 2024-11-30 00:46:29 +01:00
Commit Graph

2644 Commits

Author SHA1 Message Date
Anthony Le Goas
b517df14e4
[feat] check noninteractive roles on interactive elements (#5955)
* check noninteractive roles on interactive elements

* refactor to match the eslint-plugin-jsx-a11y implementation

* update test case

Co-authored-by: tanhauhau <lhtan93@gmail.com>
2022-07-17 17:27:35 +08:00
Tan Li Hau
26d1455b27
fixed removal of empty stylesheets created from transitions (#7662)
Co-authored-by: Mathias Picker <mattis123@live.no>
2022-07-17 17:25:36 +08:00
Tan Li Hau
2db60a77e1
rename test files from svelte-slot -> svelte-fragment (#7679) 2022-07-12 23:20:44 +08:00
Anthony Le Goas
f5111ef436
[feat] add a11y check on abstract roles (#6241)
* add a11y check on abstract roles

* use aria-query and move warnings to compiler_warnings file

* uppercase warning message

Co-authored-by: tanhauhau <lhtan93@gmail.com>
2022-07-12 06:52:25 +08:00
kwangure
39901986d6
[feat]: Add A11y aria-proptypes check (#6978)
* Add aria prop type list

* feat: check aria attribute types

* feat: add proptype tests

* Add documentation

* use aria-query

Co-authored-by: Nurassyl Zekenov <nurassyl@snoonu.com>
Co-authored-by: mka_882@yahoo.com <mka_882@yahoo.com>
Co-authored-by: tanhauhau <lhtan93@gmail.com>
Co-authored-by: David Mosher <davidmosher@gmail.com>
2022-07-11 09:40:12 +08:00
Mel
1d19aebe38
a11y: Add role-has-required-aria-props rule (#5852)
* Check required props for ARIA roles

* Test required ARIA props check

* Properly indent with tabs in test

* swtich to use aria-query

* fix validation test

* update docs

Co-authored-by: tanhauhau <lhtan93@gmail.com>
2022-07-11 02:23:41 +08:00
kindoflew
7e1691cd62
[fix] support @layer (#7514)
* add test

* add layer to apply check
2022-07-04 23:55:34 +09:00
qinmu
02f60fbebf
[fix]destroy empty component (#7492)
* fix: destroy non-fragment element such as empty components

* fix: fragment property of Empty Component is set as true in dev mode, inconsistent with production mode

* chore: revert 'removal' of component.compile_options.dev

* feat: add test for destroying empty component

* chore: update typechecking callback

* chore: revert fragment dev checks

* chore: remove unnecessary comment

* chore: update test for empty-component-destroy

* fix: revert back the patching of console.log

* use before_test and after_test

Co-authored-by: qinmu <magenta2127@mail.com>
Co-authored-by: tanhauhau <lhtan93@gmail.com>
2022-07-04 09:45:39 +08:00
Maurício Kishi
f8605d6acb
[fix] harden attribute escaping during ssr (#7530) 2022-06-20 13:02:48 +02:00
Yuichiro Yamashita
6776fe03fd
fix to apply class directive for svelte:element (#7531) 2022-05-18 11:12:10 +08:00
Yuichiro Yamashita
0d017f4820
[fix] rendering void tag for <svelte:element> (#7453) 2022-04-30 14:37:09 -04:00
Tan Li Hau
a2de3894c0
[feat] support const tag for if block (#7451) 2022-04-30 14:34:58 -04:00
Yuichiro Yamashita
1f1750e72e
[fix] always use set_attributes for attribute of <svelte:element> (#7486) 2022-04-30 14:03:59 -04:00
Yuji Sugiura
a068719208
[fix] do not be over-eager in removing unused CSS for dialog[open] (#7495) 2022-04-30 13:57:49 -04:00
Yuichiro Yamashita
1803290864
[fix] Specify svg namespace if {@html} is used in svg (#7464)
* add test

* create svg element if {@html} tag is inside of svg

* always use claim_html_tag
2022-04-20 00:20:16 +08:00
Yuichiro Yamashita
eb37f4a285
[chore] fix lint (#7466) 2022-04-16 19:16:15 +02:00
lidlanca
fb341cca2c
[fix] textContent should not be set for <template> element. (#7297)
* [fix] textContent should not be set for <template> element.

* tidy - name convetion. minor refactor extract "is template" check to a variable and replace usages.

* test template with text content

* update html in test
2022-04-16 10:24:59 +08:00
Bob Fanger
0b0221de99
[fix] Local transitions from #key blocks (#7286)
* fix: Local transitions from #key blocks

When adding `|local` to a transition inside a {#key} block, only the outro was triggered not the intro.

This PR fixes #5950

* add test case

Co-authored-by: tanhauhau <lhtan93@gmail.com>
2022-04-16 09:40:53 +08:00
Yosuke Ota
3a238fe057
[fix] strip leading newline after <pre> and <textarea> (#7280)
Fixes #7264
2022-04-14 16:31:03 +02:00
Tan Li Hau
4aff59b080
[fix] correctly track dependencies of let: bindings (#7448)
Fixes #7440
2022-04-13 17:34:40 +02:00
Henning Groß
9276f85768
[feat] improve error message for animate used in a non-keyed each block (#6838)
* introdcued new compiler error

* making use of newly created compiler error

* updated test for animation not in keyed each

* removed unneeded conditions
2022-04-13 00:22:11 +08:00
Tan Li Hau
d9687da632
each animate allow having comment siblings (#7435)
Co-authored-by: GHOST <ghostdevbusiness@gmail.com>

Co-authored-by: GHOST <ghostdevbusiness@gmail.com>
2022-04-12 16:48:09 +08:00
Tan Li Hau
e50be669cc
fix const declared without let: binding get ignored (#7434) 2022-04-12 16:38:08 +08:00
gtmnayan
afd3f4e5a9
[feat] Make setContext return the value that was passed in (#7432)
* return value from setContext

* update docs

* Add test

* eof new line

* pacify the linter

* const and tabs
2022-04-11 08:50:28 +08:00
Yuichiro Yamashita
eca1a652fb
[fix] better context checks for identifiers in const tags (#7222)
Fixes #7423
Fixes #7431
Fixes #7206
Fixes #7431
Fixes #7221

Co-authored-by: tanhauhau <lhtan93@gmail.com>
2022-04-08 19:30:49 +02:00
Yuichiro Yamashita
e0d93254fd
[feature] Dynamic elements implementation <svelte:element> (#6898)
Closes #2324

Co-authored-by: Alfred Ringstad <alfred.ringstad@hyperlab.se>
Co-authored-by: Simon Holthausen <simon.holthausen@accso.de>
Co-authored-by: tanhauhau <lhtan93@gmail.com>
2022-04-08 16:54:55 +02:00
Tan Li Hau
89fda7edae
[fix] add key dependencies into block dependencies (#7422)
* add key dependencies into block dependencies

* fix lint
2022-04-08 22:24:15 +08:00
Pat Cavit
9f4602ac6f
[fix] style: directive should prevent innerHTML optimization (#7390)
Fixes #7386
2022-03-30 10:49:25 -04:00
Maurício Kishi
cdd3575026
[fix] attribute escaping during ssr (#7333)
Fixes #7327 and a related security issue
2022-03-03 12:22:38 +01:00
Geoff Rich
0a3353b671
[fix] do not collapse whitespace-only css vars (#7303)
Fixes #7152, see also #7288

--foo:; used to be an invalid CSS custom property value, while -foo: ; was valid. By collapsing the whitespace in these declaration values, we were breaking scenarios where an empty custom property was desired. The spec was updated to trim whitespace and treat these values identically, but Chromium browsers still treat --foo; as invalid. This was recently fixed and will be released in Chrome 99, but this would still be a good fix to maintain backwards compatibility.
2022-03-03 08:25:52 +01:00
rgossiaux
e2adf6a211
fix: do not generate unused-export-let inside <script context="module"> (#7232)
Fixes #7055. This warning can be delegated to userland tools like eslint
2022-03-02 16:55:02 -08:00
Yosuke Ota
7463d51301
[fix]: keep space in <pre> or when preserveWhitespace: true (#6990)
Fixes #6437
Fixes #4731
Closes #4737

Whitespace is now untouched inside <pre> tag and other tags if preserveWhitespace is true
2022-02-02 09:30:25 +01:00
Efe Selim Küçük
587f94eb65
[feat] Better error message for inline component style directive (#7187)
Closes #7177
2022-02-02 08:56:23 +01:00
Yuichiro Yamashita
5665f711fd
[fix] raise compile error if variable name is same as imported variable name (#7145) 2022-01-26 10:16:20 -05:00
Yuichiro Yamashita
00e394e3c8
[fix] fix crash when using arrow functions in {@const} (#7144) 2022-01-26 09:50:18 -05:00
Andreas Ehrencrona
a4e4027f79
Handle whitespace inside #each with animation (#5477)
* Strip out whitespace inside each when it has an animation

* remove accidentally committed file

* lint

* add test to validate no error

* update changelog

Co-authored-by: Simon H <5968653+dummdidumm@users.noreply.github.com>
Co-authored-by: tanhauhau <lhtan93@gmail.com>
Co-authored-by: Tan Li Hau <tanhauhau@users.noreply.github.com>
2022-01-15 11:47:02 +08:00
Tan Li Hau
dc06ea916e
fix: style directive not reactive in {#each} loop (#7140) 2022-01-14 12:16:34 -05:00
Tan Li Hau
815bc7ef6e
fix: test cases should fail when it should fail (#7139) 2022-01-14 12:12:23 -05:00
Simon H
7044a32a2b
[fix] adjust style directive AST (#7127)
- deduplicate type name: Is now "StyleDirective"
- Don't transform value array to template literal in the AST phase but in the compiler phase. This ensures other tools know what the raw output was and that start/end positions are available
2022-01-12 15:12:50 -05:00
GHOST
c67f8ef14c
[fix] handle kebab case style directives (#7123)
fixes #7122
2022-01-12 11:42:13 +01:00
Tan Li Hau
b5aaa6641b
[feat] implement constants in markup (#6413) 2022-01-11 17:10:09 -05:00
Yuichiro Yamashita
895b4c6721
[fix] hydrate correct elements when using @html (#6946) 2022-01-09 06:12:57 -08:00
Paul Murray
8a47b5ec9e
[feat] Style directives (#5923)
* add Style node, interfaces

* style-directives: add parser and runtime test

* style-directives: push styles in to styles array on Element

* style-directives: minimal ssr work

* style-directives: ssr add_styles

* style-directive: tests

* style-directives: work in progress

* obviously incorrect hard-coded color

* tweak

* style directive interface

* style-directives: get text from info in Style node

* style-directives: add_styles func in ElementWrapper

* style-directives: ssr rendering

* handle text-only style directive in tag.ts

* style-directives: handle spread styles in ssr

* style-directives: more parser tests

* style-directives: more inline tests

* style-directives: remove solo tests

* style-directives: cleanup

* style-directives: tweak spread ssr internal

* style-directives: push updater into update chunks; add dynamic test;

* remove .solo

* check for dynamic dependencies before adding update chunk

* add test of multiple styles; remove null styles;

* style-directives: docs; more tests of multiple styles

* style-directives: use camelcase

* style-directives: cleanup

* style-directives: fix mustache template case with template literal

* style-directives: use ternary

* style-directives: linting

* style-directives: remove "text" from interface

* style-directives: actually, remove StyleDirective interface entriely

* add more test, fix test for ssr

* fix lint and tidy up

* add test for css variables

* fix linting errors

Co-authored-by: pmurray73 <pmurray73@bloomberg.net>
Co-authored-by: Tan Li Hau <lhtan93@gmail.com>
2022-01-08 11:09:11 -05:00
Tan Li Hau
5e40277167
[feat] add reference for default values in destructuring context (#7007) 2022-01-06 16:05:49 -05:00
Tan Li Hau
9f2b5afdf7
[fix] binding member expression should only invalidate the object, not the member property (#7008) 2022-01-06 15:28:53 -05:00
Tan Li Hau
2f0f330b76
[fix] {:else if} value incorrectly cached (#7043) 2022-01-06 11:07:37 -05:00
pngwn
4240455e02
[fix] ensure truthy non-boolean attributes are rendered correctly in SSR (#7066) 2022-01-06 10:14:09 -05:00
Yuichiro Yamashita
966c03a317
[chore] fix test flakiness (#7076) 2022-01-05 10:30:02 -08:00
Ignatius Bagus
2012124e87
[fix] foreign namespace hash link (#7080) 2022-01-04 13:41:42 -08:00
James Bradbury
84a4ef07c9
[feat] add a11y-no-redundant-roles check (#7067)
Part of #820
Closes #5361

Co-authored-by: mhatvan <markus_hatvan@aon.at>
2022-01-03 11:33:08 +01:00