Skip to content
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

Download Builder emits jQuery-UI 1.13.3 custom causing Syntax error in MS WebBrowser control (IE11 mode) #629

Closed
mlisowsk opened this issue Feb 26, 2025 · 7 comments · Fixed by #630
Assignees

Comments

@mlisowsk
Copy link

For custom jQuery-UI 13.3.3 packages generated by the Download Builder:

The minified jquery-ui.min.js throws a Syntax error in line 6 when used in the Microsoft WebBrowser control which is based on IE https://learn.microsoft.com/en-us/dotnet/desktop/winforms/controls/webbrowser-control-overview?view=netframeworkdesktop-4.8 .
The error is not present/triggered by:

  • the non-minified file jquery-ui.js
  • the prior version (1.13.2) minified jquery-ui.min.js.
  • the full (uncustomized) download of jQuery-UI 1.3.3.

My analysis shows the syntax error is caused by the arrow function that was generated by the minifier, and which is unsupported on the WebBrowser control (and all versions of IE https://caniuse.com/arrow-functions ).
This build error did not exist on or before June 30, 2023.

Since jQuery-UI 1.13 is supporting IE the customized builds should not throw syntax errors.

@mgol
Copy link
Member

mgol commented Feb 26, 2025

Please provide concrete steps you need to take to hit the issue; the fewer steps, the better.

@mgol
Copy link
Member

mgol commented Feb 26, 2025

Never mind, I see it even on a full build. I agree, this should not be happening.

@mgol mgol self-assigned this Feb 26, 2025
@mgol
Copy link
Member

mgol commented Mar 2, 2025

It turns out UglifyJS suddenly started outputting ES6 code even if the source didn't contain such constructs: mishoo/UglifyJS#5967. Apparently, there's no official flag to disable it.

jQuery has switched to swc which has a flag to specify the ES version, we should just switch the download builder to it.

We should also switch jQuery UI. The 1.14.x minified files are also using arrow functions because of this UglifyJS issue - and while IE is not supported there, I'd prefer the minified file to stay in ES5 as long as the unminified one remains in ES5.

mgol added a commit to mgol/jquery-ui that referenced this issue Mar 2, 2025
More recent UglifyJS versions have started converting regular functions to arrow
ones, making ES5 source file migrated to a ES2015+ minified one. We want to
avoid that even in 1.14.x as long as we keep the source file in ES5.

Ref mishoo/UglifyJS#5967
Ref jquery/download.jqueryui.com#629
mgol added a commit to mgol/jquery-ui that referenced this issue Mar 2, 2025
More recent UglifyJS versions have started converting regular functions to arrow
ones, making ES5 source file migrated to a ES2015+ minified one. We want to
avoid that even in 1.14.x as long as we keep the source file in ES5.

Ref mishoo/UglifyJS#5967
Ref jquery/download.jqueryui.com#629
mgol added a commit to mgol/jquery-ui that referenced this issue Mar 2, 2025
More recent UglifyJS versions have started converting regular functions to arrow
ones, making ES5 source file migrated to a ES2015+ minified one. We want to
avoid that even in 1.14.x as long as we keep the source file in ES5.

Ref mishoo/UglifyJS#5967
Ref jquery/download.jqueryui.com#629
mgol added a commit to mgol/download.jqueryui.com that referenced this issue Mar 2, 2025
More recent UglifyJS versions have started converting regular functions to arrow
ones, making ES5 source file migrated to a ES2015+ minified one. We want to
avoid that even in 1.14.x as long as we keep the source file in ES5. But the
bigger problem is that we generate ES2015+ minified code even for 1.13.3
releases which support IE.

Closes jquerygh-629
Ref mishoo/UglifyJS#5967
Ref jquery#629
mgol added a commit to mgol/download.jqueryui.com that referenced this issue Mar 2, 2025
More recent UglifyJS versions have started converting regular functions to arrow
ones, making ES5 source file migrated to a ES2015+ minified one. We want to
avoid that even in 1.14.x as long as we keep the source file in ES5. But the
bigger problem is that we generate ES2015+ minified code even for 1.13.3
releases which support IE.

Closes jquerygh-629
Ref mishoo/UglifyJS#5967
Ref jquery#629
mgol added a commit to mgol/download.jqueryui.com that referenced this issue Mar 2, 2025
More recent UglifyJS versions have started converting regular functions to arrow
ones, making ES5 source file migrated to a ES2015+ minified one. We want to
avoid that even in 1.14.x as long as we keep the source file in ES5. But the
bigger problem is that we generate ES2015+ minified code even for 1.13.3
releases which support IE.

Closes jquerygh-629
Ref mishoo/UglifyJS#5967
Ref jquery#629
@mgol
Copy link
Member

mgol commented Mar 2, 2025

PR: #630

mgol added a commit to jquery/jquery-ui that referenced this issue Mar 3, 2025
More recent UglifyJS versions have started converting regular functions to arrow
ones, making ES5 source file migrated to a ES2015+ minified one. We want to
avoid that even in 1.14.x as long as we keep the source file in ES5.

Closes gh-2335
Ref mishoo/UglifyJS#5967
Ref jquery/download.jqueryui.com#629
@mgol
Copy link
Member

mgol commented Mar 3, 2025

I switched the jQuery UI inner build to SWC in jquery/jquery-ui#2335 and added checking that minified files are ES5 in jquery/jquery-ui#2336.

The last piece is this Download Builder PR: #630.

@mgol mgol closed this as completed in #630 Mar 6, 2025
mgol added a commit that referenced this issue Mar 6, 2025
More recent UglifyJS versions have started converting regular functions to arrow
ones, making ES5 source file migrated to a ES2015+ minified one. We want to
avoid that even in `1.14.x` as long as we keep the source file in ES5. But the
bigger problem is that we generate ES2015+ minified code even for `1.13.3`
releases which support IE.

This change switches the minfied to SWC and ensures ES5 output. Tests
ensuring this behavior have been added.

Also, GitHub Actions were updated, as the previous versions stopped working.
To avoid this happening in the future, automatic dependabot PRs updating
actions are now enabled.

Fixes gh-629
Closes gh-630
Ref mishoo/UglifyJS#5967
Ref #629
@mgol
Copy link
Member

mgol commented Mar 6, 2025

I merged the fix but there are some deployment issues; reopening until I manage to deploy it.

@mgol mgol reopened this Mar 6, 2025
@mgol
Copy link
Member

mgol commented Mar 11, 2025

This should be working properly now. Please report if you find more issues.

@mgol mgol closed this as completed Mar 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

2 participants