Core Web Vitals (CLS and LCP) errors for a client-rendered Single Page Application (built with React + Firebase)

I have a SPA (single page website) build with React + Firebase and I’ve been getting these Core Web Vitals errors (see images below).

My website is loading normally both on Desktop and Mobile. And I think it’s rendering in a very reasonable time. At least I think it’s way faster than most websites I visit, even though it’s client side rendered.

I’m guessing these errors on Core Web Vitals are being triggered because there’s a Spinner that runs while the app is loading its data.

For example: that report is probably measuring the Spinner vs Loaded content as layout shift. Because I can guarantee that my app has ZERO layout shift. Once the Spinner is gone and you see content on your screen, the app is 100% ready for you to browse and interact with.

Maybe to get rid of those errors I would have to do SSR + hydration, which I really don’t want to, because it’s a dynamic website and I would have to either remove caching completely, or to risk a content (state vs fresh) flickering on the screen once it’s fully hydrated.

Should I care about these results? Is anybody that also manages a SPA also getting these kind of errors? Is there a way to fix this?

Found some related articles:

  • https://www.moovweb.com/post/google-penalizes-pwas-spas
  • https://www.enterspeed.com/core-web-vitals-can-affect-how-google-ranks-your-spa-website/

enter image description here

enter image description here

How to display all posts in a category at the end of a single post?

The "work" page for my portfolio is simply all the posts in the "work" category. They are displayed as a thumbnail grid. Here.

<?php get_header(); ?>  <div class="grid work thumb-wrap clearfix"> <?php if ( have_posts() ) : while ( have_posts() ) : the_post();?>                               <a class="thumb" href="<?php the_permalink(); ?>">             <img src="http://www.nathanspence.com/wp-content/uploads/<?php echo get_post_meta($  post->ID, 'thumb', true); ?>"/>             <div class="post-excerpt">                 <h2><?php echo get_the_title($  ID); ?></h2>                 <div class="sub-title"><?php echo get_post_meta($  post->ID, 'project-name', true); ?></div>             </div>               </a>                               <?php endwhile; ?>         <?php endif; ?>  </div><!--end of "thumb-wrap"-->  <div class="push"></div>      </div><!--end of "page-wrap"-->   <?php get_footer(); ?> 

I want to duplicate this at the end of each single post. Here.

<?php get_header(); ?>  <div class="page-content">  <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>   <article class="work post-content ready-to-column clearfix">                      <header class="post-header column-left">         <h1><?php echo get_the_title($  ID); ?></h1>         <h2><?php echo get_post_meta($  post->ID, 'project-name', true); ?></h2>         <div class="project-info"><?php echo get_post_meta($  post->ID, 'project-info', true); ?></div>                        </header>          <div class="column-right">     <?php the_content(); ?>                                   </div><!---end of "right-column flex-column"--->               </article>      <?php endwhile; else: ?>     <p>Sorry, this post does not exist</p> <?php endif; ?>          <div class="grid work thumb-wrap clearfix"> <?php if ( have_posts() ) : while ( have_posts() ) : the_post();?>                               <a class="thumb" href="<?php the_permalink(); ?>">             <img src="http://www.nathanspence.com/wp-content/uploads/<?php echo get_post_meta($  post->ID, 'thumb', true); ?>"/>             <div class="post-excerpt">                 <h2><?php echo get_the_title($  ID); ?></h2>                 <div class="sub-title"><?php echo get_post_meta($  post->ID, 'project-name', true); ?></div>             </div>               </a>                               <?php endwhile; ?>         <?php endif; ?>  </div><!--end of "thumb-wrap"-->  <div class="push"></div>      </div><!--end of "page-wrap"-->   <?php get_footer(); ?>  

As you can see, simply pasting it in just shows the current posts thumbnail. Any idea how I can do this?

Why does the triangle rendered by OpenGL ES 2.0 , with SDL 2.0 context, vanishes after a single render, if events are not polled?

I was experimenting with OpenGL ES 2.0 and being new to OpenGL, I was trying to render a simple triangle. But I was shocked to see that, if I do not call SDL_PollEvent(...) after glDrawArrays(...) in the game loop, I see the triangle render on the screen for a split second and then it vanishes altogether ! But, if I call SDL_PollEvent then everything is fine ! Can anyone explain to me the reason for this abnormal behavior???

However, this is the interesting part of my code:

This code works perfectly, if I uncomment the commented block of code:

uint32_t vbo;  glGenBuffers(1, &vbo); glBindBuffer(GL_ARRAY_BUFFER, vbo); glBufferData(GL_ARRAY_BUFFER, sizeof(vertices), vertices, GL_STATIC_DRAW);  glEnableVertexAttribArray(pos); glVertexAttribPointer(pos, 3, GL_FLOAT, GL_FALSE, 3*sizeof(float), (void*)0);  bool run = true; SDL_Event e; while (run) {     glDrawArrays(GL_TRIANGLES, 0, 3);   SDL_GL_SwapWindow(window);   /*while(SDL_PollEvent(&e)) {       switch(e.type)       {            case SDL_QUIT:                 run = false;                 break;        } } */ 

}

Vertex Shader:

precision mediump float;  attribute vec3 pos; void main() {     gl_Position = vec4(pos.xyz, 1.0);  } 

Fragment Shader:

precision mediump float;  void main() {       gl_FragColor = vec4(0.0, 0.0, 1.0, 1.0);  } 

Every help will be greatly appreciated, Thankyou everyone in advance !

For a single party, how can I make Dead in Thay a “fast-paced assault” and not a drawn-out series of skirmishes?

I having been running adventure modules from Tales from the Yawning Portal for a single group of 3-6 players (i.e. I have 6 players, but sometimes as few as 3 can attend a session). Part of the reason for me running modules is to minimise necessary preparation time.

We recently finished playing the first adventure, Sunless Citadel, when I asked the players which adventure in the book they would like to do next. Upon seeing the massive awesome-looking map for the Doomvault in Dead in Thay (with 107 rooms, all containing encounters, divided into 9 mini-dungeons), they unanimously voted for that one. I warned them that it would take many sessions to complete, and they were fine with that. So I got all the characters to advance to Level 9, threw them some bonus loot, and dropped them into the Doomvault.

We are now three sessions in, and I have identified a few potential issues.

The lengthy preamble to the adventure says:

The incursion into the Doomvault is intended to be a fast-paced assault in which the characters have little time for typical rests. A few areas of the dungeon offer access to special magic that allows characters to gain the benefit of a rest.

However, our experience so far has been contrary to this. I provide a transcript of the game so far below:

  • In the first session, with 5 players, they fought through 3 rooms occupied by ordinary enemies, then one room occupied by a big (CR 10) boss monster. This took 40 minutes of in-game time.

  • In the second session, with 3 players (all casters), they took a long rest, had one encounter with two-and-a-half rooms’ worth of enemies (although a well-placed conjure woodland beings tipped the balance in their favour), then killed another big (CR 10) boss monster. After the rest, this took 1 hour of in-game time.

  • In the third session, with 3 players (2 casters), they took a short rest, killed a relatively strong monster, found a source of healing, fought two gorgons, returned to the gatehouse, twiddled their thumbs and restocked for what I declared to be 9 hours, took a long rest, returned to the dungeon, and fought a small room’s worth of enemies.

  • In the fourth session, with 4 players (2.5 casters), they had 3 combat encounters.

  • In the fifth session, with 3 players (2.5 casters), they dealt with a minor trap, had one combat encounter, took a long rest, had one large combat encounter, then took a short rest.

(For those unfamiliar with Dead in Thay, the gatehouse is an unmapped area through which the players entered the Doomvault and is under control of allies to the party. The module assumes that no encounters will happen in the gatehouse. I have thus assumed that it can function as a safe-room.)

So far, we have had 14 encounters, 3 long rests and 2 short rests. Over an in-game time of 49:20, the party has only spent 3:55 inside the dungeon, with the rest of the time sheltering in the gatehouse – far from a fast-paced assault! Typically, the call to take a long rest was done because the casters were out of spell slots, and with small party sizes the casters needed their spell slots for the party to deal enough damage to push through the encounters. While the players have found ways to recover hit-points within the Doomvault, nothing they have lets them recover spell slots besides a long rest.

I do not believe this to be a fault in the party (besides being too small half the time), but rather a characteristic of Dead in Thay. Page 84 of the DMG talks of the Adventuring Day, which is how many encounters a party can have between two long rests. For three level 9 PCs, an adventuring day contains 22,500 XP worth of encounters. Between the first two long rests, my three level 9 PCs had 31,900 XP worth of encounters, so it is hardly surprising that the party’s resources are so taxed. Between the second two long rests, we had 29,050 XP of encounters, mostly for 4 PCs, 2 lvl 9 and 2 lvl 10, which is around the right amount for an adventuring day.

If I had all 6 of my players, they could probably get further, but their adventuring day would still be much, much shorter than a full day. And because of this, and how a character can only benefit from a long rest once every 24 hours (PHB 186) (a rule I have already stretched a little), I anticipate that this will result in many more periods of inactivity in the gatehouse.

I am aware that the Thayans of the Doomvault can and will run some degree of preparations and repairs while the party is resting. However, the highly segregated nature of the Doomvault leads me to think that damage dealt to one section won’t draw that much attention from another section unless it is utterly catastrophic. And since access into and out of the Doomvault is being tightly controlled against the Thayans, their ability to replenish lost monsters is limited. The modifications the Thayans could make to the Doomvault during rests would be highly situational and rather limited, as far as I can tell, although maybe I’m just unimaginative.

Further reading about Dead in Thay online indicates that the adventure was originally designed for many groups of players to tackle simultaneously. This makes me fear that the Doomvault will become a long grind rather than a fast-paced assault for a single party.

On a related point, Dead in Thay includes a feature called ‘Alert Level’ which increases the difficulty of random encounters the longer players spend in the Doomvault; a feature intended to add to the feeling of a ‘fast-paced assault’. However, if the players only spend 2 hours a day inside the Doomvault, then the Alert Level never goes up by the rules as written, which is boring. I am considering having time spent in the gatehouse not decrease the Alert Level (but not increase it either), or possibly make Alert Level increase faster (1 per hour rather than 1 per 4 hours).

My question is this:
For a single party, how can I make Dead in Thay a “fast-paced assault” and not a drawn-out series of skirmishes?

Specifically, I would like to know how to

  • avoid the “15-minute working day” in a module densely packed with encounters (I am aware of several questions which handle this question generically; advice specific to Dead in Thay is thus preferable),
  • avoid burn-out in this mega-dungeon, and
  • make the Alert Level meaningful (although this is a minor point compared to the above two),

preferably without having to re-write the module.

An answer should preferably include your own experience in running Dead in Thay and how you tackled these issues (or if they are issues at all), although experience from other adventure modules of similar scale and density is acceptable.

Instead of rolling for every creature hit by a spell, can we reasonably use a single additional die for the number of hits?

I will preface this question by stating that the hypothetical situation proposed below will obviously only work as long you have a die with a number of faces equal to the number of enemies.

Scenario

Suppose we have a party of PCs and they encounter 8 identical hostile enemies. Once of the PCs is a wizard, and decides to cast Fireball in such a way that it will hit all 8 enemies at once. Since we don’t roll to-hit with Fireball, all the enemies just make a Dexterity saving throw. These rolls would normally be rolled for each discrete enemy for a total of 8 individual rolls.

Question

Would it be entirely unfair to roll a single d20 and a single d8, and if the d20 roll succeeds on the Dex save, rule that the 1d8 roll is the number of enemies take half (or full) damage, and the rest take full (or half) damage? Conversely, if the Dex save fails, all enemies take full damage.

Thoughts

I’m considering an approach to speeding up dice rolls for large packs of enemies, but I can’t really tell outright if the above scenario is unfair. My first impression is that it might skew based on saves or AC (if we’re rolling to-hit instead of for saves) and number of enemies.

For the example let us consider two sets of outcomes: one for a pack of Kobolds, and one for a group of Bandits.

I know this all essentially boils down to dice math, but I’m not the greatest at it and would appreciate the help evaluating whether this is fair, and what the reasonable thresholds are.

How to utilise multiple values from a single shortcode attribute?

i.e [test somevalues=1,2,3,4,5]

First time poster and alsoa php newb, I’m trying to add a feature to a plugin but I seem to keep triggering a debug notice from wordpress.

$  somearray = shortcode_atts([                'somevalues' => null,     ], $  atts); $  somearray['somevalues'] = array_map( 'trim', str_getcsv( $  somearray['somevalues'], ',' ) );  

The above does work, but it results in a debug Notice: wpdb::prepare was called incorrectly.

Is there a way to achieve the same without triggering the notice? It doesn’t have to be csv, I just need it to return a string of somevalues, rather than returning an int. I guess what I want it to act like is as if it was written like [test somevalues=one,two,three,four,five]

Any suggestions on how to get around this? Many thanks

In Pathfinder 2, is non-physical damage calculated separately from physical damage for a single attack?

One of the players in my game is playing a dragon instinct barbarian. The GM is calculating the elemental damage separately from the weapon damage for resistance purposes (i.e. an axe attack deals 8 slashing and 4 cold, which is broken into two different damage groups.) Is this correct, or should this be counted as a single group (12 damage)?

Draconic Rage (Instinct Ability) While raging, you can increase the additional damage from Rage from 2 to 4 and change its damage type to match that of your dragon’s breath weapon instead of the damage type for your weapon or unarmed attack. If you do this, your Rage action gains the arcane and evocation traits, as well as the trait matching the damage type.

Dragon Instinct: https://2e.aonprd.com/Instincts.aspx?ID=2