This reverts commit a06ff81de5, reversing
changes made to c5e7de42f6.
Today I learned you can revert an entire merge (not just the merge commit)
by doing `git revert -m n <merge commit hash>`, where `n` is the index of
the parent commit of the merge commit that you want to keep. In this case
the command was:
git revert -m 1 a06ff81de5
Because the files are in an imports/ directory, they are still considered
lazy, so they will not be applied to the document unless imported from JS.
Related: #6037
Importantly, the files can now differ with respect to their .lazy
properties, which fixes#6806 and related issues. Note that the files must
have different .targetPath values if they have the same .sourcePath.
This is a minor breaking change for code that relied on module.id being
based on the .sourcePath instead of the .targetPath.
This path can be specified by calling addJavaScript({ path: ... }), and
defaults to being identical to the .sourcePath if no options.path is
provided. The .targetPath may be different from the .sourcePath when a
compiler plugin calls addJavaScript multiple times for the same file,
using a different options.path each time, e.g. when a JSON configuration
file turns into multiple JS resources.
If we pass a file to ImportScanner#addInputFiles, and a module identifier
resolves to that file, it shouldn't matter if the file actually exists on
disk. A common example is a new file generated by a compiler plugin.
`Match.Optional` is still only supposed to "pass" if the value is `null`
or the specified type. The new `Match.Maybe` allows `undefined` or
`null` in addition to the specified types. `Match.Optional` is on the
track toward deprecation, however to not break existing code it was
*supposed* to stay working the same as before. (per #3876).
There weren't tests in place to make sure that `Match.Optional` kept
working the same, and the code didn't actually make it keep working the
same. Hopefully extra tests will make this better.
`.Maybe` has some additional bugs, but should be addressed separately
(see #6271)
Fixes#6735