I build multiplatform applications for Web, Desktop, and Mobile
I ❤️ Flutter and React
Increasingly, the bytes that get shipped to browsers will bear less and less resemblance to the source code that web developers write. - Tom Dale
These are just a few examples
Frameworks are not tools for organizing your code, they are tools for organizing your mind - Rich Harris
class FullName extends React.Component<{}, { fullName }> {
constructor(props) {
super(props);
this.state = { fullName: "Ryan Edge" };
}
handleFullNameChange = e => {
//Wrong, but isn't this what we want to do
this.state.fullName = e.target.value;
this.setState({ fullName: e.target.value });
};
render() {
const { fullName } = this.state;
return (
<div>
<h1>{fullName}</h1>
<input value={fullName} onChange={this.handleFullNameChange} />
</div>
);
}
}
function FullName() {
const [fullName, setFullName] = React.useState("Ryan Edge");
function handleFullNameChange(e) {
setFullName(e.target.value);
}
return (
<div>
<h1>{fullName}</h1>
<input value={fullName} onChange={handleFullNameChange} />
</div>
);
}
Symptoms that your front-end technology is underpowered - Rich Harris
JavaScript is fast, but it's not predictably fast." - Karl Guertin
Frameworks that compile the code you write, without the framework, resulting in a smaller and faster application.
<script>
export let fullName = "Ryan Edge";
$: greeting = `Hello ${fullName}`;
//We could also just use bind:value
function handleFullNameChange(e) {
fullName = e.target.value;
}
</script>
<style>
h1 {
color: blue;
}
</style>
<div>
<h1>{greeting}!</h1>
<!--We could also just use bind:value -->
<input value={fullName} on:input={handleFullNameChange} />
</div>
import { h, Component, Prop } from "@stencil/core";
@Component({
tag: "full-name",
styles: `
h1 {
color: blue;
}
`,
shadow: true
})
class FullNameComponent {
@Prop({ reflect: true }) fullName: string = "Ryan Edge";
handleFullNameChange = e => (this.fullName = e.target.value);
render() {
const { fullName, handleFullNameChange } = this;
return (
<div>
<h1>{fullName}</h1>
<input value={fullName} onInput={handleFullNameChange} />
</div>
);
}
}