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

fix(compat): replace matchAll to support iOS safari <= 12 #168

Merged
merged 4 commits into from
Jun 15, 2021

Conversation

kellyjosephprice
Copy link
Collaborator

@kellyjosephprice kellyjosephprice commented Jun 15, 2021

🧰 Changes

matchAll first came to iOS safari in version 13.

🧬 QA & Testing

@kellyjosephprice kellyjosephprice temporarily deployed to markdown-pr-168 June 15, 2021 21:19 Inactive
@kellyjosephprice kellyjosephprice temporarily deployed to markdown-pr-168 June 15, 2021 21:24 Inactive
Copy link
Contributor

@rafegoldberg rafegoldberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the quick turnaround here. Looks good to merge once we get those tests fixed!

Comment on lines 31 to 33
#- name: Update regression test snapshots
#if: ${{ failure() }}
#run: npm run test.browser -- -u
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't we need to update these visual snapshots in order to get tests to pass?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes!

@@ -6,7 +6,11 @@ const PropTypes = require('prop-types');
const MATCH_SCRIPT_TAGS = /<script\b[^>]*>([\s\S]*?)<\/script>\n?/gim;

const extractScripts = (html = '') => {
const scripts = [...html.matchAll(MATCH_SCRIPT_TAGS)].map(m => m[1]);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should probably polyfill missing native methods like this in the long run.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand babel, but shouldn't it already be:

$ cat .babelrc 
{
  "presets": [
    [
      "@babel/preset-env",
      {
        "targets": {
          "browsers": ["last 2 versions"]
        }
      }
    ],
    "@babel/preset-react"
  ],
  "plugins": [
    "@babel/plugin-proposal-class-properties",
    "@babel/plugin-proposal-object-rest-spread",
    "@babel/plugin-proposal-optional-chaining"
  ]
}

@kellyjosephprice kellyjosephprice temporarily deployed to markdown-pr-168 June 15, 2021 21:42 Inactive
@kellyjosephprice kellyjosephprice merged commit 24142c0 into next Jun 15, 2021
@kellyjosephprice kellyjosephprice deleted the fix/matchAll branch June 15, 2021 21:45
rafegoldberg pushed a commit that referenced this pull request Jun 15, 2021
## Version 6.27.2-next.2

### 🛠 Fixes & Updates

* **compat:** replace matchAll to support iOS safari <= 12 ([#168](#168)) ([24142c0](24142c0))

<!--SKIP CI-->
@rafegoldberg
Copy link
Contributor

This PR was released!

🚀 Changes included in v6.27.2-next.2

rafegoldberg pushed a commit that referenced this pull request Jun 15, 2021
## Version 6.27.2

### 🛠 Fixes & Updates

* **compat:** replace matchAll to support iOS safari <= 12 ([#168](#168)) ([24142c0](24142c0))

### ✨ New & Improved

* **tables:** hide empty table header rows ([#99](#99)) ([8b6d24b](8b6d24b))

<!--SKIP CI-->
@rafegoldberg
Copy link
Contributor

This PR was released!

🚀 Changes included in v6.27.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants