Skip to content

Include third-party license notices in the dist bundles - #1928

Merged
sequba merged 2 commits into
release/4.0.0from
fix/dist-third-party-notices
Nov 26, 2026
Merged

sequba merged 2 commits into
release/4.0.0from
fix/dist-third-party-notices

Conversation

@sequba

@sequba sequba commented Nov 26, 2026

Copy link
Copy Markdown
Contributor

Context

The dist/ bundles contain code from npm packages whose licenses require their notice in every copy:

Package License In which bundles
core-js 3.51.0 MIT all (Babel's useBuiltIns: 'usage' polyfills)
webpack 4.47.0 MIT all (webpack/buildin module shims)
chevrotain 6.5.0 Apache-2.0 .full bundles
regexp-to-ast 0.4.0 MIT .full bundles
tiny-emitter 2.1.0 MIT .full bundles

Until now, the banner held only HyperFormula's own LICENSE.txt. A bundle loaded on its own, for example from a CDN, carried none of these notices. People who install from npm get the packages' own LICENSE files in node_modules, but the bundles don't. The vendored bessel and jStat code already keeps its @license header.

The BannerPlugin in .config/webpack/base.js now takes a function. For each chunk, it collects the npm packages its modules come from and appends each package's name, version, license and license file text. They're read from the installed package at build time, so a new or updated dependency is covered without a code change. A bundled package without a license file fails the build instead of shipping without a notice.

Alternative rejected: a hand-written list of notices, which falls out of date when a dependency changes. A plugin such as license-webpack-plugin would add a dependency for about 60 lines of code.

hyperformula/dev-docs/BUILD.md gets a section on the banner, including the constraint that script/check-file.js expects exactly two @license comments per bundle.

How did you test your changes?

  • I built development and production with webpack ./lib/index.js --output-path <scratch> (same env as bundle:development / bundle:production). Each banner lists core-js and webpack, and the .full banners also list chevrotain, regexp-to-ast and tiny-emitter. The .min.js files keep the banner, because it's a /*! comment.
  • node script/check-file.js passes for all four bundles. The base bundles were run with NODE_PATH set to the repo's node_modules, because chevrotain is external and the scratch folder can't resolve it. The check runs the engine and asserts two @license comments.
  • karma start --browsers ChromeHeadless (the browser suite builds with this config): 16,255 passed, 49 skipped. Firefox can't start in my local environment, so I didn't run it.

No paired branch in hyperformula-tests: no test change.

AI assistance

Claude Code audited the shipped licenses and wrote the change, the dev-docs section and this description.

Compatibility with Excel and Google Sheets

Not applicable.

Public API changes

None.

Out of scope and follow-ups

  • The hyperformula-ui bundle wasn't audited for notices. It is MIT-licensed and has no runtime dependencies.
  • The languages/ bundles don't use this banner. They contain no npm package code.

Types of changes

  • Breaking change (existing functionality no longer works as before) – agreed with the maintainers
  • New feature or improvement (a non-breaking change that adds functionality)
  • Bug fix (a non-breaking change that fixes an issue)
  • Additional language file, or a change to an existing language file (translations)
  • Change to the documentation

Related issues

None.

Checklist

🤖 Generated with Claude Code

sequba and others added 2 commits November 26, 2026 16:03
The dist bundles inline npm packages under MIT and Apache-2.0: core-js
polyfills and webpack's module shims in every bundle, and chevrotain,
regexp-to-ast and tiny-emitter in the .full bundles. Both licenses
require the notice in every copy, and a bundle is also used on its own,
without the packages' own files. The banner now appends each bundled
package's name, version and license file, read from the installed
package at build time. A bundled package without a license file fails
the build.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@sequba
sequba merged commit 0840cf4 into release/4.0.0 Nov 26, 2026
27 of 29 checks passed
@sequba
sequba deleted the fix/dist-third-party-notices branch November 26, 2026 15:05
@sequba
sequba restored the fix/dist-third-party-notices branch November 26, 2026 15:14
@github-actions

github-actions Bot commented Nov 26, 2026 •

Copy link
Copy Markdown

Performance comparison of head (768eaca) vs base (baa6557)

                                     testName |    base |    head |  change
---------------------------------------------------------------------------
                                      Sheet A |  337.92 |  336.33 |  -0.47%
                                      Sheet B |  103.54 |  110.01 |  +6.25%
                                      Sheet T |   92.57 |   97.66 |  +5.50%
                                Column ranges |  465.85 |  465.15 |  -0.15%
                                Sorted lookup | 14940.9 | 14574.6 |  -2.45%
Sheet A:  change value, add/remove row/column |   10.48 |   10.62 |  +1.34%
 Sheet B: change value, add/remove row/column |    97.2 |   95.31 |  -1.94%
                   Column ranges - add column |  100.74 |  110.82 | +10.01%
                Column ranges - without batch |  343.02 |  359.13 |  +4.70%
                        Column ranges - batch |   89.28 |   85.35 |  -4.40%

@sequba sequba mentioned this pull request Nov 26, 2026
7 of 12 tasks
sequba added a commit that referenced this pull request Nov 26, 2026
### Context
The 4.0.0 section had several entries per change and entries for
internal changes. This PR cuts it from 54 entries to 47.

Merged:
- The license change (#1885) and the invalid `gpl-v3` key (#1905) are
now one breaking-change entry.
- The four `TEXT` mask entries (#1716) are now two short ones: one for
`TEXT`, one for `stringifyDateTime` and `stringifyDuration`. The details
stay in the migration guide.
- The `maxParserCacheSize` option and the parser cache growth fix
(#1635) are now one entry under Added.

Removed, because they aren't changes users act on:
- The license check skip on handsontable.com (#1905).
- The new license console messages (#1905).
- The third-party license notices in the bundles (#1928).

### How did you test your changes?
I read the rendered section. Every remaining entry keeps its link.

### AI assistance
Claude Code made the edits, as the maintainer directed, and wrote this
description.

### Compatibility with Excel and Google Sheets
Not applicable.

### Public API changes
None.

### Out of scope and follow-ups
None.

### Types of changes
- [ ] Breaking change (existing functionality no longer works as before)
– agreed with the maintainers
- [ ] New feature or improvement (a non-breaking change that adds
functionality)
- [ ] Bug fix (a non-breaking change that fixes an issue)
- [ ] Additional language file, or a change to an existing language file
(translations)
- [x] Change to the documentation

### Related issues
None.

### Checklist
- [x] My pull request meets the [Definition of
Done](https://github.com/handsontable/hyperformula/blob/develop/dev-docs/DEFINITION-OF-DONE.md).
External contributors: see also [Contributing to
HyperFormula](https://handsontable.com/docs/hyperformula/guide/contributing.html).
- [x] I have signed the [Contributor License
Agreement](https://goo.gl/forms/yuutGuN0RjsikVpM2).
- [x] I read my own diff end to end before requesting a review.
- [x] I added a
[CHANGELOG.md](https://github.com/handsontable/hyperformula/blob/develop/CHANGELOG.md)
entry, written by [the changelog
rules](https://github.com/handsontable/hyperformula/blob/develop/dev-docs/DOC-STANDARDS.md#the-changelog)
– or none is needed (docs, tests or tooling only).
- [x] I updated the documentation and JSDoc to match the change.
- [ ] Breaking change only: I added a section to the migration guide.
- [x] I updated the `dev-docs/` pages this change affects – or none
needed it.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant