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

Error when building with haul: ref to pathToRegexp.compile #4658

Merged
merged 9 commits into from
Jul 25, 2018
Merged

Error when building with haul: ref to pathToRegexp.compile #4658

merged 9 commits into from
Jul 25, 2018

Conversation

Piotrovskyi
Copy link

Please provide enough information so that others can review your pull request:

Motivation

Error in source code that cause problem on react native using haul https://puu.sh/AT1uZ/158623d5a4.png

@react-navigation-ci
Copy link

@ericvicenti
Copy link
Contributor

Erm this is strange.. we're using normal documented behavior of pathToRegexp here.. https://github.com/pillarjs/path-to-regexp

I'm not sure whats going on with haul

cc @satya164

@ericvicenti ericvicenti changed the title fix pathutils Error when building with haul: ref to pathToRegexp.compile Jul 10, 2018
@satya164
Copy link
Member

cc @thymikee

@thymikee
Copy link

I think it's a quirk in Babel acutally. And haul's failure indicates correct behavior (imho). Wouldn't a module like that be imported like this?:

-import pathToRegexp from 'path-to-regexp';
+import * as pathToRegexp from 'path-to-regexp';

The documentation uses require, so I'd assume you either do the above or:

import {compile} from 'path-to-regexp';
compile(...)

@ericvicenti
Copy link
Contributor

Oh, very strange that it somehow works in metro.

I'm not a fan of import * ... because I've seen it go wrong under various environments..

@Piotrovskyi, can you change this PR to import compile with import {compile} from 'path-to-regexp'; ? Thanks!

@codecov-io
Copy link

codecov-io commented Jul 12, 2018

Codecov Report

Merging #4658 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #4658   +/-   ##
=======================================
  Coverage   67.75%   67.75%           
=======================================
  Files          57       57           
  Lines        1833     1833           
=======================================
  Hits         1242     1242           
  Misses        591      591
Impacted Files Coverage Δ
src/routers/pathUtils.js 93.33% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 67233dc...1efc42a. Read the comment docs.

@brentvatne
Copy link
Member

@ericvicenti - look good to you now?

@react-navigation-ci
Copy link

Copy link

@rodrigobdz rodrigobdz left a comment

Choose a reason for hiding this comment

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

Entry in changelog is missing as defined in the pull request template.

@react-navigation-ci
Copy link

Copy link

@rodrigobdz rodrigobdz 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 adding the entry. However, you should add it under the existing "Fixed" section as shown here.

@react-navigation-ci
Copy link

@react-navigation-ci
Copy link

@react-navigation-ci
Copy link

@rodrigobdz
Copy link

@brentvatne About the changelog entry, now that I think about it… It should be add under the Unreleased section, right?

@react-navigation-ci
Copy link

@react-navigation-ci
Copy link

@satya164 satya164 merged commit 714d5ea into react-navigation:master Jul 25, 2018
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.

None yet

8 participants