# Changelog

## v4.0.0

Faster builds: Rollup 4 and SWC replace Rollup 2, Babel, rollup-plugin-typescript2 and Terser.

Breaking:

- Requires Node.js 18+.
- `.babelrc`/`babel.config.*` no longer affect the build.
- No core-js is bundled any more. 3.x replaced the built-ins Babel 7.9 knew about (`Promise`, `Map`, `Array.from`, `includes`, ...) with module-local core-js-pure copies; 4.0 uses the browser's built-ins and compiles all files to ES2020. Mashups that need an API newer than the browsers they run in must import a polyfill themselves (e.g. `import 'core-js/actual/set'`).
- `configTransform` receives a Rollup 4 config; transforms using Rollup 2 plugin APIs may need updating. Webpack config transforms (file name containing `webpack`) are ignored with a warning.
- `postcss-icss-keyframes`, `postcss-icss-values` (unused by create-mashup-app) and `@targetprocess/icons` are no longer installed with create-mashup-app; mashups that require them must declare them. `postcss-global-import`, `postcss-current-selector`, `postcss-color-function` and `postcss-inherit` are replaced by PostCSS 8 ports; configs requiring them by name keep working (see README, `create-mashup-app/postcss-plugins`).

Security (dependencies with known vulnerabilities removed or upgraded):

- `generate` no longer uses yeoman (`yeoman-environment` 2 / `yeoman-generator` 4 and their dependencies such as axios 0.21, ejs 2, set-getter, got, tmp, micromatch 3); it uses `prompts` and `ejs` 7 and produces the same files.
- PostCSS 8 ports of `postcss-global-import`, `postcss-current-selector`, `postcss-color-function` and `postcss-inherit` (same output, verified against the originals) replace the PostCSS 5/6 packages; `color()` uses `color-convert`/`color-string` 1.x instead of `color` 0.11 / `color-string` 0.3.
- `express` 4.17 -> 4.22.3, `cosmiconfig` 5 -> 9.0.2 (still searches up to the home directory), lockfile refreshed within the existing ranges.
- `rollup-plugin-postcss` 4.0.2 (unmaintained, pulls cssnano 5 with vulnerable `postcss-selector-parser` 6) is replaced by an in-repo port without the unused `minimize`/`extract` options (`src/plugins/postcssPlugin.js`); consumers' output is the same apart from minified identifier names in work-sharing-ui. Config transforms that `require('rollup-plugin-postcss')` without declaring it get the port.
- Dev: `eslint` 7 -> 8.57.1; Jest 23 -> Vitest 4.1.11 + jsdom 27 for create-mashup-app's own tests (Jest's coverage instrumentation pulled `js-yaml` 3 / `argparse` 1 / vulnerable `sprintf-js`); `eslint-plugin-jest` removed. Developing create-mashup-app needs Node 20+; the package itself still supports Node 18.
- `devServer` allows cross-origin requests only from Targetprocess accounts (`*.tpondemand.com`, `*.tpondemand.net`), `tplocal.com` and localhost, plus origins given with the new `--allowed-origin` option (3.x allowed any origin).
- `@swc/core` is pinned to 1.16.2, the last stable release with a plain native addon. From 1.16.12 on, the native package is a zstd-compressed "carrier" unpacked into the user cache (`XDG_CACHE_HOME` or `~/.cache`) on first load; loading fails when a parent of that directory is writable by another user without sticky protection, as on our GitHub runners. The location can be changed with `SWC_NATIVE_BINDING_CACHE`. Revisit when the check can be satisfied there.
- Remaining: `deepmerge` 4.3.1 (latest; CVE-2026-93753) via `@rollup/plugin-node-resolve`, which only merges its own constant defaults with it.

Changes:

- TypeScript is type-checked in a worker thread with the project's own `typescript` and `tsconfig.json` (with the defaults 3.x passed to rpt2); type errors fail the build. New `--no-typecheck` flag for `build` and `devServer`. In `devServer`, every rebuild checks all bundled TypeScript files, so a change that breaks an unchanged file is reported.
- Project `.js`/`.jsx` files are compiled with SWC's JavaScript parser, `.ts`/`.tsx` with the TypeScript parser (as Babel and rpt2 did in 3.x). With the TypeScript parser, JS imports whose bindings are unused were dropped, together with their side effects (mashup-manager lost its template registration).
- Imports of names a module doesn't export: a warning when unused, a build error when used - as in 3.x (Rollup 2); TypeScript type-only exports are not reported. (`4.0.0-ci.2` and earlier failed the build for every such import.)
- `build <dir>`/`devServer <dir>` accept a relative directory (3.x failed to load its `package.json`).
- Global names (`window.__<name><version>_<suffix>`) use a hash of the output instead of a random suffix, so the same source gives byte-identical files.
- Sourcemaps map to the original sources; `sourceMappingURL` is at the end of the entry file.
- `mashup.json` is found as mashup config again (0.x used it; 2.x/3.x didn't look for it).
- `.ts`/`.tsx` sources inside `node_modules` are compiled (as with rpt2).
- Module resolution matches 3.x: package.json `browser` field mappings are applied (e.g. `false` for Node-only files), and imports from TypeScript files fall back to TypeScript's own resolution like rpt2 did (e.g. source subpaths not listed in a package's `exports`).
- `build --no-dependency-replace` works (the flag was ignored before).
- The entry module always stays in the entry file (`index.js`/`mashupEntryFileName`), also when lazy chunks import from it.
- Module execution order for `require()` of ES modules from mixed modules matches 3.x (fixes evaluation errors in import cycles, e.g. react-virtualized/dist/es).
- `plugins.each` in `create-mashup-app/postcss-plugins` expands all `@each` loops before the other plugins run, like the default config, so `@each $var` works together with `plugins.simpleVars()`.
- `postcss-current-selector` port: `%@` inside an at-rule (e.g. `@media` in a rule) gets the enclosing rule's selector, and a second `%@` in a value is left as is; the original turned both into `undefined`.
- `build`/`devServer` write to `<dir>/dist` by default also when `<dir>` is not the working directory (before: `./dist` of the working directory, which v4 rejected).
- `generate` fails with the actual error when `npm install` can't be started (e.g. npm not on PATH) instead of reporting success.
- `chunkInfo.modules` is still available to `entryFileNames`/`chunkFileNames` functions from config transforms.
- Modules (`addModule`) return all exports of the entry module together with `initialize` (2.x returned the exports, 3.x only `initialize`), so modules written for either version keep working.
- Mashups configured for webpack-based 0.x (`mashup.json` or a webpack config transform) are still written to `dist/mashup.js`, where they are deployed and loaded from.
- `process.env.NODE_ENV` is also replaced when followed by a member access (e.g. `process.env.NODE_ENV.toLowerCase()`), as in 3.x.
- Mashups configured for webpack-based 0.x get `process.env.NAME` reads replaced as webpack did: names listed in the new `processEnv` mashup config option get their build-time value, all others `undefined`; before, they threw "process is not defined" in the browser.
- TypeScript deprecation warnings caused by the forced `moduleResolution` (TS5101/TS5107) are not reported.
- `generate` templates (React, TypeScript + React): tests run on Jest 30 with jsdom and `@swc/jest`, and use React Testing Library instead of Enzyme (unmaintained, no official adapter for React 17+); `react`/`react-dom` 16.14 (the versions Targetprocess provides) and `@types/react-dom` are listed explicitly. The generator no longer installs a second, conflicting set of dev dependencies after the template's own, so `npm install` succeeds. The React template's jest config and example test were broken and are fixed. Their `@swc/core` is the version create-mashup-app pins, so generated projects install a single copy (a different one at the root would be hoisted and used for the build as well).

## v3.1.0

- Add possibility to override configuration of `rollup-plugin-includepaths` plugin in mashup's config

## v3.0.0-alpha.1

- Rewrite async chunks loader to allow code splitting and to provide APIs that can depend on Targetprocess APIs
- Upgrade to rollup 2.35.1
- Upgrade to PostCSS 8.2.2
- Add possibility to override generated entry mashup file name (`mashupEntryFileName` in mashup's config)
- Change precedence of `basePath` from mashup's config over default one
- Set browser list to last 2 versions of Safari, Chrome and Firefox by default
- Add stacktrace to error messages

## v2.10.0

- Fix code splitting, use tau.mashups.resolveIntegrationUrl for chunk URL resolution, if available.

## v2.9.0

- Allow to specify public api again

## v2.8.0

- Never serve obsolete/erroneous assets (wait until build completion);
- Export build error (just in case) into console for developer care.

## v2.7.0

- Update `@babel/core` to 7.9.0
- Use `corejs` instead of `@babel/polyfill`

## v2.6.0

- Add `basePath` parameter to build command

## v2.5.0

- Specify `targets` for `babel-preset-env` to avoid including excessive number of polyfills.

## v2.2.5

- [[!7](https://gitlab.tpondemand.net/frontend/create-mashup-app/merge_requests/7)] Allow to use SemVer characters in version field in package.json

## v2.2.4

- [[!6](https://gitlab.tpondemand.net/frontend/create-mashup-app/merge_requests/6)] Fix typescript template
- [[!6](https://gitlab.tpondemand.net/frontend/create-mashup-app/merge_requests/6)] `name` property in mashup config can now contain spaces and dashes

## v.2.2.3

- [[!5](https://gitlab.tpondemand.net/frontend/create-mashup-app/merge_requests/5)] Fix incorrect importing of `.json` files.

## v2.2.2

- [[!4](https://gitlab.tpondemand.net/frontend/create-mashup-app/merge_requests/4)] Fix incorrect sourcemap generation. Previously source map file incorrectly contained `[object Object]` regardless of the actual sourcemap code.

## v2.2.1

- Fix polyfillable method replacement with `@babel/preset-env` (things like `Object.assign`, `Array.prototype.find`, etc.) - wasn't working in IE11.

## v2.2.0

- Add `cssVariables` property support to mashup config to provide custom PostCSS variables.

## v2.1.1

- Fix typescript bundling - previously typescript code was only processed by typescript plugin, which produced ES6 code, but not picked up by babel for further ES6 -> ES5 processing.

## v2.1.0

- Fix bundling issues with typescript, migrated to `rollup-plugin-typescript2` which would allow to do a build-time type check, since regular typescript plugin relies on babel typescript preset and doesn't support typechecking.

## v2.0.4

- Add support for `process.env.NODE_ENV` replacement based on `--minify` flag (replaced with `"production"` if minify is passed and with `"development"` otherwise).

## v2.0.3

- Fix `node_modules` resolution based on `package.json` `"main"` and `"module"` fields.

## v2.0.0

- rewritten from scratch to use rollup instead of webpack
- add mashup rollup plugin that handles code splitting, injects minimalistic chunk loader, and manages TP dependency sharing between separate chunks
- typescript now works out of the box
- use cosmiconfig for mashup configuration instead of relying on `mashup.json` file being present

### Breaking changes

- configuration is now handled by cosmiconfig; as such, `mashup.json` is no longer valid config file name.
- rollup is now used internally, so your existing webpack config transform won't work.

### Migration guide

- rename your `mashup.json` to `.mashuprc` or `.mashuprc.json`, or inline it under `"mashup"` key in your `package.json`.
- if you have any custom transform function, they will most likely not work, because they assume webpack configuration. 2.0 is written in rollup, so you'll need to update your custom transform. Ideally, the issue you were trying to fix with this transform is no longer present, and you don't need it at all.
- make sure both build and dev server work for you and produce correct output.
- if you use code splitting, verify that all chunks are handled correctly; you'll need to provde `--baseUrl` when using `build` to specify where your chunks reside.
