You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The changes are listed [here](https://github.com/rescript-lang/rescript-compiler/blob/master/Changes.md#841).
23
+
The changes are listed [here](https://github.com/rescript-lang/rescript-compiler/blob/master/Changes.md#841).
22
24
23
25
We will go through some highlighted changes.
24
26
25
27
### The integrity of `bsb -make-world`
26
28
27
-
When we introduced `bsb` as a build system around four years ago, we made the assumption that dependencies are immutable,
28
-
so that once it's built for the first time, we don't need to rebuild it any more. The integrity of `bsb -make-world` will be broken
29
+
When we introduced `bsb` as a build system around four years ago, we made the assumption that dependencies are immutable,
30
+
so that once it's built for the first time, we don't need to rebuild it any more. The integrity of `bsb -make-world` will be broken
29
31
when the assumption does not hold.
30
32
31
-
In this release, we fix the integrity of `bsb -make-world` which allows user to change the dependencies.
32
-
The fix is well implementend that people who don't do such modifications will not pay for it.
33
+
In this release, we fix the integrity of `bsb -make-world` which allows user to change the dependencies.
34
+
The fix is well implemented that people who don't do such modifications will not pay for it.
33
35
34
-
This is one of the highest desired feature request based on the
35
-
[user feedback](https://github.com/rescript-lang/rescript-compiler/issues/4361#issuecomment-739538789), so we will expand a bit here why it is tricky
36
+
This is one of the highest desired feature request based on the
37
+
[user feedback](https://github.com/rescript-lang/rescript-compiler/issues/4361#issuecomment-739538789), so we will expand a bit here why it is tricky
36
38
to implement it without compromising performance.
37
39
38
-
In ReScript compilation scheme, dependencies as packages are treated as a blackbox,
40
+
In ReScript compilation scheme, dependencies as packages are treated as a black box,
39
41
changes of dependencies should be *transitive*. The is due to that we have cross module
40
-
optimizations and the binary interface itself is a hash of its dependencies.
41
-
So for a package dependency chain: A -> B -> C, if A changes and B does not change, C still needs get rebuilt.
42
-
Because the intermediate output of B may still change due to the change of A.
43
-
To make things worse, each package comes with an installation process which is a shell script, so re-installation will make the
42
+
optimizations and the binary interface itself is a hash of its dependencies.
43
+
So for a package dependency chain: A -> B -> C, if A changes and B does not change, C still needs get rebuilt.
44
+
Because the intermediate output of B may still change due to the change of A.
45
+
To make things worse, each package comes with an installation process which is a shell script, so re-installation will make the
44
46
package look like freshly built.
45
47
46
-
In this release, we track the installation in the build graph as well, and we calculate the hash of the installation of dependencies and put it in the
47
-
dependent's command line flags for building binary artifacts. Such strategy benefits in such aspects:
48
+
In this release, we track the installation in the build graph as well, and we calculate the hash of the installation of dependencies and put it in the
49
+
dependent's command line flags for building binary artifacts. Such strategy benefits in such aspects:
48
50
49
51
- The calculation of the hash of installation is almost free since it is just one stat, we don't need track all dependencies' artifacts.
50
-
- The introducion of such hashing does not appear in parsing, so that the changes of dependencies will never trigger re-parsing.
51
-
- Once the package installation is a nop, the transitive rebuild graph will be cut off so that we can save some unneeded rebuild.
52
-
- When people make changes to the depdendencies, if such changes don't change the package interface, it will not trigger the build of its dependents.
52
+
- The introduction of such hashing does not appear in parsing, so that the changes of dependencies will never trigger re-parsing.
53
+
- Once the package installation is a no-op, the transitive rebuild graph will be cut off so that we can save some unneeded rebuild.
54
+
- When people make changes to the dependencies, if such changes don't change the package interface, it will not trigger the build of its dependents.
53
55
54
56
### Introducing `pinned-dependencies`
55
57
56
-
To make `bsb -make-world` more pratical, we also introduce a new concept called: `pinned-dependencies`.
58
+
To make `bsb -make-world` more practical, we also introduce a new concept called: `pinned-dependencies`.
57
59
In general, packages are classified as three categories:
58
60
59
61
- toplevel
60
62
- warnings reported
61
63
- warn-error respected
62
64
- build dev dependency
63
65
- run custom rules
64
-
- package-specs like es6/commonjs overrides all its dependencies
66
+
- package-specs like ES6/CommonJS overrides all its dependencies
65
67
- pinned dependencies
66
68
- warnings reported
67
69
- warn-error respected
@@ -72,21 +74,20 @@ In general, packages are classified as three categories:
72
74
- ignore dev directories
73
75
- ignore custom generator rules
74
76
75
-
Previously, we only had `toplevel` and `normal dependencies`, by introducing `pinned-dependencies`,
76
-
such package will be built mostly like `toplevel` packages.
77
+
Previously, we only had `toplevel` and `normal dependencies`, by introducing `pinned-dependencies`,
78
+
such package will be built mostly like `toplevel` packages.
77
79
78
-
The usage is quite simple, add `pinned-dependencies` in the toplevel package's `bsconfig.json`.
80
+
The usage is quite simple, add `pinned-dependencies` in the toplevel package's `bsconfig.json`.
79
81
Note such field only make sense in toplevel's configuration.
80
82
81
-
82
83
### More robust handling of removal of staled output
83
84
84
-
When people delete or rename rescript files, it will introduce dangling staled output, for example, renaming `src/A.res`
85
-
into `src/B.res` will bring `src/A.cmi` (and more intemediate outputs) stale. This is worse than it sounds like, suppose you have a
85
+
When people delete or rename ReScript files, it will introduce dangling staled output, for example, renaming `src/A.res`
86
+
into `src/B.res` will bring `src/A.cmi` (and more intermediate outputs) stale. This is worse than it sounds like, suppose you have a
86
87
local `src/List.res` which shadows the stdlib's List. Now we remove it, it will introduce stale `List.cmi` file, without the proper removal
87
88
of such stale outptu, such stale `List.cmi` file will break the integrity of the build.
88
89
89
-
In this release, we introduced a more robust algorithm that will always remove stale output before the build so
90
+
In this release, we introduced a more robust algorithm that will always remove stale output before the build so
90
91
that such integrity is not broken.
91
92
92
93
Last but not the least, we continue improving the readability, debuggability of the [generated output](https://github.com/rescript-lang/rescript-compiler/pull/4858) : )
0 commit comments