Skip to content

Add const to requireRegex #237

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

Merged
merged 1 commit into from
Jul 4, 2021

Conversation

pete-murphy
Copy link
Contributor

@pete-murphy pete-murphy commented Jul 4, 2021

Description of the change

Importing from React.Basic.Hooks is broken (see #236).
This seems to be because the requireRegex used by parseDeps only parses required modules using the var keyword, while recent updates to React.Basic modules switched from var to const.

This PR updates the requireRegex to match on

const React = require("react")

in addition to the existing supported format

var React = require("react")
Before Screen Shot 2021-07-04 at 12 57 44 PM Note that the React "shim" (from `https://unpkg.com/[email protected]/umd/react.development.js`) is not included in *Sources*
After Screen Shot 2021-07-04 at 12 57 31 PM

Checklist:

  • Added the change to the changelog's "Unreleased" section with a reference to this PR (e.g. "- Made a change (#0 by @)")
  • Linked any existing issues or proposals that this pull request should close
  • Updated or added relevant documentation
  • Added a test for the contribution (if applicable)

@pete-murphy pete-murphy force-pushed the pm/fix-shim-loading branch from 919e2a0 to 42f44a4 Compare July 4, 2021 17:18
@pete-murphy pete-murphy marked this pull request as ready for review July 4, 2021 17:24
@thomashoneyman
Copy link
Member

Thank you!

@thomashoneyman thomashoneyman merged commit e496e0a into purescript:master Jul 4, 2021
@thomashoneyman
Copy link
Member

@pete-murphy pete-murphy deleted the pm/fix-shim-loading branch July 5, 2021 12:22
milesfrain added a commit to milesfrain/tps that referenced this pull request Jul 18, 2021
milesfrain added a commit to milesfrain/tps that referenced this pull request Jul 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants