@arona/core 0.0.1-dev.9d74001 → 0.0.1-dev.ff9c398

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/bin/cli.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- const { run } = require("@arona/core/cli")
3
+ import { run } from "@arona/core/cli"
4
4
 
5
5
  run()
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arona/core",
3
- "version": "0.0.1-dev.9d74001",
3
+ "version": "0.0.1-dev.ff9c398",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/djobbo/arona.git"
@@ -47,13 +47,13 @@
47
47
  "typescript": "^5.8.3"
48
48
  },
49
49
  "dependencies": {
50
- "@rspack/core": "^1.3.10",
50
+ "@rspack/core": "^1.3.13",
51
51
  "@rspack/plugin-react-refresh": "^1.4.3",
52
52
  "dotenv": "^16.5.0",
53
53
  "react": "18.3.0",
54
54
  "react-reconciler": "0.28.0",
55
55
  "uuid": "^11.1.0",
56
- "webpack": "^5.99.8",
56
+ "webpack": "^5.99.9",
57
57
  "webpack-node-externals": "^3.0.0"
58
58
  }
59
59
  }
@@ -1,8 +1,6 @@
1
- import type { Configuration } from "@rspack/core"
1
+ import type { Configuration, Plugin } from "@rspack/core"
2
2
  import { rspack } from "@rspack/core"
3
- import type { ExternalItemFunctionData } from "@rspack/core"
4
3
  import ReactRefreshPlugin from "@rspack/plugin-react-refresh"
5
- import nodeExternals from "webpack-node-externals"
6
4
 
7
5
  export interface RspackConfigOptions {
8
6
  entry: string
@@ -18,8 +16,8 @@ export const createRspackConfig = ({
18
16
  outputFolder,
19
17
  mode,
20
18
  hot = false,
21
- }: RspackConfigOptions): Configuration => {
22
- const plugins = []
19
+ }: RspackConfigOptions) => {
20
+ const plugins: Plugin[] = []
23
21
 
24
22
  if (hot) {
25
23
  plugins.push(
@@ -28,20 +26,13 @@ export const createRspackConfig = ({
28
26
  )
29
27
  }
30
28
 
31
- return {
29
+ const config: Configuration = {
32
30
  target: "node",
33
31
  mode,
34
32
  entry: {
35
33
  main: hot ? ["webpack/hot/poll?100", entry] : entry,
36
34
  },
37
35
  devtool: mode === "development" ? "source-map" : false,
38
- externals: [
39
- // Use nodeExternals to handle most node_modules
40
- // @ts-expect-error - webpack-node-externals type is not compatible with rspack
41
- nodeExternals({
42
- allowlist: hot ? ["webpack/hot/poll"] : [],
43
- }),
44
- ],
45
36
  externalsPresets: {
46
37
  node: true,
47
38
  },
@@ -90,4 +81,6 @@ export const createRspackConfig = ({
90
81
  extensions: [".tsx", ".ts", ".js", ".jsx", ".node"],
91
82
  },
92
83
  }
84
+
85
+ return config
93
86
  }
@@ -55,14 +55,20 @@ export class AronaRootNode<
55
55
  }
56
56
 
57
57
  async initialRender(Code: () => JSX.Element) {
58
- this.reconcilerInstance.updateContainer(
59
- <RootNodeProvider<Props, RenderOutput> rootNode={this}>
60
- <Code />
61
- </RootNodeProvider>,
62
- this.#rootContainer,
63
- )
58
+ const renderPromise = new Promise((resolve) => {
59
+ this.reconcilerInstance.updateContainer(
60
+ <RootNodeProvider<Props, RenderOutput> rootNode={this}>
61
+ <Code />
62
+ </RootNodeProvider>,
63
+ this.#rootContainer,
64
+ null,
65
+ () => {
66
+ this.render().then(resolve)
67
+ },
68
+ )
69
+ })
64
70
 
65
- await this.render()
71
+ return renderPromise
66
72
  }
67
73
 
68
74
  render = debounce(async () => {