elm-webpack-loader 8.0.3 â 9.0.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/.travis.yml +5 -5
- package/CHANGELOG.md +12 -0
- package/README.md +94 -4
- package/example/package-lock.json +3686 -3724
- package/example/package.json +6 -7
- package/example/webpack.config.js +5 -2
- package/index.js +43 -7
- package/package.json +7 -4
- package/test/loader.js +79 -0
package/.travis.yml
CHANGED
|
@@ -10,10 +10,8 @@ os:
|
|
|
10
10
|
|
|
11
11
|
env:
|
|
12
12
|
matrix:
|
|
13
|
-
- ELM_VERSION=0.19.3-0 TARGET_NODE_VERSION=
|
|
14
|
-
- ELM_VERSION=0.19.3-0 TARGET_NODE_VERSION=
|
|
15
|
-
- ELM_VERSION=0.19.3-0 TARGET_NODE_VERSION=11
|
|
16
|
-
- ELM_VERSION=0.19.3-0 TARGET_NODE_VERSION=12
|
|
13
|
+
- ELM_VERSION=0.19.3-0 TARGET_NODE_VERSION=22
|
|
14
|
+
- ELM_VERSION=0.19.3-0 TARGET_NODE_VERSION=24
|
|
17
15
|
|
|
18
16
|
before_install:
|
|
19
17
|
- if [ ${TRAVIS_OS_NAME} == "osx" ];
|
|
@@ -26,7 +24,9 @@ install:
|
|
|
26
24
|
- node --version
|
|
27
25
|
- npm --version
|
|
28
26
|
- npm install -g elm@$ELM_VERSION
|
|
29
|
-
- npm
|
|
27
|
+
- npm ci
|
|
30
28
|
|
|
31
29
|
script:
|
|
32
30
|
- npm test
|
|
31
|
+
- npm ci --prefix example
|
|
32
|
+
- npm run build --prefix example
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 9.0.0
|
|
4
|
+
|
|
5
|
+
- Require Node.js 22.15 or later, and test Node.js 22 and 24 in CI.
|
|
6
|
+
- Update the test and example toolchains, including the webpack development server configuration.
|
|
7
|
+
- Override `node-elm-compiler`'s vulnerable `cross-spawn` 6.0.5 pin with patched 6.0.6.
|
|
8
|
+
|
|
9
|
+
## 8.1.0
|
|
10
|
+
|
|
11
|
+
- Add the optional `maxInstances` setting for limiting concurrent Elm compiler processes, defaulting to one to protect Elm's shared cache and limit memory use.
|
|
12
|
+
- Document how to mount a `Browser.element` program into a target element without modifying generated JavaScript.
|
|
13
|
+
- Use portable Markdown for the modern-alternatives notice so it renders consistently on GitHub and npm.
|
|
14
|
+
|
|
3
15
|
## 8.0.3
|
|
4
16
|
|
|
5
17
|
- Serialize Elm compilations to prevent `elm-stuff` cache corruption, cold-cache first-build races, and Windows memory exhaustion during parallel webpack builds.
|
package/README.md
CHANGED
|
@@ -11,8 +11,7 @@
|
|
|
11
11
|
- đĨ **Hot module reloading** works with `elm-hot-webpack-loader`.
|
|
12
12
|
- đŠē **Compiler diagnostics** appear directly in webpack's error output.
|
|
13
13
|
|
|
14
|
-
>
|
|
15
|
-
> **For new projects, consider a modern alternative.**
|
|
14
|
+
> ## **âšī¸ NOTE:** For new projects, consider a modern alternative
|
|
16
15
|
>
|
|
17
16
|
> - **Pure Elm:** [elm-watch](https://lydell.github.io/elm-watch/)
|
|
18
17
|
> - **Mixed language/framework projects:** [vite-plugin-elm-watch](https://github.com/ryannhg/vite-plugin-elm-watch) or [vite-plugin-elm](https://github.com/hmsk/vite-plugin-elm)
|
|
@@ -27,6 +26,8 @@ Install the loader:
|
|
|
27
26
|
npm install --save-dev elm-webpack-loader
|
|
28
27
|
```
|
|
29
28
|
|
|
29
|
+
Node.js 22.15 or later is required.
|
|
30
|
+
|
|
30
31
|
Add it to your [webpack module rules](https://webpack.js.org/configuration/module/#rule):
|
|
31
32
|
|
|
32
33
|
```js
|
|
@@ -44,6 +45,12 @@ module.exports = {
|
|
|
44
45
|
};
|
|
45
46
|
```
|
|
46
47
|
|
|
48
|
+
Add an element for Elm to replace:
|
|
49
|
+
|
|
50
|
+
```html
|
|
51
|
+
<div id="main"></div>
|
|
52
|
+
```
|
|
53
|
+
|
|
47
54
|
Import your Elm module and initialize the application:
|
|
48
55
|
|
|
49
56
|
```js
|
|
@@ -54,11 +61,13 @@ Elm.Main.init({
|
|
|
54
61
|
});
|
|
55
62
|
```
|
|
56
63
|
|
|
64
|
+
For a `Browser.element` program, `node` replaces only that element, leaving the rest of `<body>` under your control; you do not need to modify the generated JavaScript. `Browser.document` and `Browser.application` intentionally manage the entire body instead.
|
|
65
|
+
|
|
57
66
|
See the [example](#example) for a complete project or configure the [loader options](#options) below.
|
|
58
67
|
|
|
59
68
|
## Options
|
|
60
69
|
|
|
61
|
-
### cwd (default null)
|
|
70
|
+
### cwd (default null) _Recommended_
|
|
62
71
|
|
|
63
72
|
You can add `cwd=elmSource` to the loader:
|
|
64
73
|
|
|
@@ -172,6 +181,23 @@ Elm.Main.init({node: document.getElementById("main")});
|
|
|
172
181
|
Elm.Path.To.OtherModule.init({node: document.getElementById("other")});
|
|
173
182
|
```
|
|
174
183
|
|
|
184
|
+
### maxInstances (default `1`)
|
|
185
|
+
|
|
186
|
+
Set the maximum number of Elm compiler processes that can run concurrently:
|
|
187
|
+
|
|
188
|
+
```js
|
|
189
|
+
...
|
|
190
|
+
use: {
|
|
191
|
+
loader: 'elm-webpack-loader',
|
|
192
|
+
options: {
|
|
193
|
+
maxInstances: 2
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
...
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
The value must be a positive integer. The default of `1` prevents concurrent writes to Elm's shared `elm-stuff` cache and limits memory use. Only increase it when your projects and working directories support parallel compilation; higher limits can substantially increase memory consumption.
|
|
200
|
+
|
|
175
201
|
### Upstream options
|
|
176
202
|
|
|
177
203
|
All options are sent down as an `options` object to node-elm-compiler. For example, you can
|
|
@@ -211,7 +237,7 @@ module: {
|
|
|
211
237
|
}
|
|
212
238
|
```
|
|
213
239
|
|
|
214
|
-
**IMPORTANT**: `elm-hot-webpack-loader` must be placed in the list immediately
|
|
240
|
+
**IMPORTANT**: `elm-hot-webpack-loader` must be placed in the list immediately _before_ `elm-webpack-loader`.
|
|
215
241
|
|
|
216
242
|
## Example
|
|
217
243
|
|
|
@@ -246,3 +272,67 @@ in the example.
|
|
|
246
272
|
## Changelog
|
|
247
273
|
|
|
248
274
|
See [CHANGELOG.md](CHANGELOG.md) for the release history.
|
|
275
|
+
|
|
276
|
+
## â¤ī¸ Projects we love
|
|
277
|
+
|
|
278
|
+
Unaffiliated projects worth exploring:
|
|
279
|
+
|
|
280
|
+
- đŗ **Elm family**: [Awesome Elm](https://github.com/sporto/awesome-elm) â a community-curated
|
|
281
|
+
collection of Elm tutorials, libraries, tools, examples, and community resources.
|
|
282
|
+
|
|
283
|
+
_also [Elm companies](https://github.com/jah2488/elm-companies) and the
|
|
284
|
+
[#elm-dev Matrix space](https://matrix.to/#/#elm-dev:matrix.org) for team chat_
|
|
285
|
+
- đī¸ **Databases**: [Acadia](https://acadia.engineering/) â precise types, verified migrations, and
|
|
286
|
+
compile-time-checked database programming for Elm, with the goal of sustainably funding Elm
|
|
287
|
+
development.
|
|
288
|
+
|
|
289
|
+
_also [mnestic](https://www.mnesticdb.com/) â an embedded Datalog database combining graph traversal,
|
|
290
|
+
vector and keyword search, and historical queries._
|
|
291
|
+
- â¨ī¸ **Editors**: [Lapce](https://lap.dev/lapce/) â a fast, native Rust editor with GPU acceleration,
|
|
292
|
+
built-in LSP and Tree-sitter support, remote development, and efficient [rope-based text storage](https://xi-editor.io/docs/rope_science_00.html).
|
|
293
|
+
|
|
294
|
+
_also [Helix](https://helix-editor.com/) â a terminal-based modal editor with [Kakoune-inspired
|
|
295
|
+
multiple selections](https://kakoune.org/why-kakoune/why-kakoune.html), Tree-sitter integration,
|
|
296
|
+
and built-in language-server support._
|
|
297
|
+
- đ **Version-controlled data and file sync**: [git-annex](https://git-annex.branchable.com/) â
|
|
298
|
+
manage and sync large files with Git without storing their contents in Git, including location
|
|
299
|
+
tracking, checksums, and encryption.
|
|
300
|
+
|
|
301
|
+
_also [DataLad](https://www.datalad.org/) â distributed data management built on Git and
|
|
302
|
+
`git-annex`, with provenance tracking, reproducibility, and nested datasets._
|
|
303
|
+
- đ§Š **Local-first sync**: [Automerge](https://automerge.org/) â a network-agnostic CRDT library for
|
|
304
|
+
offline editing, automatic merging of concurrent changes, and version history, with
|
|
305
|
+
[Peritext](https://www.inkandswitch.com/peritext/) providing a collaborative rich-text data type.
|
|
306
|
+
- đī¸ **Local-first notes**: [SiYuan](https://b3log.org/siyuan/en/) â privacy-first, block-based notes
|
|
307
|
+
with bidirectional links, databases, Markdown support, and end-to-end encrypted multi-device sync.
|
|
308
|
+
|
|
309
|
+
_also [TypeCell](https://www.typecell.org/) â local-first, programmable documents with interactive
|
|
310
|
+
code blocks, a live TypeScript/React runtime, and Peritext-based rich-text collaboration._
|
|
311
|
+
- đ **Distributed version control**: [Pijul](https://pijul.org/) â a patch-based system built on a
|
|
312
|
+
mathematical theory of change commutation, with first-class conflicts and partial clones.
|
|
313
|
+
- đ§Ž **Programming languages**: [Unison](https://www.unison-lang.org/) â a functional language that
|
|
314
|
+
identifies definitions by content hash, with structured refactoring, type-based search, durable
|
|
315
|
+
storage, and distributed computation.
|
|
316
|
+
|
|
317
|
+
_also [Idris](https://idris-lang.org/) â a dependently typed language for
|
|
318
|
+
[type-driven development](https://kevinmahoney.co.uk/articles/tests-vs-types/), with first-class
|
|
319
|
+
types, compiler-checked program properties, and a self-hosted compiler._
|
|
320
|
+
- đ **Internet architecture**: [Named Data Networking (NDN)](https://named-data.net/) â a
|
|
321
|
+
[data-centric network architecture](https://101.named-data.net/) that names and secures data
|
|
322
|
+
directly, with stateful forwarding and in-network caching.
|
|
323
|
+
- đ **Knowledge bases**: [Ownly](https://ownly.work/) â decentralized collaborative workspaces built
|
|
324
|
+
on Named Data Networking, with signed and encrypted updates and local copies of shared files.
|
|
325
|
+
|
|
326
|
+
_also [AppFlowy](https://appflowy.com/) â a self-hosted workspace for projects, wikis, documents,
|
|
327
|
+
and databases, with cross-device sync and control over your infrastructure and data._
|
|
328
|
+
- đŖī¸ **Internationalization (i18n)**: [Fluent](https://projectfluent.org/) â a proper localization
|
|
329
|
+
system by [Mozilla and used by others](https://github.com/heyakyra/fluent-companies) letting
|
|
330
|
+
translators use each language's full grammar, with asymmetric translations, plural and
|
|
331
|
+
grammatical-case handling, and reusable terms.
|
|
332
|
+
- đ¨ **UX and vector design**: [Penpot](https://penpot.app/) â an open-source, web-based design and
|
|
333
|
+
prototyping platform with real-time collaboration, reusable components, CSS Grid and Flex layouts,
|
|
334
|
+
native SVG, and self-hosting.
|
|
335
|
+
|
|
336
|
+
## Acknowledgements
|
|
337
|
+
|
|
338
|
+
Maintenance and documentation used AI assistance from [Qwen.ai](https://qwen.ai/) and [Kimi.ai](https://www.kimi.ai/).
|