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

Don't add "use strict" to external libraries #3746

Merged
merged 2 commits into from
Dec 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion inst/www/shared/datepicker/js/bootstrap-datepicker.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion inst/www/shared/ionrangeslider/js/ion.rangeSlider.min.js

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ Selectize.define("selectize-plugin-a11y", function (options) {
// random IDs are assigned when .selectize() is called, but we're
// doing it here to limit the scope of changes.
var kids = self.$dropdown_content[0].children;
for (i = 0; i < kids.length; i++) {
for (var i = 0; i < kids.length; i++) {
var attrs = kids[i].attributes;
if (!attrs.role) {
kids[i].setAttribute("role", "option");
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions srcts/build/external_libs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ import globalsPlugin from "esbuild-plugin-globals";
const opts = {
bundle: false,
sourcemap: false,
// Oddly, esbuild seems to use the top-level tsconfig.json file even when just
// minifying JS to JS. Because that tsconfig file has "strict":true, esbuild
// ends up adding "use strict" to the top of each minified JS file, which can
// alter behavior. To avoid this, we have a separate tsconfig file with
// "alwaysStrict":false.
tsconfig: "srcts/build/external_libs_tsconfig.json",
};

readdir(outDir + "datepicker/js/locales/").then(async (localeFiles) => {
Expand Down
6 changes: 6 additions & 0 deletions srcts/build/external_libs_tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"compilerOptions": {
"target": "ES5",
"alwaysStrict": false
}
}
2 changes: 1 addition & 1 deletion tools/selectize-patches/000-selectize-a11y-assign-id.patch
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ index e3cd799e..1d494f88 100644
+ // random IDs are assigned when .selectize() is called, but we're
+ // doing it here to limit the scope of changes.
+ var kids = self.$dropdown_content[0].children;
+ for (i = 0; i < kids.length; i++) {
+ for (var i = 0; i < kids.length; i++) {
+ var attrs = kids[i].attributes;
+ if (!attrs.role) {
+ kids[i].setAttribute("role", "option");
Expand Down