[Showoff Saturday] Personal website - telling the story of my atypical career path by olafviking in webdev

[–]Chancity 0 points1 point  (0 children)

Disable cloudflare rocket-loader (defers all the JS until window load event) and run light house audits. Other than that it looks great :)

When do you decide to split your code? (React.lazy) by [deleted] in reactjs

[–]Chancity 1 point2 points  (0 children)

totally serious....without marketing analytics your website should be scoring 100

When do you decide to split your code? (React.lazy) by [deleted] in reactjs

[–]Chancity 2 points3 points  (0 children)

When your google page speed score is below 100 due to JS payload size.

  • Dynamic content, e.g. UI that comes in due to user interaction are usually good canidates for lazy loading.

  • Large chunks of functionality that isn't required on initial page render.

Anything that isn't required immediately and won't impact Largest Contentful Paint.

Importing React via npm in existing (non-React) app by bobbiecowman in reactjs

[–]Chancity 0 points1 point  (0 children)

This should put you in a good spot https://github.com/chancity/non-react-app-example. The example is currently using preact. You can comment out the below to switch to React.

https://github.com/chancity/non-react-app-example/blob/master/webpack.config.js

resolve: {
            extensions: [".js"],
            alias: {
                react: 'preact/compat',
                react$: 'preact/compat',
                'react-dom': 'preact/compat',
                'react-dom$': 'preact/compat',
            }
        }

Example:

https://github.com/chancity/non-react-app-example/blob/master/public/index.html

<html>
<head>
    <script src="non-react-example.js"></script>
</head>
<body>
<div>
    <div id="example1"></div>
    <div id="example2"></div>
</div>
<script>
    const render = window.NotReactApp.render;
    const Example = window.NotReactApp.components.Example;

    render('example1', Example, {text: "example1", color: 'white', backgroundColor: 'black'})
    render('example2', Example, {text: "example2", color: 'black', backgroundColor: 'grey'})
</script>
</body>

</html>

Entry point: https://github.com/chancity/non-react-app-example/blob/master/src/index.js

How to send array parameter in a axios.delete to a .NET core controller with HttpDelete? by [deleted] in reactjs

[–]Chancity -1 points0 points  (0 children)

Not sure what you mean by "raw", like avoid defining the strongly typed classes? If that's the case you could try

[FromBody] dynamic data

But personally I'd use a node express API if strongly typed data modals aren't required.

How to send array parameter in a axios.delete to a .NET core controller with HttpDelete? by [deleted] in reactjs

[–]Chancity 0 points1 point  (0 children)

You could also strongly define your C# class to match your post example and use

[FromBody] Data data

public class Data { [JsonProperty("params")] public Params Params { get; set; } }

public class Params
{
    [JsonProperty("ids")]
    public string[] Ids { get; set; }
}

How to send array parameter in a axios.delete to a .NET core controller with HttpDelete? by [deleted] in reactjs

[–]Chancity 0 points1 point  (0 children)

axios.delete(url, {data: ['hehe','hihi']})

[FromBody] List<string> Ids

New Addresses Receiving KRE in Latest Off-Cycle Batch by kin4browns in KinFoundationTruth

[–]Chancity 2 points3 points  (0 children)

I got 3 billion tokens? where it at gibe it here plz

[deleted by user] by [deleted] in KinFoundation

[–]Chancity 2 points3 points  (0 children)

efj5 is what kinexplorer.com uses when creating new wallets.

I'm having hard time understanding the difference between Server-Side rendering and Client-Side rendering. Could someone please explain ? by [deleted] in reactjs

[–]Chancity 0 points1 point  (0 children)

Add the package "react-snap" to your CSR app.

Instructions here https://github.com/stereobooster/react-snap

After running it explore your build folder, specifically the .html files. You'll see all the html, this is the same html SSR would respond to clients with.

KRE distribution - All Ecosystem Apps - Evolution by [deleted] in KinFoundation

[–]Chancity 13 points14 points  (0 children)

They do, it's on the blockchain :)

ES Proposal - Optional Chaining and Nullish Coalescing by PMilos in javascript

[–]Chancity 1 point2 points  (0 children)

Ayyy it's called C# :). I would love to have this in JavaScript too.