ripple 0.2.211 → 0.2.213
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 +18 -0
- package/README.md +3 -0
- package/package.json +5 -2
- package/src/compiler/phases/1-parse/index.js +50 -2
- package/src/compiler/phases/2-analyze/index.js +13 -29
- package/src/compiler/phases/3-transform/client/index.js +145 -5
- package/src/compiler/types/index.d.ts +4 -7
- package/src/compiler/types/rpc.d.ts +5 -0
- package/src/runtime/internal/client/hydration.js +4 -0
- package/src/runtime/internal/client/rpc.js +31 -3
- package/src/runtime/internal/client/template.js +4 -2
- package/tests/client/compiler/compiler.basic.test.ripple +24 -0
- package/tests/client/compiler/compiler.try-in-function.test.ripple +159 -0
- package/tests/hydration/basic.test.js +23 -0
- package/tests/hydration/build-components.js +2 -2
- package/tests/hydration/compiled/client/basic.js +67 -1
- package/tests/hydration/compiled/client/composite.js +1 -0
- package/tests/hydration/compiled/client/events.js +1 -0
- package/tests/hydration/compiled/client/for.js +1 -0
- package/tests/hydration/compiled/client/head.js +1 -0
- package/tests/hydration/compiled/client/html.js +1 -0
- package/tests/hydration/compiled/client/if-children.js +407 -0
- package/tests/hydration/compiled/client/if.js +1 -0
- package/tests/hydration/compiled/client/portal.js +4 -0
- package/tests/hydration/compiled/client/reactivity.js +1 -0
- package/tests/hydration/compiled/client/return.js +1 -0
- package/tests/hydration/compiled/client/switch.js +1 -0
- package/tests/hydration/compiled/server/basic.js +108 -1
- package/tests/hydration/compiled/server/composite.js +1 -0
- package/tests/hydration/compiled/server/events.js +1 -0
- package/tests/hydration/compiled/server/for.js +1 -0
- package/tests/hydration/compiled/server/head.js +1 -0
- package/tests/hydration/compiled/server/html.js +1 -0
- package/tests/hydration/compiled/server/if-children.js +686 -0
- package/tests/hydration/compiled/server/if.js +1 -0
- package/tests/hydration/compiled/server/portal.js +1 -0
- package/tests/hydration/compiled/server/reactivity.js +1 -0
- package/tests/hydration/compiled/server/return.js +1 -0
- package/tests/hydration/compiled/server/switch.js +1 -0
- package/tests/hydration/components/basic.ripple +32 -1
- package/tests/hydration/components/composite.ripple +3 -1
- package/tests/hydration/components/if-children.ripple +196 -0
- package/tests/hydration/if-children.test.js +272 -0
- package/tests/hydration/tsconfig.json +12 -0
- package/tests/hydration.d.ts +14 -0
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
1
2
|
import * as _$_ from 'ripple/internal/server';
|
|
2
3
|
|
|
3
4
|
export function StaticText(__output) {
|
|
@@ -345,7 +346,7 @@ function Actions(__output, { playgroundVisible = false }) {
|
|
|
345
346
|
__output.push('</a>');
|
|
346
347
|
__output.push('<!--[-->');
|
|
347
348
|
|
|
348
|
-
if (
|
|
349
|
+
if (playgroundVisible) {
|
|
349
350
|
__output.push('<a');
|
|
350
351
|
__output.push(' href="/playground"');
|
|
351
352
|
__output.push(' class="playground-link"');
|
|
@@ -469,5 +470,111 @@ export function WebsiteIndex(__output) {
|
|
|
469
470
|
comp(...args);
|
|
470
471
|
}
|
|
471
472
|
|
|
473
|
+
_$_.pop_component();
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
function LastChild(__output) {
|
|
477
|
+
_$_.push_component();
|
|
478
|
+
__output.push('<footer');
|
|
479
|
+
__output.push(' class="last-child"');
|
|
480
|
+
__output.push('>');
|
|
481
|
+
|
|
482
|
+
{
|
|
483
|
+
__output.push('I am the last child');
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
__output.push('</footer>');
|
|
487
|
+
_$_.pop_component();
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
export function ComponentAsLastSibling(__output) {
|
|
491
|
+
_$_.push_component();
|
|
492
|
+
__output.push('<div');
|
|
493
|
+
__output.push(' class="wrapper"');
|
|
494
|
+
__output.push('>');
|
|
495
|
+
|
|
496
|
+
{
|
|
497
|
+
__output.push('<h1');
|
|
498
|
+
__output.push('>');
|
|
499
|
+
|
|
500
|
+
{
|
|
501
|
+
__output.push('Header');
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
__output.push('</h1>');
|
|
505
|
+
__output.push('<p');
|
|
506
|
+
__output.push('>');
|
|
507
|
+
|
|
508
|
+
{
|
|
509
|
+
__output.push('Some content');
|
|
510
|
+
}
|
|
511
|
+
|
|
512
|
+
__output.push('</p>');
|
|
513
|
+
|
|
514
|
+
{
|
|
515
|
+
const comp = LastChild;
|
|
516
|
+
const args = [__output, {}];
|
|
517
|
+
|
|
518
|
+
comp(...args);
|
|
519
|
+
}
|
|
520
|
+
}
|
|
521
|
+
|
|
522
|
+
__output.push('</div>');
|
|
523
|
+
_$_.pop_component();
|
|
524
|
+
}
|
|
525
|
+
|
|
526
|
+
function InnerContent(__output) {
|
|
527
|
+
_$_.push_component();
|
|
528
|
+
__output.push('<div');
|
|
529
|
+
__output.push(' class="inner"');
|
|
530
|
+
__output.push('>');
|
|
531
|
+
|
|
532
|
+
{
|
|
533
|
+
__output.push('<span');
|
|
534
|
+
__output.push('>');
|
|
535
|
+
|
|
536
|
+
{
|
|
537
|
+
__output.push('Inner text');
|
|
538
|
+
}
|
|
539
|
+
|
|
540
|
+
__output.push('</span>');
|
|
541
|
+
|
|
542
|
+
{
|
|
543
|
+
const comp = LastChild;
|
|
544
|
+
const args = [__output, {}];
|
|
545
|
+
|
|
546
|
+
comp(...args);
|
|
547
|
+
}
|
|
548
|
+
}
|
|
549
|
+
|
|
550
|
+
__output.push('</div>');
|
|
551
|
+
_$_.pop_component();
|
|
552
|
+
}
|
|
553
|
+
|
|
554
|
+
export function NestedComponentAsLastSibling(__output) {
|
|
555
|
+
_$_.push_component();
|
|
556
|
+
__output.push('<section');
|
|
557
|
+
__output.push(' class="outer"');
|
|
558
|
+
__output.push('>');
|
|
559
|
+
|
|
560
|
+
{
|
|
561
|
+
__output.push('<h2');
|
|
562
|
+
__output.push('>');
|
|
563
|
+
|
|
564
|
+
{
|
|
565
|
+
__output.push('Section title');
|
|
566
|
+
}
|
|
567
|
+
|
|
568
|
+
__output.push('</h2>');
|
|
569
|
+
|
|
570
|
+
{
|
|
571
|
+
const comp = InnerContent;
|
|
572
|
+
const args = [__output, {}];
|
|
573
|
+
|
|
574
|
+
comp(...args);
|
|
575
|
+
}
|
|
576
|
+
}
|
|
577
|
+
|
|
578
|
+
__output.push('</section>');
|
|
472
579
|
_$_.pop_component();
|
|
473
580
|
}
|