-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Fix tests in IE11 #3264
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix tests in IE11 #3264
Conversation
@developit Executing tests locally prints the following warnings: marvinhagemeister ~/dev/github/preact (tests-fix-ie11*) $ yarn test:karma:watch
yarn run v1.22.11
$ cross-env BABEL_NO_MODULES=true karma start karma.conf.js --no-single-run
15 09 2021 22:14:10.573:INFO [esbuild]: Compiling...
> node_modules/chai/index.mjs:3:7: error: Transforming const to the configured target environment ("es5") is not supported yet
3 │ export const expect = chai.expect;
╵ ~~~~~
> node_modules/chai/index.mjs:4:7: error: Transforming const to the configured target environment ("es5") is not supported yet
4 │ export const version = chai.version;
╵ ~~~~~ Maybe we need to downtranspile |
📊 Tachometer Benchmark ResultsSummaryduration
usedJSHeapSize
Results02_replace1k
duration
usedJSHeapSize
run-warmup-0
run-warmup-1
run-warmup-2
run-warmup-3
run-warmup-4
run-final
03_update10th1k_x16
duration
usedJSHeapSize
07_create10k
duration
usedJSHeapSize
filter_list
duration
usedJSHeapSize
hydrate1k
duration
usedJSHeapSize
many_updates
duration
usedJSHeapSize
text_update
duration
usedJSHeapSize
|
Size Change: +19 B (0%) Total Size: 42 kB
ℹ️ View Unchanged
|
@@ -326,7 +342,7 @@ module.exports = function(config) { | |||
singleBundle: false, | |||
|
|||
// esbuild options | |||
target: 'es2015', | |||
target: 'es5', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This no longer complains about const
because it is being fed var
(due to Babel running on all JS files). Setting it to es5
here just prevents ESbuild from generating ES2015 glue code (for module bindings etc).
@@ -433,7 +433,9 @@ function diffElementNodes( | |||
// despite the attribute not being present. When the attribute | |||
// is missing the progress bar is treated as indeterminate. | |||
// To fix that we'll always update it when it is 0 for progress elements | |||
(i !== dom.value || (nodeType === 'progress' && !i)) | |||
(i !== oldProps.value || |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This fixes a bug in IE11 where we never apply the value prop for <option value="X">X<option>
. In that browser, option.value
is X
as inferred from the option's text content, however inferred option values can't be selected via select.value
, so we need to assign to it manually.
This also fixes a potential issue where the text content of an <option>
is initially some value, but then later changes - if we skip assigning option.value
, the value-to-text binding remains live instead of being correctly locked to the value
prop from VDOM.
This fixes an issue I introduced in #3264.
This fixes an issue I introduced in #3264.
No description provided.