This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React from 'react'; | |
| import { SSRHandler } from '@goldstack/template-ssr'; | |
| import { renderPage, hydrate } from './../render'; | |
| const Posts = (props: { posts: string[] }): JSX.Element => { | |
| return ( | |
| <> | |
| <p>Posts:</p> | |
| {props.posts.map((p, idx) => ( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| return <div className={styles.myclass}></div>; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React from 'react'; | |
| import styles from './MyComponent.module.css'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| .myclass { | |
| padding: 10px; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { build } from 'esbuild'; | |
| import cssServerPlugin from 'esbuild-css-modules-server-plugin'; | |
| import cssPlugin from 'esbuild-css-modules-client-plugin'; | |
| const generatedCss: string[] = []; | |
| const res = await build({ | |
| plugins: [ | |
| cssServerPlugin({ | |
| onCSSGenerated: (css) => { | |
| generatedCss.push(css); | |
| }, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { build } from 'esbuild'; | |
| import cssPlugin from 'esbuild-css-modules-client-plugin'; | |
| const res = await build({ | |
| plugins: [ | |
| cssPlugin({ | |
| excludeCSSInject: true, | |
| }), | |
| ], | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { build } from 'esbuild'; | |
| import cssPlugin from 'esbuild-css-modules-client-plugin'; | |
| const res = await build({ | |
| plugins: [cssPlugin()], | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { build } from 'esbuild'; | |
| import cssServerPlugin from 'esbuild-css-modules-server-plugin'; | |
| const generatedCss: string[] = []; | |
| const res = await build({ | |
| plugins: [ | |
| cssServerPlugin({ | |
| onCSSGenerated: (css) => { | |
| generatedCss.push(css); | |
| }, | |
| }), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const table = await connectTable(); | |
| const Users = UserEntity(table); | |
| await Users.put({ | |
| pk: '[email protected]', | |
| sk: 'admin', | |
| name: 'Joe', | |
| emailVerified: true, | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export function UserEntity<Name extends string>( | |
| table: Table<Name, 'pk', 'sk'> | |
| ): Entity<User, UserKey, typeof table> { | |
| const e = new Entity<User, UserKey, typeof table>({ | |
| name: 'User', | |
| attributes: { | |
| pk: { partitionKey: true }, | |
| sk: { hidden: true, sortKey: true }, | |
| name: { type: 'string', required: true }, | |
| emailVerified: { type: 'boolean', required: true }, |