Skip to content

Commit

Permalink
Bump rrule to v2.7.2 and remove its import workarounds (#39322)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielrozenberg authored Aug 9, 2023
1 parent 81ce0ac commit 44dcbf9
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 45 deletions.
15 changes: 0 additions & 15 deletions build-system/common/update-packages.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
'use strict';

const checkDependencies = require('check-dependencies');
const del = require('del');
const fs = require('fs-extra');
const path = require('path');
const {cyan, red} = require('kleur/colors');
Expand Down Expand Up @@ -180,19 +179,6 @@ function patchShadowDom() {
writeIfUpdated(patchedName, file);
}

/**
* Deletes the map file for rrule, which breaks closure compiler.
* TODO(wg-infra): Remove this workaround after a fix is merged for
* https://github.com/google/closure-compiler/issues/3720.
*/
function removeRruleSourcemap() {
const rruleMapFile = 'node_modules/rrule/dist/es5/rrule.js.map';
if (fs.existsSync(rruleMapFile)) {
del.sync(rruleMapFile);
logLocalDev('Deleted', cyan(rruleMapFile));
}
}

/**
* Checks if all packages are current, and if not, runs `npm install`.
*/
Expand Down Expand Up @@ -227,7 +213,6 @@ function updatePackages() {
patchIntersectionObserver();
patchResizeObserver();
patchShadowDom();
removeRruleSourcemap();
if (isCiBuild()) {
runNpmChecks();
}
Expand Down
5 changes: 2 additions & 3 deletions extensions/amp-date-picker/0.1/dates-list.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import * as rrule from '../../../node_modules/rrule/dist/es5/rrule';
import {requireExternal} from '../../../src/module';
import {rrulestr} from 'rrule';

const rrulestr = rrule.default.rrulestr || rrule.rrulestr; // closure imports into .default, esbuild flattens a layer.
import {requireExternal} from '../../../src/module';

/** @enum {string} */
const DateType = {
Expand Down
4 changes: 1 addition & 3 deletions extensions/amp-date-picker/1.0/component/dates-list.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import {addDays, isSameDay, isValid} from 'date-fns';
import * as rrule from 'rrule';

const rrulestr = rrule.default.rrulestr || rrule.rrulestr; // closure imports into .default, esbuild flattens a layer.
import {rrulestr} from 'rrule';

/**
* RRULE returns dates as local time formatted at UTC, so the
Expand Down
47 changes: 24 additions & 23 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"react-day-picker": "8.0.0-beta.37",
"react-jss": "10.8.2",
"resize-observer-polyfill": "1.5.1",
"rrule": "2.6.8",
"rrule": "2.7.2",
"timeago.js": "4.0.2",
"web-activities": "1.24.0",
"web-animations-js": "2.3.2"
Expand Down

0 comments on commit 44dcbf9

Please sign in to comment.