# Change log
# 2.0.0
# Export changes
Changed export paths to not use /dist/
, e.g.:
'immaculata/dist/jsx-strings.js'
=>'immaculata/jsx-strings.js'
'immaculata/dist/*.js'
=>'immaculata/*.js'
# FileTree changes
- Changed
fileTree.watch
to not takefn
anymore - Changed
fileTree.watch
to returnEventEmitter
withfilesUpdated
event - Changed
fileTree.watch
to takedebounce
instead ofopts: { debounceMs }
- Fixed
fileTree.watch
when called multiple times (no-op, returns same emitter) - Added
fileTree.onModuleInvalidated
to be called inside modules - Added
fileTree.addDependency
for module invalidation - Added
moduleInvalidated
event tofileTree.watch()
events - Moved
fileTree.enableImportsModuleHook
tohooks.useTree
# Hook changes
- Put all hooks under
hooks
namespace from main export- Also exported individually from
'immaculata/hooks.js'
- Also exported individually from
- Moved
fileTree.enableImportsModuleHook
tohooks.useTree
- Removed
jsxRuntimeModuleHook
as too specific - Added
hooks.mapImport
to replacejsxRuntimeModuleHook
- Renamed
exportAsStringModuleHook
=>hooks.exportAsString
- Renamed
tryTsTsxJsxModuleHook
=>hooks.tryAltExts
- Renamed
compileJsxTsxModuleHook
=>hooks.compileJsx
# DevServer changes
- Fixed double-encode of default data on HMR reload
# 1.2.0
The ignore
option of .watch(...)
was from when it just forwarded options to chokidar
.
But we usually also want to exclude files with given paths from the tree itself.
So the option has been removed in favor of a new exclude
option in the constructor.
And since we already keep an in-memory file tree (that's the whole point of FileTree
),
it turned out to be very easy to give a highly detailed report of what actually changed.
So the onChange
callback to .watch(...)
now receives FileTreeChange[]
where:
export type FileTreeChange = { path: string, change: 'add' | 'dif' | 'rem' }
- Added
opts?: { exclude: (path: string, stat: fs.Stats) => any }
toFileTree
constructor - Added
debounceMs
option toFileTree.watch
- Added
FileTree.addDependency
method - Removed
ignore
option fromFileTree.watch
- Changed
onChange
callback parameter type ofFileTree.watch
- The
onChange
callback is no longer called when a file is saved but unchanged
# 1.1.0
Removed tree.processFiles
as being too trivial and restrictive.
To upgrade, replace:
const result = tree.processFiles(files => {
// ...
})
with:
const files = Pipeline.from(tree.files)
// ...
return files.results()
(In fact, that's literally all the method originally did.)