- Move to import attributes, import assertions no longer supported
- [fix] ensure updating importmap (inline or inside a file trigger autoreload)
- [fix] ensure dev server ribbon script is properly injected after any importmap script
- [fix] ensure importmap is properly applies for code inlined inside
<script type="module">
- [feat] ensure import.meta.hot.decline() results in a full page reload
- Update dependencies
- bundling and minification enabled by default during build
- Improve and fix autoreload on inline content (like css in js)
- Fix several cases where js module fallback was missing or superflous
- Correct output for code shared between main document and worker(s)
- Prevent double injection of side effect files into worker entry points
- Fix autoreload during dev
- Add
urlInfo.contentLength
- Update plugins API
- context argument is dead (all hooks now called with a single argument)
- context can be accessed either with
urlInfo.context
orreference.ownerUrlInfo.context
reference.parentUrl
becomesreference.ownerUrlInfo.url
- Add
reference.urlInfo
- All
context.referenceUtils
moved tourlInfo.dependencies
- Add methods on urlInfo
.cook
,.cookDependencies
,.getWithoutSearchParam
,.isUsed
- Add methods on reference
.remove
,.inline
- Add
reference.astInfo
- Add
urlInfo.referenceToOthersSet
- Add
urlInfo.referenceFromOthersSet
- Add
urlInfo.firstReference
- Add
urlInfo.contentFinalized
- Add
urlInfo.graph
- Add
graph.rootUrlInfo
- Add lazy getters on
urlInfo.contentAst
andurlInfo.contentEtag
urlInfo.url
now readonly and frozenreference.url
now readonly and frozenreference.prev
andreference.next
always set early to be accessible inside resolveReference and redirectReference hooks- inlining always create a dedicated urlInfo
- Update versioning during build
- now done using placeholders (no need to recook to inject versions)
- Ensure side effect file are properly injected into relevant entry points and only once
- Rename param used to hot reload
?hot
(was?hmr
) - Ensure
assert
keyword is entirely removed when import assertions are not supported - Fix sourcemaps generation during build
- Properly update file written in outDirectoryUrl when url info content is modified after being cooked
- Improve code injection for side effect file, versioning and service worker
- Code injected into HTML files respects indentation to be readable
- Introduce side effect files Side effect files are deduped in entry points when possible
- Use side effect files to inject s.js,
regeneratorRuntime
anddocument.adoptedStylesheet
- Introduce
urlInfo.contentAst
andurlInfo.originalContentAst
- memoize
context.isSupportedOnCurrentClients
- More logs during build
- Ensure version mappings injection do not break when injected in js module with static imports
- Update deps
- Change internal packages structure
- Ensure
document.adoptedStyleSheets
,globalThis
andregeneratorRuntime
polyfill injection in js classic
- Introduce
@jsenv/js-module-fallback
to remove direct dependency between@jsenv/core
and@jsenv/plugin-as-js-classic
- Better error traces when error happens in sourceMainFilePath
- Introduce
ignore
param tobuild
andstartDevServer
- Fix code preventing node esm resolution to be disabled
- remove
webResolution
param, it's useless - preserve references sarting with
#
- Properly handle reference starting with
ignore:
- Remove jsenv internal position attributes from HTML during dev
- Move dev server explorer to
@jsenv/plugin-explorer
- Rename several plugin hook like
resolveUrl
->resolveReference
- Rename
urlAnalysis
param intoreferenceAnalysis
- Split
urlResolution
param intonodeEsmResolution
andwebResolution
- Restore semicolons
- Ensure explorer and sourceMainFilePath work as documented
- Update dependencies
- Introduce
@jsenv/test
and update how runtimes are configured
version 34.0
import { executeTestPlan, chromium } from "@jsenv/core";
await executeTestPlan({
testPlan: {
"**/*.test.html": {
runtime: chromium,
runtimeParams: { headful: true },
},
},
});
version 35.0
import { executeTestPlan, chromium } from "@jsenv/test";
await executeTestPlan({
testPlan: {
"**/*.test.html": {
runtime: chromium({ headful: true }),
},
},
});
- Add ability to inline file with "?inline" It can also be used to obtain js classic from js module with "?as_js_classic&inline"
- Add importMap to Node.js runtimeParams (both child process and worker thread) Allow to redirect import to other files during tests (mocking)
- Muliple
--require=
and--experimental-loader=
passed to commandLineOptions are now preserved (Before the last one wins) - Prevent generating trailing comma on dynamic import during import assertion transpilation
- Better indentation in html generated during dev and build
- Internal dev experience improvements on file/directory snapshots
- Update deps
- "?as_js_classic" renamed "?js_module_fallback"
- Introduce @jsenv/plugin-as-js-classic
- Remove dependency between @jsenv/core and @jsenv/plugin-bundling
- Fix resource hint warning when transpiling to systemjs
- Fix error 500 when url not in url graph is modified
- Update coverage behaviour
- Instrument only _.js, _.jsx, _.ts, _.tsx
- Move istanbul instrumentation from jsenv dev server to a playwright middleware
- Make fallback on istanbul for coverage more explicit in the code
- Remove first line break from logs during test execution
- Update deps
- Test execution becomes compatible with any web server
- Remove devServerOrigin, devServerModuleUrl
- Introduce webServer: { origin, rootDirectoryUrl, moduleUrl }
- Exclude some files from test plan by default
- File inside node modules
- File inside directory starting with a dot (like ".git/")
- Update test execution logs
- Less line breaks when completedExecutionAbbreviation is enabled
- Pad execution number with 0 like "execution 01 of 10" instead of "execution 1 of 10"
- Add edge and firefox version supporting
import.meta.resolve
- Add safari version supporting import maps
- Change how server are stopped after test plan is done
- testDirectoryUrl -> rootDirectoryUrl
- Ensure web worker urls type is correct during dev
- This fix ensure node resolution also on
self.importScripts
- This fix ensure node resolution also on
- Give a better name to jsenv dist file ("jsenv.js" instead of "main.js")
- Enable node esm resolution by default on
self.importScripts
- Allow filesystem magic resolution only while resolving js imports
- outDirectoryUrl becomes optional
- directoryReferenceAllowed param can now be a function
- Improve error when directory is referenced
- Fix error logged while handling existing sourcemap
- Dev server is now designed to run on a directory containing only source files It's still possible to start dev server in a directory containing files that are not meant to be executed in the browser but this is no longer the recommended way to use it
- Update startDevServer params
- rootDirectoryUrl -> sourceDirectoryUrl
- clientMainFileUrl -> sourceMainFilePath
- Update build params
- rootDirectoryUrl -> sourceDirectoryUrl
- Update startBuildServer params
- buildIndexPath -> buildMainFilePath
- Update executeTestPlan params
- rootDirectoryUrl -> testDirectoryUrl
- Introduce devServerModuleUrl
- executeTestPlan is now able to start dev server
- executeTestPlan enforce testDirectoryUrl to be inside the sourceDirectoryUrl passed to dev server when tests are executed on browsers
- Use node 19
- Ensure webmanifest url is coherent during dev/build
- Code can use
__DEV__
and__BUILD__
to know if code is executed during dev or after build This is complementary toimport.meta.dev/build
for js_classic and workers - Fix urls not versioned when minification + vendors chunk is used
- Fix crash on failed test execution
- Params check on startBuildServer
- Major update on dependencies
- Update how to start dev server in https
- More validation on public function params (type errors thrown on unexpected params)
- "errored" execution status becomes "failed"
@jsenv/core
- Dev server properly invalidate cache of files that are not watched
- browser version now read from playwright after first run
- Rename globals injected into service worker during build from
serviceWorkerUrls
toresourcesFromJsenvBuild
- Fix dev server crach during url inference on circular dependency
- Add cacheControl param to dev server (can be used to disable cache control headers on dev server)
@jsenv/pwa
- Move into this monorepo
- Split
@jsenv/pwa
into@jsenv/pwa
+@jsenv/service-worker
- Write automated tests around service worker and build
@jsenv/pwa
full revamp of service worker part
@jsenv/eslint-import-resolver
- improve logs when resolution fails
@jsenv/sigi
- add this new package in the monorepo
- Ensure build produce "\n" line breaks on windows by default
- Prevent file path influence on variable names generated for systemjs during build. This issue was mitigate by minification but now it won't be a problem anymore, even with minification disabled.
- Gracefully handle css syntax error inside
<style>
. Thanks to this dev server properly autoreload even when there is a syntax error in css within html.
- Ensure inline content static analysis works in a corner case (transpilation to systemjs + minification without bundling)
- Update deps
- Preserve conditions in CSS imports
- Update @jsenv/ast
- Use importmap or systemjs to prevent hash cascading #341
- Use lightningcss insteaf of postcss to bundle css
- Replace "parcel/css" with "lightningcss"
- Update dependencies
- Update all dependencies
- Properly handle file and directory containing url special characters (such as spaces)
-
Bundling moves to a plugin
bundling
param is gone, a plugin must be used instead as shown in code below.import { build} from "@jsenv/core" + import { jsenvPluginBundling } from "@jsenv/plugin-bundling" build({ - bundling: { js_module: true } + plugins: [jsenvPluginBundling({ js_module: true })] })
Bundling becomes opt-in enabling more modularity per project and ability to test other bundlers than rollup in the future.
-
Minification moves to a plugin
minification
param is gone, a plugin must be used instead as shown in code below.import { build} from "@jsenv/core" + import { jsenvPluginMinification } from "@jsenv/plugin-minification" build({ - minification: { js_module: true } + plugins: [jsenvPluginMinification({ js_module: true })] })
Minification becomes opt-in enabling more modularity per project and ability to test other minifiers in the future.
-
Small changes on
buildFileContents
andbuildInlineContents
returned bybuild
- Keys are sorted
?as_js_classic
is removed from values when used
- Update NPM dependencies
- Add ability to resolve symlinks with
urlResolution.node_esm
startDevServer({ urlResolution: { node_esm: { preservesSymlink: false, }, }, });
- Preserve symlinks by default during node esm resolution
- Ensure css and js is bundled when referenced by html itself referenced by js
- Prepare things for @jsenv/plugin-toolbar
- Update deps
- Update deps
- Update playwright (and ESLint)
- Ensure ?js_classic applies on import.meta.resolve
- Preserve search params during node esm resolution
- Update deps
- Support import.meta.resolve during dev and build
- Add "?as_js_module" to be able to import js using top level this
- Ignore plugin when plugin.init returns false
- Export jsenvPluginPlaceholders
- Fix error introduced in 29.6.0 on dev server
- Propagate resource hint on files injected during build
- build.baseUrl becomes build.base
- introduce build.assetsDirectory
- build.buildDirectoryClean renamed directoryToClean
- fix new URL() usage for ?as_js_classic_library
- enable ribbon by default during dev
- fix url versioning during build
- preserve crossorigin on preload links during build
- Prevent versioning during dev on symlinked node modules
- Ensure system.import always return a promise
- build server sends "/index.html" when requested at "/" if file exists. This is configurable with buildIndexPath. When the file at buildIndexPath do not exists build server returns directory content.
- Fix error when building multiple js classic library files
- Add ribbon param to startDevServer
- Update deps
- Update rollup to 3.1.0
- Do not throw when source code use new Blob() without argument
- Pass (urlInfo, context) to jsenvPluginGlobals
- Add "findDependent(urlInfo, callback)" to context.urlGraph
- Update s.js to fix a bug on concurrent async execution
- Same as previous on cache-control:no-cache
- Do not send eTag when a plugin set cache-control:no-store
- Fix a bug when node imports subpath resolution is involved
- Gracefully handle syntax error occuring inside "as_js_classic_library"
- Better handling of 404 inside "as_js_classic_library"
- Prevent duplicate files when file referenced by new URL() + dynamic import
- Fix new URL() update during js classic conversion
- Properly handle unicode character during file url matching and logging
- Fix dev server crashing when file is renamed
- Fix s.js.map not found during dev
- Ensure new URL() on js is updated too during js classic conversion
- Preserve resource hints targeting js imported dynamically
- Prefer injecting script after resource hints when possible
- update playwright and other deps
- fix parse error crashing dev server
- fix node_esm applied for script type module in html
- fix preact-debug injection
- fix sourcemap resolution inside js modules
- allow plugins to set error.asResponse to control server response for that error
- log only one url for dev server when hostname is passed
- urlResolution now applies on url type not reference type (js urls have node esm by default too)
- update @jsenv/server to give more info on ERR_INVALID_CHAR
- breaking change: introduce urlResolution
- replace nodeEsmResolution
- new way to disable node esm resolution visible here https://github.com/jsenv/core/pull/309/files#diff-f1264f171aeba6139f3338d6682b28e466ef796ab84760d608ed8c69b3d80073R34-R36
- breaking change: rename fileSystemMagicResolution in fileSystemMagicRedirection
- fix explorer.html not served anymore after sarting dev server
- add clientMainFileUrl to startDevServer, can be used to send a custom html file instead of jsenv explorer.html
- fix dev server crashing on some parsing errors
- explorer.html is now cooked (goes through plugins pipe) like everything else
- fix error when css contains @import
- s.js is now injected inline in html
- prevent error from supervisor when error.stack is undefined
- prevent facade file during build by default, add
bundling.js_modules.strictExports
to configure that
- fix 28.4.0 not updating
@jsenv/ast
- handle
window.location
in new URL() second arg
- update dependencies
- fix hotreload on preact/react when dev server is not in https (http)
- reload and invalidate once for import assertions
- fix autoreload when inline script changes in an html file using search params
- updating files update all urls using search params too
- ensure inline script are properly updated on reload
- fix a warning logger by server on 304
- fix a bug keeping sourcemap when marked as broken by preact/react refresh
- prevent error when sourcemap is returned by a plugin for an html file
- ensure content-length is overrided when plugin set custom response headers
- Export "replacePlaceHolders"
- Fix dist/s.js sourcemap comment
- Fix as_js_classic_library build error when babel helpers are used
- fix build using "?as_js_classic_library" in entry points
- auto update "create-jsenv" when "@jsenv/core" version is updated
- add "?as_js_classic_library" to consume js modules with a regular script tag
- it is now possible to use the following query params in source files:
- "?as_js_classic"
- "?as_json_module"
- "?as_css_module"
- "?as_text_module"
- "?as_js_classic_library"
- Create a relationship with source file when a file is referenced with a query params from the list above (means hot reload and cache invalidation work as expect)
- preserve preload links when css becomes js
- update @jsenv/log to add logger.level
- improve build debug logs
- auto removal of preload link is now a "info" log instead of "warning" when it happens because file is bundled
- use same transpilation levels between main thread and workers in case some code is shared
- fix sourcemap source ENOENT on chrome
- reference.searchParams is now available during "redirectUrl" hook
- rework "as js classic" set of plugins to split how and when the query params are handled and the conversion is done
- fix error handling when runtine.run throw
- update how script execution is awaited by document supervisor
- fix script execution order in html
- htmlSupervisor renamed supervisor
- allow multiple errors during execution
- update how error are logged during tests
- display error overlay on unhandled rejection
- add logRefresh to executeTestPlan
- add more stories in dev errors
- update @jsenv/assert output
- fix worker type module on firefox during dev
- fix data url handling during dev
- fix collectFiles in @jsenv/filesystem when path contains special chars
- stop generating coverage for this repository (I am not using this anymore it's a waste of ressources to compute it)
- prefer "ws.js" over "wrapper.js" when generating build files
- prefer "resource" over "ressource" in names
- tests now executed on the dev server
- dev server must be started before executing tests
- add new public export: "pingServer"
- update test scripts in jsenv demos
- rename "host" into "hostname" for startDevServer
- fix websocket connection on https
- update plugin.appliesDuring and context.scenarios
- when appliesDuring is "dev" plugin applies during dev+test
- when appliesDuring is {dev: true, test: false} plugins applies only during dev
- use websocket to communicate between jsenv dev server and clients
- update playwright
- code frame show source code frame also in firefox/webkit for runtime errors
- use sourcemap-js instead of source-map
- add code frame in error overlay for fetch/parse/execute errors
- generate error overlay screenshots for firefox and webkit too
- fix cannot fetch file: on sourcemap in Firefox and webkit
- use a more resilient logic to choose between browser and server error
- display correct url:line:column for inline scripts
- use snapshot to test dev server errors + screenshots
- add code frame for runtime errors and syntax errors (error reported by browser)
- add host to startDevServer
- add htmlSupervisor.errorOverlay parameters
- add "reported by browser/server ..." at the bottom of error overlay
- close error overlay on hot reload
- prevent server errors from displaying overlay on unrelated pages or once execution is done
- fix hot reload for script using
hot-accept
attribute - handle type="text/jsx" and type="module/jsx" on script tags (same for ts)
- add warnings when plugin contains unexpected properties
- fix server host resolution for node 18+
- add htmlSupervisor.openInEditor
- css import assertion + hot reload works in firefox
- fix infinite reloading when code using import assertion is executed at the same time in firefox and chrome
- rename explorerGroups into explorer.groups (gives ability to disable explorer)
- allow any preact/react version in peerDependencies
- update dependencies
- feature: click on error overlay now open in editor
- feature: improve error trace for inline scripts and syntax errors
- fix: use custom elements to render error overlay (prevent conflicts)
- fix: ignore "file:///" when used as second argument in new URL
- fix: invalidate HTML inline contents when it changes
- fix: remove redundant abort error from test plan logs
- coverageMethodForNodeJs default value becomes "Profiler"
- Use "localhost" only if their is a mapping to 127.0.0.1 on the OS
- Consume stdout before terminating node worker thread
- Update node to 18.5.0 to get https://github.com/nodejs/node/commit/0fc1cf478f7a448241791f5cf2c25f2d45bfd5b5
- Rename nodeProcess to nodeChildProcess
- Add nodeWorkerThread
- Rename executeTestPlan.coverage to executeTestPlan.coverageEnabled
- When coverage is enabled, process.env.NODE_V8_COVERAGE must be set otherwise a warning is logged
- Add console repartition in logs (see #224)
- Disable sourcemap for preact-refresh and react-refresh
Add CHANGELOG.md