How to Capture Stack Trace of Actual Update in Mongoose Plugin Instead of Plugin Call?

I’m working on a Mongoose plugin to log database updates, including the stack trace. Currently, I can only capture the stack trace of the plugin itself, but what I need is the stack trace where the actual update query is triggered in the application code, not in the plugin.

Here’s a simplified version of my Mongoose plugin:

schema.pre(['updateOne', 'findOneAndUpdate', 'updateMany'], async function (next) {
    const stackTrace = new Error().stack;  // This gives the plugin's stack trace
    // I need the stack trace where the update was called
    console.log("Stack Trace:", stackTrace);
    next();
});

I can achieve this saving stack trace in the query options and then get it from there in the plugin. Something like this:

// Application code
await dbnative.orders.updateOne({'order_id': order_id, 'status': 2}, {'pending': true}, { stack_trace: captureStackTrace() });



// Plugin code
schema.pre(['updateOne', 'findOneAndUpdate', 'updateMany'], async function (next) {
    const stackTrace = this.options && this.options.stack_trace
    console.log("Stack Trace:", stackTrace);
    next();
});

However, in this scenario I need to refactor the all update queries. Is there a better way to achieve this?

Thanks in advance!

Using twig path to build up Javascript – twig ignores raw filter

First off, I am well aware that twig is server- and JavaScript is clientside.
Still I would like to use twigs path() function to render my JavaScript code and inject the Javascript variable as a RAW-String, but it gets escaped all the time and I am curious why the raw-filter does not apply?

I do have the following Javascript within my twig file (simplified):

// file.html.twig
<script>
print '<a href="{{ path('article_edit', {id: ("' + full['id'] + '"|raw)}) }}">Linktext</a>';
</script>

As the path for article_edit is /articles/{id}/edit I expect twig to do the following two steps:

// Expected twig-render, step 1
<script>
print '<a href="/articles/{id}/edit">Linktext</a>';
</script>

Step 2: {id} then gets replaced with my given string ' + full['id'] + ', resulting in a valid Javascript:

// Expected twig-render, final step
<script>
print '<a href="/articles/' + full['id'] + '/edit">Linktext</a>';
</script>

Which would be rendered on clientside to <a href="/articles/1/edit">Linktext</a>

But still, even though I used the |raw filter, twig does escape the string. Resulting in the following output:

// Actual twig-render
<script>
print '<a href="/articles/%27%20+%20full%5B%27id%27%5D%20+%20%27/edit">Linktext</a>';
</script>

The following twig-codes do have all the very same output:

{{ path('article_edit', {id: ("' + full['id'] + '")}) }} // no filter
{{ path('article_edit', {id: ("' + full['id'] + '"|raw)}) }} // filter on the id
{{ path('article_edit', {id: ("' + full['id'] + '")})|raw }} // filter on the function
{{ path('article_edit', {id: ("' + full['id'] + '"|raw)})|raw }} // filter on both id and function

If you still think it is a problem of client- and serverside rendering, I have created a little PHP fiddle to demonstrate the problem and expected behaviour with plain php, without twig: https://ideone.com/amZ4T4

Why is twig ignoring the filter and does escape the JavaScript? Isn’t that what that filter is for, so I could built up an dynamic Javascript code within twig?

I now use the hardcoded path as a workaround, but I am curious why the filter is ignored…

Thanks for any clarification

Extending SquareSpace Masonry Image Grid Display Functionality

Unfortunately I have opted to go with SquareSpace for a site build and have been regretting it from the get-go. It appears to be lacking basic functionality like lazy loading images and control of loading the images for the Masonry grid.

Here is my question:

For this Home Page:
https://fish-mayflower-586h.squarespace.com
PW: testing78

I have injected custom code to allow for lazy loading functionality but what I can’t figure out is how I would be able to control the image display.

Basically I would like to load a set amount of images (which is what I am doing now), but I want the wrapper to only expand to where there aren’t unloaded images to prevent these gaps…

Please see reference images here:

Current display:

And this is what I would like to accomplish for all viewports:
Objective

Would be immensely grateful for advice on how to accomplish this!
Thanks!

Is there a way to add costs to a custom field during the checkout?

I’ve added some custom fields to my website that show up in the checkout.
One of those fields is a select option. (It’s about child registration for a Summer Camp)
function person_details( $checkout ) {

global $woocommerce;
$count = $woocommerce->cart->cart_contents_count;
$i = 0;

for( $k=1; $k<= $count; $k++ ) {
    $i++;
    
    print ('<h3>Gegevens van kind #'.$i.'</h3>');

woocommerce_form_field( 'cstm_care'.$i, array(
            'type'                       => 'select',
            'required'                   => true,
            'class'                      => array( 'my-field-class form-row-last' ),
            'label'                      => __( 'Voor- en na zorg' ),
            'options'                    => array(
                'Geen'                   => __( 'Geen', 'njengah' ),
                'Voorzorg'               => __( 'Pre-care (€30)', 'njengah' ),
                'Nazorg'                 => __( 'Aftercare (€30)', 'njengah' ),
                'Voor- en na zorg'       => __( 'Pre- & Aftercare (€50)', 'njengah' )
        )), $checkout->get_value( 'cstm_care'.$i ));

I want the total to change during the checkout when one of the options is chosen.

  • Pre-care (€30)
  • Aftercare (€30)
  • Pre- & Aftercare (€50)

How can i achieve this? Is it even possible?

How to style a div based on it’s returned value from database? [duplicate]

I have a table of cards with values from a database, floating on each card is a DIV that I’d like it’s background color to be red or green based on its value. This DIV has class tags2

It’s value is retrieved from column status from table actors and is VARCHAR either “Retired” “Active” or it’s cell is empty.

My code looks like this:

<tbody>

 <?php
   include_once("conn.php");
   $sql = "SELECT * FROM actors
   INNER JOIN actor_count ON actors.actor_id = actor_count.actor_id
   ORDER BY Full_Name";
   $result = mysqli_query($conn, $sql);
   while($row = $result->fetch_assoc()) {
 ?>

 <?php 
   echo '<tr>';
   echo '<td>';
 ?>

 <div class="card">

   <a href="<?php echo $row["Profile_Link"]; ?>" >
   <div class="card_image">
     <img src="/location/<?php echo $row['Image_Title']; ?>"  alt="..." class="card_image">
   </div>
   
   <div class="card_body">
     <div class="card_body_line">
        <div class="name"><?php echo $row["Full_Name"];?></div>
        <div class="flag"><src="/location/<?php echo $row["flag"];?>"></div>
     </div>

     <div class="card_body_line" style="color:#888888">
       <div class="tags"><?php echo $row["DOB_Year"];?></div>
       <div class="tags">Movies (<?php echo $row["count"];?>)</div>
       <div class="tags"><?php echo $row["favourite"];?></div>
       <div class="tags"><?php echo $row["legend"];?></div>
       <div class="tags2" id="tags2"><?php echo $row["status"];?></div>
     </div>
   </div>
  </a>

<?php       
  echo '</tr>';
  echo '</td>';
?>
      
</div>  

<?php
}
?>

</tbody>

I’ve tried a few different JavaScript examples from online and can’t seem to get it to work

I would like Red = Retired and Green = Active, if cell is empty apply no styling

Artifact when slow scroll with react-virtuoso and dynamic list

I am making a messaging system And to make the list more fluid I use react-virtuoso, This one works well the only problem I have, and which is still annoying, is that when I scroll slowly to go up the list of elements it creates visual artifacts. When I put static element heights I do not have this problem so it is when the elements appear in the DOM, and especially the images, that the problem occurs.

This is the code:

<div className="my-conversation__container">
                            <div className="my-conversation__background">
                                <div className="my-conversation__message-list__message" aria-label="Message de la conversation">
                                    <Virtuoso
                                        key={conversationIdState}
                                        style={{ height: '100%', scrollbarWidth: 'none' }}
                                        data={filteredMessages}
                                        totalCount={filteredMessages.length}
                                        overscan={100}
                                        increaseViewportBy={{ top: 500, bottom: 500 }}
                                        components={{ Footer: () => <div style={{ height: '0.5rem' }} /> }}
                                        initialTopMostItemIndex={filteredMessages.length - 1}
                                        itemContent={(index, message) => (
                                            <div
                                                className={`my-conversation__message-list__message__detail ${message.user_id === id ? 'me' : ''}`}
                                                key={index}
                                                aria-label={`Message de ${message.user_id === id ? 'vous' : 'l'autre utilisateur'}`}
                                            >
                                                <motion.div
                                                    className={`content ${message.user_id === id ? 'me' : ''}`}
                                                    initial={{ opacity: 0, scale: 0.9 }}
                                                    animate={{ opacity: 1, scale: 1 }}
                                                    exit={{ opacity: 0, scale: 0.9, transition: { duration: 0.1, type: 'tween' } }}
                                                    transition={{ duration: 0.3, type: 'tween' }}
                                                >
                                                    {message.media[0].url && (
                                                        <div className="my-conversation__message-list__message__detail__image-container">
                                                            <div className={`map ${message.content ? 'message' : ''}`}>
                                                                {message.media?.map((media, index) => (
                                                                    media ? (
                                                                        media.name.endsWith('.pdf') ? (
                                                                            <a
                                                                                className="a-pdf"
                                                                                href={media.url}
                                                                                key={media.id}
                                                                                download={media.name}
                                                                                target="_blank"
                                                                                rel="noopener noreferrer"
                                                                                onClick={(event) => { event.stopPropagation(); }}
                                                                                aria-label={`Télécharger le fichier PDF ${media.name}`}
                                                                            >
                                                                                <img
                                                                                    className={`my-conversation__message-list__message__detail__image-pdf ${message.media.length === 1 ? 'single' : 'multiple'}`}
                                                                                    src={pdfLogo}
                                                                                    alt={media.name}
                                                                                />
                                                                            </a>
                                                                        ) : (
                                                                            <img
                                                                                className={`my-conversation__message-list__message__detail__image ${message.media.length === 1 ? 'single' : 'multiple'}`}
                                                                                key={media.id}
                                                                                src={media.thumbnail} // Display thumbnail initially
                                                                                data-src={media.url}
                                                                                loading="lazy"
                                                                                onLoad={(event) => {
                                                                                    // Swap thumbnail with actual image when loaded
                                                                                    if (event.currentTarget.dataset.src) {
                                                                                        event.currentTarget.src = event.currentTarget.dataset.src;
                                                                                    }
                                                                                }}
                                                                                onClick={(event) => {
                                                                                    const imageUrls = message.media?.map((m) => m.url) || [];
                                                                                    setHasManyImages(false),
                                                                                        openModal(imageUrls, index),
                                                                                        imageUrls.length > 1 && setHasManyImages(true);
                                                                                    event.stopPropagation();
                                                                                }}
                                                                    
                                                                                alt={media.name}
                                                                                onError={(event) => {
                                                                                    event.currentTarget.src = noPicture;
                                                                                }}
                                                                            />
                                                                        )

                                                                    ) : null
                                                                ))
                                                                }
                                                            </div>
                                                        </div>
                                                    )}
                                                    {index}
                                                    {message.content && (
                                                        <div className="my-conversation__message-list__message__detail__texte">{message.content}</div>
                                                    )}
                                                </motion.div>
                                                <motion.time
                                                    className="my-conversation__message-list__message__detail__date"
                                                    style={{ overflow: 'scroll' }}
                                                    initial={{ opacity: 0, scale: 0.9 }}
                                                    animate={{ opacity: 1, scale: 1 }}
                                                    exit={{ opacity: 0, scale: 0.9, transition: { duration: 0.1, type: 'tween' } }}
                                                    transition={{ duration: 0.3, type: 'tween' }}
                                                    dateTime={new Date(Number(message.created_at)).toISOString()}
                                                >
                                                    {formatMessageDate(message.created_at)}
                                                </motion.time>
                                            </div>
                                        )
                                        }

                                        followOutput={(isAtBottom) => isAtBottom}
                                    />
                                </div>
                            </div>
                        </div>

I tried to put the thumbnails in order to be able to display the image formats more quickly, But it still does not work, I cannot use a placeholder for the scroll because it is not during a fast scroll but during a slow scroll that this happens.

Change email to an user in firebase

Im using firebase for my react native app. I want to add a feature so users can change their email, My code is something like:

// Function to update user's email
  updateEmail(user, newEmail)
    .then(() => {
      console.log("Email updated successfully");
    })
    .catch((error) => {
      console.error("Error updating email:", error);
    });
  }
};

But I get the error:

ERROR Error updating email: [FirebaseError: Firebase: Please verify the new email before changing email. (auth/operation-not-allowed).]

But I’m not able to send an email verification to an email different of that of the user.

I have tried to send the verification email, but it doesn’t arrive. I read in a medium blog that the verification email is supposed to get sent automatically, but when I try that code, I get the same error.

Edit: I’m reauthenticating the user before tryng to change the email:

const reauthenticate = (password) => {
  const user = authentication.currentUser;
  const credential = EmailAuthProvider.credential(user.email, password);

  return reauthenticateWithCredential(user, credential)
    .then(() => {
      console.log("Usuario reautenticado.");
      return true;
    })
    .catch((error) => {
      console.error("Error reautenticando al usuario:", error);
      alert("Error: La contraseña es incorrecta.");
      return false;
    });
};

Select dropdown on product page with custom percentage and label shown everywhere

I’m trying to add a dropdown select field to WooCommerce product pages.

With % based fee or surcharge on the product price weather that’s inc or exc tax, ie both may be possible as it depends on customer location, and the colour label must also be retained as part of the value for later use, customer and admin must know the amount paid and the colour, at checkout and in order needs/emails etc, and it needs to inc tax if the product is taxable, there can be duplicates of each %, so we need to project the label as well.

I have tried to adapt How can I get the select field option value from select dropdown as well as custom fee percentage of cart item

using How to add a radio button with price on product page? WordPress woocommerce as a guide and for inspiration.

But the value is not being added to the cart.

Here is my code.

Thanks in advance if anyone can help.

add_action('woocommerce_before_add_to_cart_button', 'product_option_custom_field', 30 );
function product_option_custom_field(){
    global $product;
    
    //$custom_subtotal = get_related_items_subtotal( WC()->cart );

    
    $active_price = (float) $product->get_price();
    
    // surcharge is % of item value, exc tax or inc tax
        $colour_surcharge    = strip_tags( wc_price( wc_get_price_to_display( $product, array('price' => $custom_subtotal ) ) ) ); 
   // $colour_price_html   = strip_tags( wc_price( wc_get_price_to_display( $product, array('price' => $custom_subtotal ) ) ) );
    $active_price_html   = wc_price( wc_get_price_to_display( $product ) );
    $disp_price_sum_html = wc_price( wc_get_price_to_display( $product, array('price' => $active_price + $custom_subtotal ) ) );
    
    
    $custom_subtotal = (float) $product->get_price();
    
     if ( $custom_subtotal > 0 ) {
        //  $value = WC()->session->get( 'colour_surcharge' );
       //  $value = empty( $value ) ? WC()->checkout->get_value( 'colour_surcharge' ) : $value;
         $value = empty( $value ) ? '0' : $value;
        $domain = 'woocommerce';
       // echo '<div id="checkout-select">
          //  <h4>' . __("Select Colour option") .'</h4>';
            

          woocommerce_form_field( 'colour_surcharge', array(
            'type' => 'select',
            'class' => array( 'form-row-wide', 'update_totals_on_change' ),
            'label'   => __( 'Colour options, standard or premium', 'woocommerce' ),
            'desc_tip'    => 'true',
            'description' => __( 'Select your chosen colour', 'woocommerce' ),
            'options' => array(
                 // 0 would be hidden, using 0.001 works to retain the values
                '0.001 black'  => __( 'Black - no fee', 'woocommerce' ) . ' (' . strip_tags( wc_price( 0.001 * $custom_subtotal / 100 ) ) . ')',
                '15 white' => __( 'White 15% surcharge', 'woocommerce' ) . ' (' . strip_tags( wc_price( 15 * $custom_subtotal / 100 ) ) . ')',
                '25 red' => __( 'Red 25% surcharge', 'woocommerce' ) . ' (' . strip_tags( wc_price( 25 * $custom_subtotal / 100 ) ) . ')',  
            ),
        ), $value );
        
             // Jquery: Update displayed price
    ?>
    <script type="text/javascript">
    jQuery(function($) {
        var cb = 'input[name="colour_surcharge"]'
            pp = 'p.price';

        // On change / select a variation
        $('form.cart').on( 'change', cb, function(){
            needs to be selected 
                 if( $(cb).prop('selected') === true )
           // if( $(cb).prop('checked') === true )
                $(pp).html('<?php echo $disp_price_sum_html; ?>');
            else
                $(pp).html('<?php echo $active_price_html; ?>');
        })

    });
    </script>
    <?php
}
}


function save_value_add_cart_item_data( $cart_item_data, $product_id, $variation_id ) {
    $custom_fees = filter_input( INPUT_POST, 'custom_fees' );
    if ( empty( $custom_fees ) ) {
        return $cart_item_data;
    }
    $cart_item_data['colour_surcharge'] = $custom_fees;

    return $cart_item_data;
}

add_filter( 'woocommerce_add_cart_item_data', 'save_value_add_cart_item_data', 99, 3 );

function calculate_add_cart_fee() {
    global $woocommerce;
    $percentage = (float) WC()->session->get( 'colour_surcharge' );
    
    $cart_items = $woocommerce->cart->get_cart();
    foreach( $cart_items as $key => $item ) { 
             
        if ( $surcharge_fee === '0.001 black' ) {
            $label = sprintf( __('Black no fee %d&#37;', 'woocommerce'), $percentage == 0.001 ? 0.001 : 15); 
            $cart->add_fee( $label, $custom_subtotal * $percentage / 100 );
    }
            elseif ( $surcharge_fee === '15 white' ) {
          $label = sprintf( __('Blue standard %d&#37; fee', $domain), $percentage == 15 ? 15 : 35);
          $cart->add_fee( $label, $custom_subtotal * $percentage / 100 );
    }
            elseif ( $surcharge_fee === '35 red' ) {
          $label = sprintf( __('Red %d&#37; fee', $domain), $percentage == 35 ? 15 : 35);
          $cart->add_fee( $label, $custom_subtotal * $percentage / 100 );
    }
        if( !isset( $item['colour_surcharge'] ) && empty( $item['colour_surcharge'] ) ) continue;
        $woocommerce->cart->add_fee( __('Colour Surcharge', 'woocommerce'), $item['colour_surcharge'] );
    }
}
add_action( 'woocommerce_cart_calculate_fees', 'calculate_add_cart_fee', 99 );

// Display custom data in  checkout page
add_filter( 'woocommerce_get_item_data', 'display_custom_cart_item_data', 10, 2 );
function display_custom_cart_item_data( $cart_data, $cart_item ) {
    $domain        = 'woocommerce';

    if ( isset( $cart_item['colour_surcharge'] ) ){
        $cart_data[] = array('name' => __( 'Colour Surcharge', $domain ),
            'value' => $cart_item['colour_surcharge'] );
    }
    return $cart_data;
}

add_action( 'woocommerce_admin_order_data_after_order_details', 'display_order_custom_meta_data_in_admin' );
function display_order_custom_meta_data_in_admin( $order ){
    $colour_surcharge = colour_surcharge_array();
    $key = get_post_meta( $order->get_id(), 'colour_surcharge', true );
    ?>
    <div class="order_data_column">
        <h4><?php _e( 'Colour Surcharge' ); ?></h4>
        <p><strong><?php _e( 'Colour Surcharge: ' ); ?></strong><?php echo $colour_surcharge[$key]; ?></p>
    </div>
    <?php
}

The ‘Access-Control-Allow-Origin’ header has a value that is not equal to the supplied origin issue

I’m trying to download an archive from S3. I create a temporary link on click and try to access the storage. But i receive an error. I don’t really understand the problem because the origin and header value are the same localhost.

the problem with cors

The code im using to download an archive

export const downloadArchive = async (archive: IArchive): Promise<void> => {
    try {
        const response = await archiveApi.downloadArchive({ id: archive.id });

        const blob = new Blob([response], { type: 'application/octet-stream' });

        const link = document.createElement('a');
        const url = URL.createObjectURL(blob);
        link.href = url;
        link.setAttribute('download', `archive-${archive.id}.7z`);
        document.body.appendChild(link);
        link.click();

        URL.revokeObjectURL(url);
        link.remove();
    } catch (error) {
        console.error('Error downloading the file:', error);
    }
}

any help would be appreciated thanks

Type ‘Promise<AxiosResponse>’ is not assignable to type ‘Promise’

i have this in the type.d.ts file in next/js

type Users = {
  id: number;
  name: string;
  username: string;
  email: string;
  address: {
    street: string;
    suite: string;
    city: string;
    zipcode: string;
    geo: {
      lat: string;
      lng: string;
    };
  };
  phone: string;
  website: string;
  company: {
    name: string;
    catchPhrase: string;
    bs:string;
  };
};

Then

const getUsers:Promise<Users[]> = getAllUsers();

in the getUsers page

……………………………….

Creating an SPA – use AJAX or django urls? [closed]

I am building a website as a school project, which should use django for the backend and vanilla js for the frontend.
My question is, for loading different html files, is it better to use AJAX or django urls? I am not sure if using different django urls would make the content load dynamically, as it is required by a SPA. If there is a better way to load my content, please let know.
I will really appreciate any help with this.

Is it possible to get client’s country using JS without an external API?

I would like to know the country of my users, but not the location because getting the location from the IP without their consent would be too intrusive. I don’t want their location, so I don’t want to ask them for the geolocation. I just want to know what country they are in.
I don’t want to use an external API for it.
Can I do this with client JS? Or maybe using some Node.js as my app server-side renders (SSR)? Is that possible?

Creating an SPA – use AJAX or django urls?

I am building a website as a school project, which should use django for the backend and vanilla js for the frontend.
My question is, for loading different html files, is it better to use AJAX or django urls? I am not sure if using different django urls would make the content load dynamically, as it is required by a SPA. If there is a better way to load my content, please let know.
I will really appreciate any help with this.

Drop down lists and .change() event delaying so much while selecting the values

I’m doing some modifications in a Asp.Net MVC 4.5 aplication and some improvements are generating unexpected problems. Instead using input fields, i have chosen
the drop down lists. I use a Javascript file to get the values selected in the drop downs and they are used as params for my controller method. The
searching in the database is perfect and fast, but when i try to change the drop down values so fast or even when i wait for so long, the DDL are lagging/delaying for more
than 10 seconds. My javascript uses .change() to listen and “catch” the values. I think that probably it is the .change() which is causing this delay. See the use of .change below:

$(document).ready(function () {
    var debounceTimeout = null;

    $("#name, #age").change(function () {
            if (debounceTimeout) {
                clearTimeout(debounceTimeout);
            }

            debounceTimeout = setTimeout(refreshGrid, 500);
        });
});




function refreshGrid() {

    var name = $('#name').val() == "" ? undefined : $("#name").val();
    var age = $("#age").val() == "" ? undefined : $("#age").val();


    $.ajax({
        url: "Search/recarregarGrid",
        data:
        {
            name: name, age: age
        },
        type: "GET",
        dataType: "html",
        success: function (data) {
            $("#GridResultFetchs").html(data);
        }

    });
}

And here is my Index.cshtml:

@{
    ViewBag.Title = "Search";
}
<section class="search_title">
    <h1>Fetch Session</h1>
</section>
<div class="search">
    <div class="search-container">
        <section>
            <section class="input_filters">
                <div>
                    <label for="nome">Name</label>
                    @Html.DropDownList("DdlNames", (IEnumerable<SelectListItem>)ViewBag.DdlNames, new { id = "name", style = "height: 25px; font-size: 12px; width: 100%;" })
                </div>
               <div>
                    <label for="age">Age</label>
                     @Html.DropDownList("DdlAges", (IEnumerable<SelectListItem>)ViewBag.DdlAges, new { id = "age", style = "height: 25px; font-size: 12px; width: 100%;" })
           </div>

     
            </section>
            <section class="filtros">
                <h3><i class="fa fa-filter">Searching criteria</i><i class="fa fa-undo" id="undo_filtering"></i></h3>
                <ul class="name hide"></ul>
            </section>
        </section>

    </div>
    <div class="searchingResults">
    <div id="GridResultFetchs">
        @RenderPage("~/Views/Fetchings/GridViews/_GridView.cshtml")
    </div>
</div>

</div>

<script src="~/Scripts/Util.js"></script>
<script src="~/Scripts/Fetch/AdvancedFetching.js"></script>
@Scripts.Render("~/bundles/scripts")

I will provide more information. But i really wanna find out a way to decrease those delays and fulfill my needs.

Next.js | What type of response is this? (text/x-component)

I’m a backend (.NET) guy, trying to do some sneaky web-scrapping from a site based on either nextjs, or react, or both of them together..? (I really don’t understand much about all this js-zoo diversity, and my head begins to hurt when I’m trying to) *cough* — and I happened to encounter an endpoint that returns data in format like this:

2:I[50124,["9218","static/chunks/2d45e2a3-5c057d8e0f33767e.js","8969","static/chunks/8969-680493329abfb0c4.js","202","static/chunks/202-de118e3812c53ed3.js"],"Page"]
0:["F8KN2c1tQ8aMh140dU9Q6",[["children",["lang","en","d"],"children","__PAGE__?{"some_json":"here"}",["__PAGE__",{},[["$L1",["$","$L2",null]],null],null],[null,"$L6"]]]]
1:null
5:{"AND HERE'S THE MAIN JSON OBJECT": "THAT EXPECTED TO BE RETURNED"}

Some nodes in “main json object” have structure like { "name": "$42" }, and if there’s a line above with a key like 42:I ..etc, browser will understand it and put together, but my scrapper will not.
Response header reports Content-Type with text/x-component value. Also, request headers require some “RSC” header to bet set with “1”, otherwise response will contain the whole html page instead of what’s above.

Where can I read something about it? How do you even call it? Is there any way to handle it or force API to return regular json? I don’t like the idea that I’ll have to put these strings into a normal json object manually…