- 4️⃣ Create React App 4 (using Webpack 4)
- 5️⃣ Create React App 5 (using Webpack 5)
- ⚡️ React with Vite
Steps to install a CRA 4 app from scratch using the SDK:
From f54a9349cb1205bf34d04d2900cf5e1e69228480 Mon Sep 17 00:00:00 2001 | |
From: Loris Leiva <loris.leiva@gmail.com> | |
Date: Thu, 14 Mar 2024 15:13:08 +0000 | |
Subject: [PATCH] Fix exported extensions in package.json | |
--- | |
clients/js/package.json | 8 ++++---- | |
clients/js/tsup.config.ts | 1 + | |
2 files changed, 5 insertions(+), 4 deletions(-) |
import { createSetAuthorityInstruction, AuthorityType } from '@solana/spl-token'; | |
import { Transaction } from '@solana/web3.js'; | |
const instruction = createSetAuthorityInstruction( | |
token.publicKey, | |
closeAuthority.publicKey, | |
AuthorityType.CloseAccount, | |
null | |
); |
Steps to install a CRA 4 app from scratch using the SDK:
<script setup> | |
import { ref, toRefs, computed } from 'vue' | |
import { useWorkspace } from '@/composables' | |
import TweetFormUpdate from './TweetFormUpdate' | |
const props = defineProps({ | |
tweet: Object, | |
}) | |
const { tweet } = toRefs(props) |
Unfortunately, at the time of writing, the Solana installer script above will not work on Apple M1 computers.
The installation will be successful and you’ll be able to call solana
commands but other Solana binaries such as solana-test-validator
will throw various errors since it’s expecting dependencies to be located elsewhere. If you’ve already installed it that way, no worries, simply run rm -rf ~/.local/share/solana
to uninstall Solana.
I’ll be sure to update this article if/when this will work out-of-the-box for M1 computers.
In the meantime, we’ve got a little workaround to go through. We need to clone the Solana repository and compile the binary from the source code. Don’t worry, the installation process is still super simple, it just takes a bit longer due to the compilation time. Here are the steps.
export function pipeline(initialValue, pipes, then) { | |
then = then ?? ((t) => t); | |
const pipelineCallback = pipes | |
.slice() | |
.reverse() | |
.reduce((next, pipe) => (passable) => pipe(passable, next), then); | |
return pipelineCallback(initialValue); | |
} |
import { watchEffect } from "vue" | |
export const useAutoresizeTextarea = (element) => { | |
const resizeTextarea = () => { | |
element.value.style.height = 'auto' | |
element.value.style.height = element.value.scrollHeight + 'px' | |
} | |
watchEffect(onInvalidate => { | |
if (! element.value) return |
<script setup> | |
import useLocalStorage from './useLocalStorage' | |
const publicKey = useLocalStorage('solana-wallet-public-key') | |
</script> | |
<template> | |
<div> | |
<input type="text" v-model="publicKey"> | |
<div v-text="publicKey"></div> | |
</div> |
<?php | |
// Nodes. | |
abstract class Node implements Visitable {} | |
class Number extends Node { | |
public function __construct(public float $value){} | |
public function accept(Visitor $visitor) { | |
return $visitor->visitNumber($this); | |
} |
<?php | |
abstract class Node {} | |
class Calculator extends Node { | |
public function __construct(public array $statements){} | |
} | |
class Add extends Node { | |
public function __construct(public Node $left, public Node $right){} |