create-backtick-app 0.3.2 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-backtick-app",
3
- "version": "0.3.2",
3
+ "version": "0.4.0",
4
4
  "description": "Creates a Backtick app: React Native, React or Solid, with screens from your server on Node or Bun",
5
5
  "keywords": [
6
6
  "backtick",
@@ -11,10 +11,10 @@
11
11
  "format:check": "prettier --check --ignore-unknown ."
12
12
  },
13
13
  "dependencies": {
14
- "@backtickjs/bundler": "0.3.2",
15
- "@backtickjs/core": "0.3.2",
16
- "@backtickjs/node-plugin": "0.3.2",
17
- "@backtickjs/jsx-react": "0.3.2",
14
+ "@backtickjs/bundler": "0.4.0",
15
+ "@backtickjs/core": "0.4.0",
16
+ "@backtickjs/node-plugin": "0.4.0",
17
+ "@backtickjs/jsx-react": "0.4.0",
18
18
  "@hono/node-server": "^2.1.4",
19
19
  "hono": "^4.13.13",
20
20
  "react": "19.2.3",
@@ -22,8 +22,8 @@
22
22
  "typescript": "^6.0.3"
23
23
  },
24
24
  "devDependencies": {
25
- "@backtickjs/prettier-plugin": "0.3.2",
26
- "@backtickjs/tsc": "0.3.2",
25
+ "@backtickjs/prettier-plugin": "0.4.0",
26
+ "@backtickjs/tsc": "0.4.0",
27
27
  "@types/node": "^25.9.1",
28
28
  "@types/react": "19.2.18",
29
29
  "@types/react-dom": "19.2.7",
@@ -1,6 +1,4 @@
1
1
  import { bundler } from "@backtickjs/bundler";
2
- import { cs } from "@backtickjs/core";
3
- import { createRoot } from "react-dom/client" with { backtick: "client" };
4
2
  import type { JSX } from "@backtickjs/jsx-react/jsx-runtime";
5
3
 
6
4
  // The versions of React the page loads, below: what each page is bundled for.
@@ -13,12 +11,10 @@ const modules = {
13
11
  // Development unless NODE_ENV says production, as hosts set it for a deploy.
14
12
  const development = process.env.NODE_ENV !== "production";
15
13
 
16
- // A page: the element, bundled for the browser, and React from a CDN.
14
+ // A page: its element, bundled for the browser, which the page's entry draws
15
+ // with React's `createRoot`, and React from a CDN.
17
16
  export async function toHtml(element: JSX.Element): Promise<string> {
18
- const bundle = await bundler.build({
19
- input: cs`$createRoot(document.getElementById("app")!).render($element)`,
20
- modules,
21
- });
17
+ const bundle = await bundler.build({ input: element, modules });
22
18
  // In development, a map back to the files you wrote, for the browser's
23
19
  // devtools.
24
20
  const { code } = bundle.generate({
@@ -44,7 +40,11 @@ export async function toHtml(element: JSX.Element): Promise<string> {
44
40
  </head>
45
41
  <body style="margin: 0">
46
42
  <div id="app"></div>
47
- <script type="module" src="data:text/javascript,${encodeURIComponent(code)}"></script>
43
+ <script type="module">
44
+ import { createRoot } from "react-dom/client";
45
+ import page from "data:text/javascript,${encodeURIComponent(code)}";
46
+ createRoot(document.getElementById("app")).render(page);
47
+ </script>
48
48
  </body>
49
49
  </html>`;
50
50
  }
@@ -16,12 +16,12 @@
16
16
  "format:check": "prettier --check --ignore-unknown ."
17
17
  },
18
18
  "dependencies": {
19
- "@backtickjs/bundler": "0.3.2",
20
- "@backtickjs/core": "0.3.2",
21
- "@backtickjs/expo": "0.3.2",
22
- "@backtickjs/hono": "0.3.2",
23
- "@backtickjs/node-plugin": "0.3.2",
24
- "@backtickjs/jsx-react": "0.3.2",
19
+ "@backtickjs/bundler": "0.4.0",
20
+ "@backtickjs/core": "0.4.0",
21
+ "@backtickjs/expo": "0.4.0",
22
+ "@backtickjs/hono": "0.4.0",
23
+ "@backtickjs/node-plugin": "0.4.0",
24
+ "@backtickjs/jsx-react": "0.4.0",
25
25
  "@hono/node-server": "^2.1.4",
26
26
  "expo": "~57.0.26",
27
27
  "expo-constants": "~57.0.20",
@@ -35,8 +35,8 @@
35
35
  "typescript": "^6.0.3"
36
36
  },
37
37
  "devDependencies": {
38
- "@backtickjs/prettier-plugin": "0.3.2",
39
- "@backtickjs/tsc": "0.3.2",
38
+ "@backtickjs/prettier-plugin": "0.4.0",
39
+ "@backtickjs/tsc": "0.4.0",
40
40
  "@testing-library/react": "^16.3.3",
41
41
  "@testing-library/user-event": "^14.6.7",
42
42
  "@types/node": "^25.9.1",
@@ -11,18 +11,18 @@
11
11
  "format:check": "prettier --check --ignore-unknown ."
12
12
  },
13
13
  "dependencies": {
14
- "@backtickjs/bundler": "0.3.2",
15
- "@backtickjs/core": "0.3.2",
16
- "@backtickjs/node-plugin": "0.3.2",
17
- "@backtickjs/jsx-solid": "0.3.2",
14
+ "@backtickjs/bundler": "0.4.0",
15
+ "@backtickjs/core": "0.4.0",
16
+ "@backtickjs/node-plugin": "0.4.0",
17
+ "@backtickjs/jsx-solid": "0.4.0",
18
18
  "@hono/node-server": "^2.1.4",
19
19
  "hono": "^4.13.13",
20
20
  "solid-js": "1.9.17",
21
21
  "typescript": "^6.0.3"
22
22
  },
23
23
  "devDependencies": {
24
- "@backtickjs/prettier-plugin": "0.3.2",
25
- "@backtickjs/tsc": "0.3.2",
24
+ "@backtickjs/prettier-plugin": "0.4.0",
25
+ "@backtickjs/tsc": "0.4.0",
26
26
  "@types/node": "^25.9.1",
27
27
  "agent-device": "^0.21.27",
28
28
  "nodemon": "^3.1.14",
@@ -6,7 +6,7 @@ writeFileSync(
6
6
  `import { cs } from "@backtickjs/core";
7
7
 
8
8
  export async function Home() {
9
- return cs\`(
9
+ return cs\`() => (
10
10
  <main style={{ padding: "24px", "font-family": "system-ui, sans-serif" }}>
11
11
  <p>Edit server/Home.tsx to edit this page.</p>
12
12
  </main>
@@ -8,7 +8,9 @@ export async function Home() {
8
8
  const node = process.version;
9
9
  const assembledAt = new Date().toLocaleTimeString();
10
10
 
11
- return cs`{
11
+ // A component, which Solid draws where it's placed: its client components'
12
+ // onMount and refs run once it's in the page.
13
+ return cs`() => {
12
14
  const styles = {
13
15
  page: {
14
16
  "max-width": "640px",
@@ -1,6 +1,4 @@
1
1
  import { bundler } from "@backtickjs/bundler";
2
- import { cs } from "@backtickjs/core";
3
- import { render } from "solid-js/web" with { backtick: "client" };
4
2
  import type { JSX } from "@backtickjs/jsx-solid/jsx-runtime";
5
3
 
6
4
  // The version of Solid the page loads, below: what each page is bundled for.
@@ -13,12 +11,10 @@ const modules = {
13
11
  // Development unless NODE_ENV says production, as hosts set it for a deploy.
14
12
  const development = process.env.NODE_ENV !== "production";
15
13
 
16
- // A page: the element, bundled for the browser, and Solid from a CDN.
14
+ // A page: its component, bundled for the browser, which the page's entry
15
+ // draws with Solid's `render`, and Solid from a CDN.
17
16
  export async function toHtml(element: JSX.Element): Promise<string> {
18
- const bundle = await bundler.build({
19
- input: cs`$render(() => $element, document.getElementById("app")!)`,
20
- modules,
21
- });
17
+ const bundle = await bundler.build({ input: element, modules });
22
18
  // In development, a map back to the files you wrote, for the browser's
23
19
  // devtools.
24
20
  const { code } = bundle.generate({
@@ -44,7 +40,11 @@ export async function toHtml(element: JSX.Element): Promise<string> {
44
40
  </head>
45
41
  <body style="margin: 0">
46
42
  <div id="app"></div>
47
- <script type="module" src="data:text/javascript,${encodeURIComponent(code)}"></script>
43
+ <script type="module">
44
+ import { render } from "solid-js/web";
45
+ import Page from "data:text/javascript,${encodeURIComponent(code)}";
46
+ render(Page, document.getElementById("app"));
47
+ </script>
48
48
  </body>
49
49
  </html>`;
50
50
  }