@vue/compiler-dom 3.4.25 → 3.5.0-alpha.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.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/compiler-dom v3.4.25
2
+ * @vue/compiler-dom v3.5.0-alpha.1
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -664,9 +664,183 @@ const ignoreSideEffectTags = (node, context) => {
664
664
  }
665
665
  };
666
666
 
667
+ function isValidHTMLNesting(parent, child) {
668
+ if (parent in onlyValidChildren) {
669
+ return onlyValidChildren[parent].has(child);
670
+ }
671
+ if (child in onlyValidParents) {
672
+ return onlyValidParents[child].has(parent);
673
+ }
674
+ if (parent in knownInvalidChildren) {
675
+ if (knownInvalidChildren[parent].has(child))
676
+ return false;
677
+ }
678
+ if (child in knownInvalidParents) {
679
+ if (knownInvalidParents[child].has(parent))
680
+ return false;
681
+ }
682
+ return true;
683
+ }
684
+ const headings = /* @__PURE__ */ new Set(["h1", "h2", "h3", "h4", "h5", "h6"]);
685
+ const emptySet = /* @__PURE__ */ new Set([]);
686
+ const onlyValidChildren = {
687
+ head: /* @__PURE__ */ new Set([
688
+ "base",
689
+ "basefront",
690
+ "bgsound",
691
+ "link",
692
+ "meta",
693
+ "title",
694
+ "noscript",
695
+ "noframes",
696
+ "style",
697
+ "script",
698
+ "template"
699
+ ]),
700
+ optgroup: /* @__PURE__ */ new Set(["option"]),
701
+ select: /* @__PURE__ */ new Set(["optgroup", "option", "hr"]),
702
+ // table
703
+ table: /* @__PURE__ */ new Set(["caption", "colgroup", "tbody", "tfoot", "thead"]),
704
+ tr: /* @__PURE__ */ new Set(["td", "th"]),
705
+ colgroup: /* @__PURE__ */ new Set(["col"]),
706
+ tbody: /* @__PURE__ */ new Set(["tr"]),
707
+ thead: /* @__PURE__ */ new Set(["tr"]),
708
+ tfoot: /* @__PURE__ */ new Set(["tr"]),
709
+ // these elements can not have any children elements
710
+ script: emptySet,
711
+ iframe: emptySet,
712
+ option: emptySet,
713
+ textarea: emptySet,
714
+ style: emptySet,
715
+ title: emptySet
716
+ };
717
+ const onlyValidParents = {
718
+ // sections
719
+ html: emptySet,
720
+ body: /* @__PURE__ */ new Set(["html"]),
721
+ head: /* @__PURE__ */ new Set(["html"]),
722
+ // table
723
+ td: /* @__PURE__ */ new Set(["tr"]),
724
+ colgroup: /* @__PURE__ */ new Set(["table"]),
725
+ caption: /* @__PURE__ */ new Set(["table"]),
726
+ tbody: /* @__PURE__ */ new Set(["table"]),
727
+ tfoot: /* @__PURE__ */ new Set(["table"]),
728
+ col: /* @__PURE__ */ new Set(["colgroup"]),
729
+ th: /* @__PURE__ */ new Set(["tr"]),
730
+ thead: /* @__PURE__ */ new Set(["table"]),
731
+ tr: /* @__PURE__ */ new Set(["tbody", "thead", "tfoot"]),
732
+ // data list
733
+ dd: /* @__PURE__ */ new Set(["dl", "div"]),
734
+ dt: /* @__PURE__ */ new Set(["dl", "div"]),
735
+ // other
736
+ figcaption: /* @__PURE__ */ new Set(["figure"]),
737
+ // li: new Set(["ul", "ol"]),
738
+ summary: /* @__PURE__ */ new Set(["details"]),
739
+ area: /* @__PURE__ */ new Set(["map"])
740
+ };
741
+ const knownInvalidChildren = {
742
+ p: /* @__PURE__ */ new Set([
743
+ "address",
744
+ "article",
745
+ "aside",
746
+ "blockquote",
747
+ "center",
748
+ "details",
749
+ "dialog",
750
+ "dir",
751
+ "div",
752
+ "dl",
753
+ "fieldset",
754
+ "figure",
755
+ "footer",
756
+ "form",
757
+ "h1",
758
+ "h2",
759
+ "h3",
760
+ "h4",
761
+ "h5",
762
+ "h6",
763
+ "header",
764
+ "hgroup",
765
+ "hr",
766
+ "li",
767
+ "main",
768
+ "nav",
769
+ "menu",
770
+ "ol",
771
+ "p",
772
+ "pre",
773
+ "section",
774
+ "table",
775
+ "ul"
776
+ ]),
777
+ svg: /* @__PURE__ */ new Set([
778
+ "b",
779
+ "blockquote",
780
+ "br",
781
+ "code",
782
+ "dd",
783
+ "div",
784
+ "dl",
785
+ "dt",
786
+ "em",
787
+ "embed",
788
+ "h1",
789
+ "h2",
790
+ "h3",
791
+ "h4",
792
+ "h5",
793
+ "h6",
794
+ "hr",
795
+ "i",
796
+ "img",
797
+ "li",
798
+ "menu",
799
+ "meta",
800
+ "ol",
801
+ "p",
802
+ "pre",
803
+ "ruby",
804
+ "s",
805
+ "small",
806
+ "span",
807
+ "strong",
808
+ "sub",
809
+ "sup",
810
+ "table",
811
+ "u",
812
+ "ul",
813
+ "var"
814
+ ])
815
+ };
816
+ const knownInvalidParents = {
817
+ a: /* @__PURE__ */ new Set(["a"]),
818
+ button: /* @__PURE__ */ new Set(["button"]),
819
+ dd: /* @__PURE__ */ new Set(["dd", "dt"]),
820
+ dt: /* @__PURE__ */ new Set(["dd", "dt"]),
821
+ form: /* @__PURE__ */ new Set(["form"]),
822
+ li: /* @__PURE__ */ new Set(["li"]),
823
+ h1: headings,
824
+ h2: headings,
825
+ h3: headings,
826
+ h4: headings,
827
+ h5: headings,
828
+ h6: headings
829
+ };
830
+
831
+ const validateHtmlNesting = (node, context) => {
832
+ if (node.type === 1 && node.tagType === 0 && context.parent && context.parent.type === 1 && context.parent.tagType === 0 && !isValidHTMLNesting(context.parent.tag, node.tag)) {
833
+ const error = new SyntaxError(
834
+ `<${node.tag}> cannot be child of <${context.parent.tag}>, according to HTML specifications. This can cause hydration errors or potentially disrupt future functionality.`
835
+ );
836
+ error.loc = node.loc;
837
+ context.onWarn(error);
838
+ }
839
+ };
840
+
667
841
  const DOMNodeTransforms = [
668
842
  transformStyle,
669
- ...[transformTransition]
843
+ ...[transformTransition, validateHtmlNesting]
670
844
  ];
671
845
  const DOMDirectiveTransforms = {
672
846
  cloak: compilerCore.noopDirectiveTransform,
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/compiler-dom v3.4.25
2
+ * @vue/compiler-dom v3.5.0-alpha.1
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/compiler-dom v3.4.25
2
+ * @vue/compiler-dom v3.5.0-alpha.1
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -6274,9 +6274,183 @@ const ignoreSideEffectTags = (node, context) => {
6274
6274
  }
6275
6275
  };
6276
6276
 
6277
+ function isValidHTMLNesting(parent, child) {
6278
+ if (parent in onlyValidChildren) {
6279
+ return onlyValidChildren[parent].has(child);
6280
+ }
6281
+ if (child in onlyValidParents) {
6282
+ return onlyValidParents[child].has(parent);
6283
+ }
6284
+ if (parent in knownInvalidChildren) {
6285
+ if (knownInvalidChildren[parent].has(child))
6286
+ return false;
6287
+ }
6288
+ if (child in knownInvalidParents) {
6289
+ if (knownInvalidParents[child].has(parent))
6290
+ return false;
6291
+ }
6292
+ return true;
6293
+ }
6294
+ const headings = /* @__PURE__ */ new Set(["h1", "h2", "h3", "h4", "h5", "h6"]);
6295
+ const emptySet = /* @__PURE__ */ new Set([]);
6296
+ const onlyValidChildren = {
6297
+ head: /* @__PURE__ */ new Set([
6298
+ "base",
6299
+ "basefront",
6300
+ "bgsound",
6301
+ "link",
6302
+ "meta",
6303
+ "title",
6304
+ "noscript",
6305
+ "noframes",
6306
+ "style",
6307
+ "script",
6308
+ "template"
6309
+ ]),
6310
+ optgroup: /* @__PURE__ */ new Set(["option"]),
6311
+ select: /* @__PURE__ */ new Set(["optgroup", "option", "hr"]),
6312
+ // table
6313
+ table: /* @__PURE__ */ new Set(["caption", "colgroup", "tbody", "tfoot", "thead"]),
6314
+ tr: /* @__PURE__ */ new Set(["td", "th"]),
6315
+ colgroup: /* @__PURE__ */ new Set(["col"]),
6316
+ tbody: /* @__PURE__ */ new Set(["tr"]),
6317
+ thead: /* @__PURE__ */ new Set(["tr"]),
6318
+ tfoot: /* @__PURE__ */ new Set(["tr"]),
6319
+ // these elements can not have any children elements
6320
+ script: emptySet,
6321
+ iframe: emptySet,
6322
+ option: emptySet,
6323
+ textarea: emptySet,
6324
+ style: emptySet,
6325
+ title: emptySet
6326
+ };
6327
+ const onlyValidParents = {
6328
+ // sections
6329
+ html: emptySet,
6330
+ body: /* @__PURE__ */ new Set(["html"]),
6331
+ head: /* @__PURE__ */ new Set(["html"]),
6332
+ // table
6333
+ td: /* @__PURE__ */ new Set(["tr"]),
6334
+ colgroup: /* @__PURE__ */ new Set(["table"]),
6335
+ caption: /* @__PURE__ */ new Set(["table"]),
6336
+ tbody: /* @__PURE__ */ new Set(["table"]),
6337
+ tfoot: /* @__PURE__ */ new Set(["table"]),
6338
+ col: /* @__PURE__ */ new Set(["colgroup"]),
6339
+ th: /* @__PURE__ */ new Set(["tr"]),
6340
+ thead: /* @__PURE__ */ new Set(["table"]),
6341
+ tr: /* @__PURE__ */ new Set(["tbody", "thead", "tfoot"]),
6342
+ // data list
6343
+ dd: /* @__PURE__ */ new Set(["dl", "div"]),
6344
+ dt: /* @__PURE__ */ new Set(["dl", "div"]),
6345
+ // other
6346
+ figcaption: /* @__PURE__ */ new Set(["figure"]),
6347
+ // li: new Set(["ul", "ol"]),
6348
+ summary: /* @__PURE__ */ new Set(["details"]),
6349
+ area: /* @__PURE__ */ new Set(["map"])
6350
+ };
6351
+ const knownInvalidChildren = {
6352
+ p: /* @__PURE__ */ new Set([
6353
+ "address",
6354
+ "article",
6355
+ "aside",
6356
+ "blockquote",
6357
+ "center",
6358
+ "details",
6359
+ "dialog",
6360
+ "dir",
6361
+ "div",
6362
+ "dl",
6363
+ "fieldset",
6364
+ "figure",
6365
+ "footer",
6366
+ "form",
6367
+ "h1",
6368
+ "h2",
6369
+ "h3",
6370
+ "h4",
6371
+ "h5",
6372
+ "h6",
6373
+ "header",
6374
+ "hgroup",
6375
+ "hr",
6376
+ "li",
6377
+ "main",
6378
+ "nav",
6379
+ "menu",
6380
+ "ol",
6381
+ "p",
6382
+ "pre",
6383
+ "section",
6384
+ "table",
6385
+ "ul"
6386
+ ]),
6387
+ svg: /* @__PURE__ */ new Set([
6388
+ "b",
6389
+ "blockquote",
6390
+ "br",
6391
+ "code",
6392
+ "dd",
6393
+ "div",
6394
+ "dl",
6395
+ "dt",
6396
+ "em",
6397
+ "embed",
6398
+ "h1",
6399
+ "h2",
6400
+ "h3",
6401
+ "h4",
6402
+ "h5",
6403
+ "h6",
6404
+ "hr",
6405
+ "i",
6406
+ "img",
6407
+ "li",
6408
+ "menu",
6409
+ "meta",
6410
+ "ol",
6411
+ "p",
6412
+ "pre",
6413
+ "ruby",
6414
+ "s",
6415
+ "small",
6416
+ "span",
6417
+ "strong",
6418
+ "sub",
6419
+ "sup",
6420
+ "table",
6421
+ "u",
6422
+ "ul",
6423
+ "var"
6424
+ ])
6425
+ };
6426
+ const knownInvalidParents = {
6427
+ a: /* @__PURE__ */ new Set(["a"]),
6428
+ button: /* @__PURE__ */ new Set(["button"]),
6429
+ dd: /* @__PURE__ */ new Set(["dd", "dt"]),
6430
+ dt: /* @__PURE__ */ new Set(["dd", "dt"]),
6431
+ form: /* @__PURE__ */ new Set(["form"]),
6432
+ li: /* @__PURE__ */ new Set(["li"]),
6433
+ h1: headings,
6434
+ h2: headings,
6435
+ h3: headings,
6436
+ h4: headings,
6437
+ h5: headings,
6438
+ h6: headings
6439
+ };
6440
+
6441
+ const validateHtmlNesting = (node, context) => {
6442
+ if (node.type === 1 && node.tagType === 0 && context.parent && context.parent.type === 1 && context.parent.tagType === 0 && !isValidHTMLNesting(context.parent.tag, node.tag)) {
6443
+ const error = new SyntaxError(
6444
+ `<${node.tag}> cannot be child of <${context.parent.tag}>, according to HTML specifications. This can cause hydration errors or potentially disrupt future functionality.`
6445
+ );
6446
+ error.loc = node.loc;
6447
+ context.onWarn(error);
6448
+ }
6449
+ };
6450
+
6277
6451
  const DOMNodeTransforms = [
6278
6452
  transformStyle,
6279
- ...[transformTransition]
6453
+ ...[transformTransition, validateHtmlNesting]
6280
6454
  ];
6281
6455
  const DOMDirectiveTransforms = {
6282
6456
  cloak: noopDirectiveTransform,
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/compiler-dom v3.4.25
2
+ * @vue/compiler-dom v3.5.0-alpha.1
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/compiler-dom v3.4.25
2
+ * @vue/compiler-dom v3.5.0-alpha.1
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -464,9 +464,183 @@ const ignoreSideEffectTags = (node, context) => {
464
464
  }
465
465
  };
466
466
 
467
+ function isValidHTMLNesting(parent, child) {
468
+ if (parent in onlyValidChildren) {
469
+ return onlyValidChildren[parent].has(child);
470
+ }
471
+ if (child in onlyValidParents) {
472
+ return onlyValidParents[child].has(parent);
473
+ }
474
+ if (parent in knownInvalidChildren) {
475
+ if (knownInvalidChildren[parent].has(child))
476
+ return false;
477
+ }
478
+ if (child in knownInvalidParents) {
479
+ if (knownInvalidParents[child].has(parent))
480
+ return false;
481
+ }
482
+ return true;
483
+ }
484
+ const headings = /* @__PURE__ */ new Set(["h1", "h2", "h3", "h4", "h5", "h6"]);
485
+ const emptySet = /* @__PURE__ */ new Set([]);
486
+ const onlyValidChildren = {
487
+ head: /* @__PURE__ */ new Set([
488
+ "base",
489
+ "basefront",
490
+ "bgsound",
491
+ "link",
492
+ "meta",
493
+ "title",
494
+ "noscript",
495
+ "noframes",
496
+ "style",
497
+ "script",
498
+ "template"
499
+ ]),
500
+ optgroup: /* @__PURE__ */ new Set(["option"]),
501
+ select: /* @__PURE__ */ new Set(["optgroup", "option", "hr"]),
502
+ // table
503
+ table: /* @__PURE__ */ new Set(["caption", "colgroup", "tbody", "tfoot", "thead"]),
504
+ tr: /* @__PURE__ */ new Set(["td", "th"]),
505
+ colgroup: /* @__PURE__ */ new Set(["col"]),
506
+ tbody: /* @__PURE__ */ new Set(["tr"]),
507
+ thead: /* @__PURE__ */ new Set(["tr"]),
508
+ tfoot: /* @__PURE__ */ new Set(["tr"]),
509
+ // these elements can not have any children elements
510
+ script: emptySet,
511
+ iframe: emptySet,
512
+ option: emptySet,
513
+ textarea: emptySet,
514
+ style: emptySet,
515
+ title: emptySet
516
+ };
517
+ const onlyValidParents = {
518
+ // sections
519
+ html: emptySet,
520
+ body: /* @__PURE__ */ new Set(["html"]),
521
+ head: /* @__PURE__ */ new Set(["html"]),
522
+ // table
523
+ td: /* @__PURE__ */ new Set(["tr"]),
524
+ colgroup: /* @__PURE__ */ new Set(["table"]),
525
+ caption: /* @__PURE__ */ new Set(["table"]),
526
+ tbody: /* @__PURE__ */ new Set(["table"]),
527
+ tfoot: /* @__PURE__ */ new Set(["table"]),
528
+ col: /* @__PURE__ */ new Set(["colgroup"]),
529
+ th: /* @__PURE__ */ new Set(["tr"]),
530
+ thead: /* @__PURE__ */ new Set(["table"]),
531
+ tr: /* @__PURE__ */ new Set(["tbody", "thead", "tfoot"]),
532
+ // data list
533
+ dd: /* @__PURE__ */ new Set(["dl", "div"]),
534
+ dt: /* @__PURE__ */ new Set(["dl", "div"]),
535
+ // other
536
+ figcaption: /* @__PURE__ */ new Set(["figure"]),
537
+ // li: new Set(["ul", "ol"]),
538
+ summary: /* @__PURE__ */ new Set(["details"]),
539
+ area: /* @__PURE__ */ new Set(["map"])
540
+ };
541
+ const knownInvalidChildren = {
542
+ p: /* @__PURE__ */ new Set([
543
+ "address",
544
+ "article",
545
+ "aside",
546
+ "blockquote",
547
+ "center",
548
+ "details",
549
+ "dialog",
550
+ "dir",
551
+ "div",
552
+ "dl",
553
+ "fieldset",
554
+ "figure",
555
+ "footer",
556
+ "form",
557
+ "h1",
558
+ "h2",
559
+ "h3",
560
+ "h4",
561
+ "h5",
562
+ "h6",
563
+ "header",
564
+ "hgroup",
565
+ "hr",
566
+ "li",
567
+ "main",
568
+ "nav",
569
+ "menu",
570
+ "ol",
571
+ "p",
572
+ "pre",
573
+ "section",
574
+ "table",
575
+ "ul"
576
+ ]),
577
+ svg: /* @__PURE__ */ new Set([
578
+ "b",
579
+ "blockquote",
580
+ "br",
581
+ "code",
582
+ "dd",
583
+ "div",
584
+ "dl",
585
+ "dt",
586
+ "em",
587
+ "embed",
588
+ "h1",
589
+ "h2",
590
+ "h3",
591
+ "h4",
592
+ "h5",
593
+ "h6",
594
+ "hr",
595
+ "i",
596
+ "img",
597
+ "li",
598
+ "menu",
599
+ "meta",
600
+ "ol",
601
+ "p",
602
+ "pre",
603
+ "ruby",
604
+ "s",
605
+ "small",
606
+ "span",
607
+ "strong",
608
+ "sub",
609
+ "sup",
610
+ "table",
611
+ "u",
612
+ "ul",
613
+ "var"
614
+ ])
615
+ };
616
+ const knownInvalidParents = {
617
+ a: /* @__PURE__ */ new Set(["a"]),
618
+ button: /* @__PURE__ */ new Set(["button"]),
619
+ dd: /* @__PURE__ */ new Set(["dd", "dt"]),
620
+ dt: /* @__PURE__ */ new Set(["dd", "dt"]),
621
+ form: /* @__PURE__ */ new Set(["form"]),
622
+ li: /* @__PURE__ */ new Set(["li"]),
623
+ h1: headings,
624
+ h2: headings,
625
+ h3: headings,
626
+ h4: headings,
627
+ h5: headings,
628
+ h6: headings
629
+ };
630
+
631
+ const validateHtmlNesting = (node, context) => {
632
+ if (node.type === 1 && node.tagType === 0 && context.parent && context.parent.type === 1 && context.parent.tagType === 0 && !isValidHTMLNesting(context.parent.tag, node.tag)) {
633
+ const error = new SyntaxError(
634
+ `<${node.tag}> cannot be child of <${context.parent.tag}>, according to HTML specifications. This can cause hydration errors or potentially disrupt future functionality.`
635
+ );
636
+ error.loc = node.loc;
637
+ context.onWarn(error);
638
+ }
639
+ };
640
+
467
641
  const DOMNodeTransforms = [
468
642
  transformStyle,
469
- ...!!(process.env.NODE_ENV !== "production") ? [transformTransition] : []
643
+ ...!!(process.env.NODE_ENV !== "production") ? [transformTransition, validateHtmlNesting] : []
470
644
  ];
471
645
  const DOMDirectiveTransforms = {
472
646
  cloak: noopDirectiveTransform,
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/compiler-dom v3.4.25
2
+ * @vue/compiler-dom v3.5.0-alpha.1
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
@@ -6277,9 +6277,183 @@ Use a v-bind binding combined with a v-on listener that emits update:x event ins
6277
6277
  }
6278
6278
  };
6279
6279
 
6280
+ function isValidHTMLNesting(parent, child) {
6281
+ if (parent in onlyValidChildren) {
6282
+ return onlyValidChildren[parent].has(child);
6283
+ }
6284
+ if (child in onlyValidParents) {
6285
+ return onlyValidParents[child].has(parent);
6286
+ }
6287
+ if (parent in knownInvalidChildren) {
6288
+ if (knownInvalidChildren[parent].has(child))
6289
+ return false;
6290
+ }
6291
+ if (child in knownInvalidParents) {
6292
+ if (knownInvalidParents[child].has(parent))
6293
+ return false;
6294
+ }
6295
+ return true;
6296
+ }
6297
+ const headings = /* @__PURE__ */ new Set(["h1", "h2", "h3", "h4", "h5", "h6"]);
6298
+ const emptySet = /* @__PURE__ */ new Set([]);
6299
+ const onlyValidChildren = {
6300
+ head: /* @__PURE__ */ new Set([
6301
+ "base",
6302
+ "basefront",
6303
+ "bgsound",
6304
+ "link",
6305
+ "meta",
6306
+ "title",
6307
+ "noscript",
6308
+ "noframes",
6309
+ "style",
6310
+ "script",
6311
+ "template"
6312
+ ]),
6313
+ optgroup: /* @__PURE__ */ new Set(["option"]),
6314
+ select: /* @__PURE__ */ new Set(["optgroup", "option", "hr"]),
6315
+ // table
6316
+ table: /* @__PURE__ */ new Set(["caption", "colgroup", "tbody", "tfoot", "thead"]),
6317
+ tr: /* @__PURE__ */ new Set(["td", "th"]),
6318
+ colgroup: /* @__PURE__ */ new Set(["col"]),
6319
+ tbody: /* @__PURE__ */ new Set(["tr"]),
6320
+ thead: /* @__PURE__ */ new Set(["tr"]),
6321
+ tfoot: /* @__PURE__ */ new Set(["tr"]),
6322
+ // these elements can not have any children elements
6323
+ script: emptySet,
6324
+ iframe: emptySet,
6325
+ option: emptySet,
6326
+ textarea: emptySet,
6327
+ style: emptySet,
6328
+ title: emptySet
6329
+ };
6330
+ const onlyValidParents = {
6331
+ // sections
6332
+ html: emptySet,
6333
+ body: /* @__PURE__ */ new Set(["html"]),
6334
+ head: /* @__PURE__ */ new Set(["html"]),
6335
+ // table
6336
+ td: /* @__PURE__ */ new Set(["tr"]),
6337
+ colgroup: /* @__PURE__ */ new Set(["table"]),
6338
+ caption: /* @__PURE__ */ new Set(["table"]),
6339
+ tbody: /* @__PURE__ */ new Set(["table"]),
6340
+ tfoot: /* @__PURE__ */ new Set(["table"]),
6341
+ col: /* @__PURE__ */ new Set(["colgroup"]),
6342
+ th: /* @__PURE__ */ new Set(["tr"]),
6343
+ thead: /* @__PURE__ */ new Set(["table"]),
6344
+ tr: /* @__PURE__ */ new Set(["tbody", "thead", "tfoot"]),
6345
+ // data list
6346
+ dd: /* @__PURE__ */ new Set(["dl", "div"]),
6347
+ dt: /* @__PURE__ */ new Set(["dl", "div"]),
6348
+ // other
6349
+ figcaption: /* @__PURE__ */ new Set(["figure"]),
6350
+ // li: new Set(["ul", "ol"]),
6351
+ summary: /* @__PURE__ */ new Set(["details"]),
6352
+ area: /* @__PURE__ */ new Set(["map"])
6353
+ };
6354
+ const knownInvalidChildren = {
6355
+ p: /* @__PURE__ */ new Set([
6356
+ "address",
6357
+ "article",
6358
+ "aside",
6359
+ "blockquote",
6360
+ "center",
6361
+ "details",
6362
+ "dialog",
6363
+ "dir",
6364
+ "div",
6365
+ "dl",
6366
+ "fieldset",
6367
+ "figure",
6368
+ "footer",
6369
+ "form",
6370
+ "h1",
6371
+ "h2",
6372
+ "h3",
6373
+ "h4",
6374
+ "h5",
6375
+ "h6",
6376
+ "header",
6377
+ "hgroup",
6378
+ "hr",
6379
+ "li",
6380
+ "main",
6381
+ "nav",
6382
+ "menu",
6383
+ "ol",
6384
+ "p",
6385
+ "pre",
6386
+ "section",
6387
+ "table",
6388
+ "ul"
6389
+ ]),
6390
+ svg: /* @__PURE__ */ new Set([
6391
+ "b",
6392
+ "blockquote",
6393
+ "br",
6394
+ "code",
6395
+ "dd",
6396
+ "div",
6397
+ "dl",
6398
+ "dt",
6399
+ "em",
6400
+ "embed",
6401
+ "h1",
6402
+ "h2",
6403
+ "h3",
6404
+ "h4",
6405
+ "h5",
6406
+ "h6",
6407
+ "hr",
6408
+ "i",
6409
+ "img",
6410
+ "li",
6411
+ "menu",
6412
+ "meta",
6413
+ "ol",
6414
+ "p",
6415
+ "pre",
6416
+ "ruby",
6417
+ "s",
6418
+ "small",
6419
+ "span",
6420
+ "strong",
6421
+ "sub",
6422
+ "sup",
6423
+ "table",
6424
+ "u",
6425
+ "ul",
6426
+ "var"
6427
+ ])
6428
+ };
6429
+ const knownInvalidParents = {
6430
+ a: /* @__PURE__ */ new Set(["a"]),
6431
+ button: /* @__PURE__ */ new Set(["button"]),
6432
+ dd: /* @__PURE__ */ new Set(["dd", "dt"]),
6433
+ dt: /* @__PURE__ */ new Set(["dd", "dt"]),
6434
+ form: /* @__PURE__ */ new Set(["form"]),
6435
+ li: /* @__PURE__ */ new Set(["li"]),
6436
+ h1: headings,
6437
+ h2: headings,
6438
+ h3: headings,
6439
+ h4: headings,
6440
+ h5: headings,
6441
+ h6: headings
6442
+ };
6443
+
6444
+ const validateHtmlNesting = (node, context) => {
6445
+ if (node.type === 1 && node.tagType === 0 && context.parent && context.parent.type === 1 && context.parent.tagType === 0 && !isValidHTMLNesting(context.parent.tag, node.tag)) {
6446
+ const error = new SyntaxError(
6447
+ `<${node.tag}> cannot be child of <${context.parent.tag}>, according to HTML specifications. This can cause hydration errors or potentially disrupt future functionality.`
6448
+ );
6449
+ error.loc = node.loc;
6450
+ context.onWarn(error);
6451
+ }
6452
+ };
6453
+
6280
6454
  const DOMNodeTransforms = [
6281
6455
  transformStyle,
6282
- ...[transformTransition]
6456
+ ...[transformTransition, validateHtmlNesting]
6283
6457
  ];
6284
6458
  const DOMDirectiveTransforms = {
6285
6459
  cloak: noopDirectiveTransform,
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @vue/compiler-dom v3.4.25
2
+ * @vue/compiler-dom v3.5.0-alpha.1
3
3
  * (c) 2018-present Yuxi (Evan) You and Vue contributors
4
4
  * @license MIT
5
5
  **/
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vue/compiler-dom",
3
- "version": "3.4.25",
3
+ "version": "3.5.0-alpha.1",
4
4
  "description": "@vue/compiler-dom",
5
5
  "main": "index.js",
6
6
  "module": "dist/compiler-dom.esm-bundler.js",
@@ -51,7 +51,7 @@
51
51
  },
52
52
  "homepage": "https://github.com/vuejs/core/tree/main/packages/compiler-dom#readme",
53
53
  "dependencies": {
54
- "@vue/shared": "3.4.25",
55
- "@vue/compiler-core": "3.4.25"
54
+ "@vue/shared": "3.5.0-alpha.1",
55
+ "@vue/compiler-core": "3.5.0-alpha.1"
56
56
  }
57
57
  }