Open sequba opened 4 months ago
testName | base | head | change
------------------------------------------------------------------------
Sheet A | 529.16 | 530.87 | +0.32%
Sheet B | 171.97 | 170.4 | -0.91%
Sheet T | 151.62 | 149.56 | -1.36%
Column ranges | 548.74 | 546.6 | -0.39%
Sheet A: change value, add/remove row/column | 14.76 | 13.82 | -6.37%
Sheet B: change value, add/remove row/column | 130.26 | 133.98 | +2.86%
Column ranges - add column | 157.07 | 153.52 | -2.26%
Column ranges - without batch | 465.62 | 455.73 | -2.12%
Column ranges - batch | 121.1 | 119.48 | -1.34%
- Webpack4 ^4.42.0 - I getting an error. Seems the webpack has the problem with importing values from "chevrotain".
// /node_modules/hyperformula/es/parser/FormulaParser.mjs import { EmbeddedActionsParser, EMPTY_ALT, Lexer, tokenMatcher } from 'chevrotain'; // EmbeddedActionsParser, EMPTY_ALT and others are missing
ERROR in ./node_modules/hyperformula/es/parser/FormulaParser.mjs 689:125-137 Can't import the named export 'tokenMatcher' from non EcmaScript module (only default export is available) @ ./node_modules/hyperformula/es/parser/index.mjs @ ./node_modules/hyperformula/es/ArraySize.mjs @ ./node_modules/hyperformula/es/index.mjs @ ./src/index.js ERROR in ./node_modules/hyperformula/es/parser/FormulaParser.mjs 708:29-41 Can't import the named export 'tokenMatcher' from non EcmaScript module (only default export is available) @ ./node_modules/hyperformula/es/parser/index.mjs @ ./node_modules/hyperformula/es/ArraySize.mjs @ ./node_modules/hyperformula/es/index.mjs @ ./src/index.js
I found out that webpack 4 does not support exports, and there seems to be no easy workaround for that. By tweaking the webpack configuration, I managed to make the project import HyperFormula correctly using the legacy paths. Working demo.
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 97.36%. Comparing base (
e32e132
) to head (0cd4e05
).
I have retested all the demos available on https://github.com/handsontable/hyperformula-demos/tree/import-demos
plus the bundlers mentioned by @budnix getting the same results.
On top of the above I have tested:
"module": "node16",
"moduleResolution": "node16",
Error: Language already registered.
at HyperFormula.registerLanguage (/Users/magierg/repos/hyperformula-demos/svelte-demo/node_modules/hyperformula/commonjs/HyperFormula.js:287:13)
at Hyperformula.svelte:18:15
at Object.$$render (/node_modules/svelte/internal/index.mjs:1892:22)
at eval (/src/routes/+page.svelte:24:148)
at Object.$$render (/node_modules/svelte/internal/index.mjs:1892:22)
at Object.default (root.svelte:41:38)
at eval (/node_modules/@sveltejs/kit/src/runtime/components/layout.svelte:8:41)
at Object.$$render (/node_modules/svelte/internal/index.mjs:1892:22)
at root.svelte:40:37
at $$render (/node_modules/svelte/internal/index.mjs:1892:22)
TODO: verify it with the code example in issue https://github.com/handsontable/hyperformula/issues/1143
Svelte 3.5.4 + vite 4 - getting this error - might be user error - @sequba to investigate
It works correctly. The issue you reported was caused by running the setup code twice. I created a demo for svelte: https://github.com/handsontable/hyperformula-demos/tree/import-demos/import-demo-esm-svelte
Angular case is still to be verified.
Context
.mjs
extensions and adjust the import and export statements in the output (custom babel plugin)exports
property topackage.json
that lists all valid ways of importing HyperFormulaBreaking change
This will be a breaking change for devs that use Webpack 3 or Parcel. They need to adjust their config and/or update the bundler.
TODO
How did you test your changes?
Tested importing HF in scenarios:
mjs
files"moduleResolution": "node16"
intsconfig
)Demo projects are available in the hyperformula-demos repo.
Tested by @budnix:
Types of changes
Related issues:
Fixes #1344
Checklist: