Skip to content

Commit 1f3264e

Browse files
committed
rename to cherry-soda (prep for npm publish)
1 parent 582eb99 commit 1f3264e

32 files changed

+201
-195
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ dist
171171
# node
172172
package-lock.json
173173

174-
# cherry-cola
174+
# cherry-soda
175175
.cc
176176
lib
177177
__generated

.npmignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
test
2+
jest.config.js
3+
example
4+
5+
.idea
6+
*.tgz

README.md

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<div align="center">
2-
<img width="300" height="300" src="/img/logo.svg" alt="cherry-cola">
2+
<img width="300" height="300" src="/img/logo.svg" alt="cherry-soda">
33
</div>
44
<div align="center">
55
<a href="#get-started">Get started</a>
@@ -13,25 +13,25 @@
1313

1414
Yet another JavaScript framework that nobody needs. It has an SSR-first approach, and uses stateful, functional JSX
1515
components to build apps. The components are rendered on the server, but contain state change handlers that are executed
16-
in the browser. Instead of bundling the full component, cherry-cola extracts and bundles only the necessary code (the
16+
in the browser. Instead of bundling the full component, cherry-soda extracts and bundles only the necessary code (the
1717
event handler with its lexical scope, a template for client-side rendering, and styles) which can drastically reduce
1818
bundle size. Therefore, by default (i.e. without using state change handlers), there is no client side JavaScript
1919
whatsoever.
20-
Currently, cherry-cola only runs on bun, Node compatibility is planned.
20+
Currently, cherry-soda only runs on bun, Node compatibility is planned.
2121

2222
> **Warning**&nbsp;&nbsp;
23-
> Cherry-cola is experimental. Everything is subject to change.
23+
> Cherry-soda is experimental. Everything is subject to change.
2424
2525
## Test the waters, dip a toe
2626

27-
If you just to test out cherry-cola, you can run the examples. For that you need to have [Bun](https://bun.sh)
28-
installed. Then, clone the repository, install the dependencies with `bun i`. Use cherry-cola's CLI to run an example:
27+
If you just to test out cherry-soda, you can run the examples. For that you need to have [Bun](https://bun.sh)
28+
installed. Then, clone the repository, install the dependencies with `bun i`. Use cherry-soda's CLI to run an example:
2929

3030
```shell
31-
cli/index dev example/cherry-cola-template/index.jsx
31+
cli/index dev example/cherry-soda-template/index.jsx
3232
```
3333

34-
[//]: # (Visit `localhost:3000` and / or edit files in `example/cherry-cola-template/`. To test out the other examples, use the
34+
[//]: # (Visit `localhost:3000` and / or edit files in `example/cherry-soda-template/`. To test out the other examples, use the
3535
respective `index.jsx` as an argument instead.)
3636

3737
## Get started
@@ -58,48 +58,48 @@ export default function App() {
5858
}
5959
```
6060

61-
`index.js` is the main entry point for cherry-cola. It will look for an exported function `main()` and will
61+
`index.js` is the main entry point for cherry-soda. It will look for an exported function `main()` and will
6262
use the returned value to render HTML. `App.js` is an example component.
6363

64-
Then, add the cherry-cola jsx runtime to your `tsconfig.json`:
64+
Then, add the cherry-soda jsx runtime to your `tsconfig.json`:
6565

6666
```json
6767
{
6868
"compilerOptions": {
6969
"jsx": "react-jsx",
70-
"jsxImportSource": "cherry-cola"
70+
"jsxImportSource": "cherry-soda"
7171
}
7272
}
7373
```
7474

75-
Run `cherry-cola dev src/index.js` to start the dev server. Then, visit `localhost:3000`.
75+
Run `cherry-soda dev src/index.js` to start the dev server. Then, visit `localhost:3000`.
7676

77-
Alternatively, you can use the [`cherryCola()`](#cherrycolaentry-string) function in your own server to render the app.
77+
Alternatively, you can use the [`cherrySoda()`](#cherrysodaentry-string) function in your own server to render the app.
7878
This also automatically serves the asset files (JavaScript, CSS, images, etc.).
7979
For Bun.serve:
8080

8181
```javascript
8282
// main.js
83-
import cherryCola from 'cherry-cola/bun'
83+
import cherrySoda from 'cherry-soda'
8484

85-
const cherryColaApp = cherryCola('src/index.js')
85+
const cherrySodaApp = cherrySoda('src/index.js')
8686

8787
Bun.serve({
8888
async fetch(req) {
8989
const url = new URL(req.url)
9090
if (url.pathname.startsWith('/api'))
9191
return new Response() // your custom responses
92-
return await cherryColaApp(req)
92+
return await cherrySodaApp(req)
9393
},
9494
port: 3000,
9595
})
9696
```
9797

9898
[//]: # (### Dev server &#40;HMR-like&#41;)
9999

100-
[//]: # (Cherry-cola doesn't use webpack, so HMR isn't really an option. However, cherry-cola provides a feature &#40;preliminarily
100+
[//]: # (Cherry-soda doesn't use webpack, so HMR isn't really an option. However, cherry-soda provides a feature &#40;preliminarily
101101
called dynamic code synchronisation&#41; that reflects changes made to your code in the browser immediately after saving.
102-
The `cherry-cola dev` command has this activated out of the box.
102+
The `cherry-soda dev` command has this activated out of the box.
103103
For usage with a custom server use the `dynamicCodeSynchronisation&#40;&#41;` function.)
104104

105105
[//]: # (todo: example)
@@ -122,7 +122,7 @@ the function as an array of the state value and a function to change the state.
122122
Here is an [example](/example/counter/App.jsx) to illustrate all those features:
123123

124124
```javascript
125-
import {createRef, createState, doSomething} from 'cherry-cola'
125+
import {createRef, createState, doSomething} from 'cherry-soda'
126126

127127
export default function Counter() {
128128
// create a state with an initial value `0`
@@ -173,9 +173,9 @@ export default function Counter() {
173173

174174
#### Rendering
175175

176-
##### `cherryCola(entry: string)`
176+
##### `cherrySoda(entry: string)`
177177

178-
To render an app, you can use the `cherryCola()` function. It returns a request handler for `Bun.serve()` and handles
178+
To render an app, you can use the `cherrySoda()` function. It returns a request handler for `Bun.serve()` and handles
179179
compiling / building and watching all the files belonging to your app.
180180

181181
**Parameters:**
@@ -190,23 +190,23 @@ compiling / building and watching all the files belonging to your app.
190190

191191
#### Entry file
192192

193-
Every cherry-cola app has a single entry file. This file exports a function `main()`, which returns the main function
194-
component (usually called `<App/>`). If this component does not yield a `<html>` tag, cherry-cola will automatically
193+
Every cherry-soda app has a single entry file. This file exports a function `main()`, which returns the main function
194+
component (usually called `<App/>`). If this component does not yield a `<html>` tag, cherry-soda will automatically
195195
wrap the resulting HTML in a standard document.
196196

197197
[//]: # (todo: create option to turn that off)
198198

199199
#### Function components
200200

201-
cherry-cola function components look similar to React's function components. They are a function that accept props as a
201+
cherry-soda function components look similar to React's function components. They are a function that accept props as a
202202
parameter and return a component. The difference to React's function components is that the function code itself does
203203
not get send to the browser. All code in function components gets executed on the server.
204204
Internally, function components are called immediately after they change. This can cause unexpected effects for example
205205
when a function components writes to a database. To fix that, you can use the
206-
[`sideEffect()`](#sideeffectcallback-args-any--void) function to tell cherry-cola that you want to execute this code
206+
[`sideEffect()`](#sideeffectcallback-args-any--void) function to tell cherry-soda that you want to execute this code
207207
only for a request.
208208
If you want to execute code on the component in the browser, you can use the
209-
[`doSomething()`](#dosomethingcallback-args-any--void--function-dependencies-any) function. Cherry-cola collects the
209+
[`doSomething()`](#dosomethingcallback-args-any--void--function-dependencies-any) function. Cherry-soda collects the
210210
code gives as a function to `doSomething()` at build time and compiles it together with the other `doSomething()`s into
211211
one file.
212212

@@ -262,7 +262,7 @@ callback.
262262
Returns a new `Ref`. Pass this to an element like so:
263263

264264
```javascript
265-
import {createRef} from 'cherry-cola'
265+
import {createRef} from 'cherry-soda'
266266

267267
function Component() {
268268
const myRef = createRef()
@@ -306,7 +306,7 @@ and stays at an older version.
306306
Example of updating immutable type state:
307307

308308
```javascript
309-
import {createState, doSomething} from 'cherry-cola'
309+
import {createState, doSomething} from 'cherry-soda'
310310

311311
function App() {
312312
const state = createState('oldValue')
@@ -330,7 +330,7 @@ function App() {
330330

331331
### Essential built-in components
332332

333-
Cherry-cola provides some built-in components that are essential to a document.
333+
Cherry-soda provides some built-in components that are essential to a document.
334334

335335
#### `<Html>`
336336

@@ -344,7 +344,7 @@ rendered inside the `<head>` and potentially replace the generated tags.
344344
For example:
345345

346346
```javascript
347-
import {Html, Head, Body} from 'cherry-cola'
347+
import {Html, Head, Body} from 'cherry-soda'
348348

349349
function App() {
350350
return (

bun.lockb

0 Bytes
Binary file not shown.

cli/index

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22

3-
CC_MAIN_SCRIPT_PARTIAL="cherry-cola/cli/main.js"
3+
CC_MAIN_SCRIPT_PARTIAL="cherry-soda/cli/main.js"
44
DIRNAME=$(dirname "$0")
55

66
if [[ $DIRNAME == *node_modules/.bin ]]; then

cli/main.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ if (!process.env.PORT)
4444

4545
const program = yargs(pureArgs)
4646
.scriptName(packageJson.name)
47-
.version('cherry-cola v' + packageJson.version)
47+
.version('cherry-soda v' + packageJson.version)
4848
.usage('$0 <command> [options] <entry>')
4949
.command('build [options] <entry>', 'Build assets for client (and node, if specified).',
5050
(yargs) => {
@@ -61,7 +61,7 @@ const program = yargs(pureArgs)
6161
addNodeOption(yargs, 'Use Node.js server instead of Bun.js')
6262
.version(false)
6363
.positional('entry', {
64-
describe: 'Entry file for cherry-cola'
64+
describe: 'Entry file for cherry-soda'
6565
})
6666
},
6767
dev
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export default function App() {
1313
Edit <code>App.jsx</code> and save to reload.
1414
</p>
1515
<a className={'App-link'}
16-
href={'https://github.com/drinking-code/cherry-cola#readme'}
16+
href={'https://github.com/drinking-code/cherry-soda#readme'}
1717
target={'_blank'}
1818
rel={'noopener noreferrer'}
1919
>

0 commit comments

Comments
 (0)