Skip to content

Commit

Permalink
fix: remove string.prototype.matchAll polyfill (#3864)
Browse files Browse the repository at this point in the history
  • Loading branch information
nolanlawson authored Nov 17, 2023
1 parent 7e1a435 commit f919e52
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 20 deletions.
3 changes: 1 addition & 2 deletions packages/@lwc/style-compiler/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,7 @@
"@lwc/shared": "5.0.2",
"postcss": "~8.4.31",
"postcss-selector-parser": "~6.0.13",
"postcss-value-parser": "~4.2.0",
"string.prototype.matchall": "^4.0.10"
"postcss-value-parser": "~4.2.0"
},
"devDependencies": {
"@types/string.prototype.matchall": "^4.0.3"
Expand Down
3 changes: 1 addition & 2 deletions packages/@lwc/style-compiler/src/serialize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
*/
import postcss, { Result } from 'postcss';
import matchAll from 'string.prototype.matchall';
import { KEY__SCOPED_CSS, LWC_VERSION_COMMENT } from '@lwc/shared';
import { Config } from './index';
import { isImportMessage } from './utils/message';
Expand Down Expand Up @@ -286,7 +285,7 @@ function tokenizeCss(data: string): Token[] {
const regex = new RegExp(`[[-](${attributes.join('|')})]?`, 'g');

let lastIndex = 0;
for (const match of matchAll(data, regex)) {
for (const match of data.matchAll(regex)) {
const index = match.index!;
const [matchString, substring] = match;

Expand Down
17 changes: 1 addition & 16 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -9809,7 +9809,7 @@ reduce-flatten@^2.0.0:
resolved "https://registry.yarnpkg.com/reduce-flatten/-/reduce-flatten-2.0.0.tgz#734fd84e65f375d7ca4465c69798c25c9d10ae27"
integrity sha512-EJ4UNY/U1t2P/2k6oqotuX2Cc3T6nxJwsM0N0asT7dhrtH1ltUxDn4NalSYmPE2rCkVpcf/X6R0wDwcFpzhd4w==

regexp.prototype.flags@^1.5.0, regexp.prototype.flags@^1.5.1:
regexp.prototype.flags@^1.5.1:
version "1.5.1"
resolved "https://registry.yarnpkg.com/regexp.prototype.flags/-/regexp.prototype.flags-1.5.1.tgz#90ce989138db209f81492edd734183ce99f9677e"
integrity sha512-sy6TXMN+hnP/wMy+ISxg3krXx7BAtWVO4UouuCN/ziM9UEne0euamVNafDfvC83bRNr95y0V5iijeDQFUNpvrg==
Expand Down Expand Up @@ -10666,21 +10666,6 @@ string-width@^5.0.0, string-width@^5.0.1, string-width@^5.1.2:
emoji-regex "^9.2.2"
strip-ansi "^7.0.1"

string.prototype.matchall@^4.0.10:
version "4.0.10"
resolved "https://registry.yarnpkg.com/string.prototype.matchall/-/string.prototype.matchall-4.0.10.tgz#a1553eb532221d4180c51581d6072cd65d1ee100"
integrity sha512-rGXbGmOEosIQi6Qva94HUjgPs9vKW+dkG7Y8Q5O2OYkWL6wFaTRZO8zM4mhP94uX55wgyrXzfS2aGtGzUL7EJQ==
dependencies:
call-bind "^1.0.2"
define-properties "^1.2.0"
es-abstract "^1.22.1"
get-intrinsic "^1.2.1"
has-symbols "^1.0.3"
internal-slot "^1.0.5"
regexp.prototype.flags "^1.5.0"
set-function-name "^2.0.0"
side-channel "^1.0.4"

string.prototype.trim@^1.2.8:
version "1.2.8"
resolved "https://registry.yarnpkg.com/string.prototype.trim/-/string.prototype.trim-1.2.8.tgz#f9ac6f8af4bd55ddfa8895e6aea92a96395393bd"
Expand Down

0 comments on commit f919e52

Please sign in to comment.