svelte 3.55.0 → 3.55.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # Svelte changelog
2
2
 
3
+ ## 3.55.1
4
+
5
+ * Fix `draw` transition with delay showing a dot at the beginning of the path ([#6816](https://github.com/sveltejs/svelte/issues/6816))
6
+ * Fix infinity runtime call stack when propagating bindings ([#7032](https://github.com/sveltejs/svelte/issues/7032))
7
+ * Fix static `<svelte:element>` optimization in production mode ([#7937](https://github.com/sveltejs/svelte/issues/7937))
8
+ * Fix `svelte-ignore` comment breaking named slot ([#8075](https://github.com/sveltejs/svelte/issues/8075))
9
+ * Revert change to prevent running init binding unnecessarily ([#8103](https://github.com/sveltejs/svelte/issues/8103))
10
+ * Fix adding duplicate event listeners with `<svelte:element on:event>` ([#8129](https://github.com/sveltejs/svelte/issues/8129))
11
+ * Improve detection of promises that are also functions ([#8162](https://github.com/sveltejs/svelte/pull/8162))
12
+ * Avoid mutating spread component props during SSR ([#8171](https://github.com/sveltejs/svelte/issues/8171))
13
+ * Add missing typing for global `part` attribute ([#8181](https://github.com/sveltejs/svelte/issues/8181))
14
+ * Add missing `submitter` property to `on:submit` event type
15
+
3
16
  ## 3.55.0
4
17
 
5
18
  * Add `svelte/elements` for HTML/Svelte typings ([#7649](https://github.com/sveltejs/svelte/pull/7649))
package/compiler.js CHANGED
@@ -17558,7 +17558,7 @@
17558
17558
  }),
17559
17559
  a11y_no_noninteractive_tabindex: {
17560
17560
  code: 'a11y-no-noninteractive-tabindex',
17561
- message: 'A11y: noninteractive element cannot have positive tabIndex value'
17561
+ message: 'A11y: noninteractive element cannot have nonnegative tabIndex value'
17562
17562
  },
17563
17563
  redundant_event_modifier_for_touch: {
17564
17564
  code: 'redundant-event-modifier',
@@ -33643,6 +33643,7 @@
33643
33643
  }
33644
33644
  else {
33645
33645
  this.tag_expr = new Expression(component, this, scope, string_literal(info.tag));
33646
+ this.name = info.tag;
33646
33647
  }
33647
33648
  }
33648
33649
  else {
@@ -34472,6 +34473,9 @@
34472
34473
  children.push(slot_template);
34473
34474
  info.children.splice(i, 1);
34474
34475
  }
34476
+ else if (child.type === 'Comment' && children.length > 0) {
34477
+ children[children.length - 1].children.unshift(child);
34478
+ }
34475
34479
  }
34476
34480
  if (info.children.some(node => not_whitespace_text(node))) {
34477
34481
  children.push({
@@ -36865,6 +36869,12 @@
36865
36869
  super(renderer, block, parent, node);
36866
36870
  this.child_dynamic_element_block = null;
36867
36871
  this.child_dynamic_element = null;
36872
+ this.var = {
36873
+ type: 'Identifier',
36874
+ name: node.name.replace(regex_invalid_variable_identifier_characters$2, '_')
36875
+ };
36876
+ this.void = is_void(node.name);
36877
+ this.class_dependencies = [];
36868
36878
  if (node.is_dynamic_element && block.type !== CHILD_DYNAMIC_ELEMENT_BLOCK) {
36869
36879
  this.child_dynamic_element_block = block.child({
36870
36880
  comment: create_debugging_comment(node, renderer.component),
@@ -36873,13 +36883,12 @@
36873
36883
  });
36874
36884
  renderer.blocks.push(this.child_dynamic_element_block);
36875
36885
  this.child_dynamic_element = new ElementWrapper(renderer, this.child_dynamic_element_block, parent, node, strip_whitespace, next_sibling);
36886
+ // the original svelte:element is never used for rendering, because
36887
+ // it gets assigned a child_dynamic_element which is used in all rendering logic.
36888
+ // so doing all of this on the original svelte:element will just cause double
36889
+ // code, because it will be done again on the child_dynamic_element.
36890
+ return;
36876
36891
  }
36877
- this.var = {
36878
- type: 'Identifier',
36879
- name: node.name.replace(regex_invalid_variable_identifier_characters$2, '_')
36880
- };
36881
- this.void = is_void(node.name);
36882
- this.class_dependencies = [];
36883
36892
  if (this.node.children.length) {
36884
36893
  this.node.lets.forEach(l => {
36885
36894
  extract_names(l.value || l.name).forEach(name => {
@@ -36932,6 +36941,7 @@
36932
36941
  node.styles.length > 0 ||
36933
36942
  this.node.name === 'option' ||
36934
36943
  node.tag_expr.dynamic_dependencies().length ||
36944
+ node.is_dynamic_element ||
36935
36945
  renderer.options.dev) {
36936
36946
  this.parent.cannot_use_innerhtml(); // need to use add_location
36937
36947
  this.parent.not_static_content();
@@ -37694,9 +37704,10 @@
37694
37704
  }
37695
37705
  else if (wrapper.node.name === 'noscript') ;
37696
37706
  else {
37707
+ const nodeName = wrapper.node.name;
37697
37708
  // element
37698
- state.quasi.value.raw += `<${wrapper.node.name}`;
37699
- const is_empty_textarea = wrapper.node.name === 'textarea' && wrapper.fragment.nodes.length === 0;
37709
+ state.quasi.value.raw += `<${nodeName}`;
37710
+ const is_empty_textarea = nodeName === 'textarea' && wrapper.fragment.nodes.length === 0;
37700
37711
  wrapper.attributes.forEach((attr) => {
37701
37712
  if (is_empty_textarea && attr.node.name === 'value') {
37702
37713
  // The value attribute of <textarea> renders as content.
@@ -37708,7 +37719,7 @@
37708
37719
  });
37709
37720
  if (!wrapper.void) {
37710
37721
  state.quasi.value.raw += '>';
37711
- if (wrapper.node.name === 'pre') {
37722
+ if (nodeName === 'pre') {
37712
37723
  // Two or more leading newlines are required to restore the leading newline immediately after `<pre>`.
37713
37724
  // see https://html.spec.whatwg.org/multipage/grouping-content.html#the-pre-element
37714
37725
  const first = wrapper.fragment.nodes[0];
@@ -37730,7 +37741,7 @@
37730
37741
  }
37731
37742
  }
37732
37743
  to_html(wrapper.fragment.nodes, block, literal, state);
37733
- state.quasi.value.raw += `</${wrapper.node.name}>`;
37744
+ state.quasi.value.raw += `</${nodeName}>`;
37734
37745
  }
37735
37746
  else {
37736
37747
  state.quasi.value.raw += '/>';
@@ -38819,7 +38830,7 @@
38819
38830
  }
38820
38831
  `;
38821
38832
  component.partly_hoisted.push(body);
38822
- return b `@binding_callbacks.push(() => @bind(${this.var}, '${binding.name}', ${id}, ${snippet}));`;
38833
+ return b `@binding_callbacks.push(() => @bind(${this.var}, '${binding.name}', ${id}));`;
38823
38834
  });
38824
38835
  const munged_handlers = this.node.handlers.map(handler => {
38825
38836
  const event_handler = new EventHandlerWrapper(handler, this);
@@ -41724,7 +41735,7 @@
41724
41735
  const uses_spread = node.attributes.find(attr => attr.is_spread);
41725
41736
  let props;
41726
41737
  if (uses_spread) {
41727
- props = x `@_Object.assign(${node.attributes
41738
+ props = x `@_Object.assign({}, ${node.attributes
41728
41739
  .map(attribute => {
41729
41740
  if (attribute.is_spread) {
41730
41741
  return attribute.expression.node;
@@ -45339,7 +45350,7 @@
45339
45350
  if (result) {
45340
45351
  const { compile_options, name } = this;
45341
45352
  const { format = 'esm' } = compile_options;
45342
- const banner = `${this.file ? `${this.file} ` : ''}generated by Svelte v${'3.55.0'}`;
45353
+ const banner = `${this.file ? `${this.file} ` : ''}generated by Svelte v${'3.55.1'}`;
45343
45354
  const program = { type: 'Program', body: result.js };
45344
45355
  walk(program, {
45345
45356
  enter: (node, parent, key) => {
@@ -46895,7 +46906,7 @@
46895
46906
  return result.to_processed();
46896
46907
  }
46897
46908
 
46898
- const VERSION = '3.55.0';
46909
+ const VERSION = '3.55.1';
46899
46910
  // additional exports added through generate-type-definitions.js
46900
46911
 
46901
46912
  exports.VERSION = VERSION;