Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Jan 26, 2019. It is now read-only.

Add loader for .graqhql files#270

Open
patrick91 wants to merge4 commits intowmonk:master
base:master
Choose a base branch
Loading
frompatrick91:feature/loader-graphql

Conversation

@patrick91
Copy link
Contributor

bahkostya, josh-degraw, Iankill, HenrikFricke, pradel, harrisrobin, gregwym, johnrees, yoiang, eddiemoore, and 5 more reacted with thumbs up emoji
@patrick91patrick91force-pushed thefeature/loader-graphql branch from33f23ff to6bd2327CompareMarch 3, 2018 22:22
@bahkostya
Copy link

Can somebody from maintainers look at this pull request Please?@DorianGrey,@wmonk
Thanks in advance

HenrikFricke, gabriel-sevecek, Iankill, harrisrobin, and derekclair reacted with thumbs up emoji

@harrisrobin
Copy link

Yes, need this please.

Thank you!

Copy link
Collaborator

@DorianGreyDorianGrey left a comment

Choose a reason for hiding this comment

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

I'm very sorry for this delayed reponse - I've been quite busy the last couple of weeks and didn't have the time to look into this as precisely as it deserves.

Most things are looking fine, apart from the two issues mentioned (where only one is critical).

Side note:@wmonk , even though this would be "pre-picking" of a CRA 2.x feature, I suppose it's not that unlikely, esp. since it cuts down a bit of merging work for that version ... ;)

Copy link
Collaborator

Choose a reason for hiding this comment

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

Is there any particular reason that this loader is only registered indev, but not inprod mode? (See thewebpack.config.prod.js)

Copy link
Collaborator

Choose a reason for hiding this comment

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

Suppose this note is not required here, since this PR results in some kind of "pre-picking".

@simsim0709
Copy link

Hi,@patrick91

Are you still working on this pr? If not, I would like to make a pr again, cuz I need it for my project.

Thank you

HenrikFricke reacted with thumbs up emoji

@patrick91
Copy link
ContributorAuthor

I'll finish this in the weekend if that's ok :)

@simsim0709
Copy link

Yop. No problem. Thank you for this pr!! 😀

@eddiemoore
Copy link

Any progress on this?

@patrick91patrick91force-pushed thefeature/loader-graphql branch from4f61b6b to0914932CompareMay 14, 2018 17:46
@patrick91
Copy link
ContributorAuthor

Sorry folks! I was travelling, I just pushed the changes, thanks for the nudges@eddiemoore@simsim0709 :)

@DorianGrey this should be fine to merge now, as soon as I fix the failure on travis ci :)

@patrick91patrick91force-pushed thefeature/loader-graphql branch from0914932 tod3716d5CompareMay 14, 2018 20:29
@patrick91
Copy link
ContributorAuthor

Ok, I'm not sure why it fails,@DorianGrey can you tell me how to run the single failing test locally? I had troubles with docker unfortunately

@DorianGrey
Copy link
Collaborator

You may just runtasks/e2e-kitchensink.sh in the project root. Beware that this is a bit unstable in case it is executed multiple times in a non-isolated environment, since the scripts are using a localyarn repository to publish the packages, and that may cause version collisions. However, due to the same issue, its a bit complicated to execute one of the test cases of that suite in isolation.

The particular test that seems to fail in your case is this one:https://github.com/wmonk/create-react-app-typescript/blob/master/tasks/e2e-kitchensink.sh#L144
Yet I'm a bit surprised of why - the result indicates that thegraphql file was picked up viafile-loader, which should not be responsible regarding thewebpack configuration.

@patrick91
Copy link
ContributorAuthor

@DorianGrey yeah, I saw that, I was able to run the kitchensink locally but with no luck, it seems like it using an old version of the scripts, I even tried to delete the config and it didn't break, mmh, let me try again

@patrick91patrick91force-pushed thefeature/loader-graphql branch fromad4613d tod3716d5CompareMay 16, 2018 21:54
@patrick91
Copy link
ContributorAuthor

@DorianGrey it seems that we need to pass--scripts-version=react-scripts-ts to

npx create-react-app --internal-testing-template="$root_path"/packages/react-scripts/fixtures/kitchensink test-kitchensink

so it will load the correct scripts, but the test fails still, with a different failure

/v/f/g/_/T/t/test-kitchensink (py3.6) REACT_APP_SHELL_ENV_MESSAGE=fromtheshell \  NODE_PATH=src \  PUBLIC_URL=http://www.example.org/spa/ \  yarn buildyarn run v1.6.0$ react-scripts-ts buildfs.js:987  return binding.stat(pathModule._makeLong(path));                 ^Error: ENOENT: no such file or directory, stat '/private/var/folders/gy/_nycm7nx4zd45ldqdz5lzhk40000gn/T/tmp.hTn8c68y/test-kitchensink/tsconfig.json'    at Error (native)    at Object.fs.statSync (fs.js:987:18)    at resolveConfigPath (/private/var/folders/gy/_nycm7nx4zd45ldqdz5lzhk40000gn/T/tmp.hTn8c68y/test-kitchensink/node_modules/tsconfig-paths/lib/tsconfig-loader.js:41:12)    at loadSyncDefault (/private/var/folders/gy/_nycm7nx4zd45ldqdz5lzhk40000gn/T/tmp.hTn8c68y/test-kitchensink/node_modules/tsconfig-paths/lib/tsconfig-loader.js:19:22)    at tsConfigLoader (/private/var/folders/gy/_nycm7nx4zd45ldqdz5lzhk40000gn/T/tmp.hTn8c68y/test-kitchensink/node_modules/tsconfig-paths/lib/tsconfig-loader.js:13:22)    at configLoader (/private/var/folders/gy/_nycm7nx4zd45ldqdz5lzhk40000gn/T/tmp.hTn8c68y/test-kitchensink/node_modules/tsconfig-paths/lib/config-loader.js:27:22)    at Object.loadConfig (/private/var/folders/gy/_nycm7nx4zd45ldqdz5lzhk40000gn/T/tmp.hTn8c68y/test-kitchensink/node_modules/tsconfig-paths/lib/config-loader.js:8:12)    at new TsconfigPathsPlugin (/private/var/folders/gy/_nycm7nx4zd45ldqdz5lzhk40000gn/T/tmp.hTn8c68y/test-kitchensink/node_modules/tsconfig-paths-webpack-plugin/lib/plugin.js:20:42)    at Object.<anonymous> (/private/var/folders/gy/_nycm7nx4zd45ldqdz5lzhk40000gn/T/tmp.hTn8c68y/test-kitchensink/node_modules/react-scripts-ts/config/webpack.config.prod.js:134:7)    at Module._compile (module.js:570:32)    at Object.Module._extensions..js (module.js:579:10)    at Module.load (module.js:487:32)    at tryModuleLoad (module.js:446:12)    at Function.Module._load (module.js:438:3)    at Module.require (module.js:497:17)    at require (internal/module.js:20:19)error Command failed with exit code 1.

@DorianGrey
Copy link
Collaborator

Hm... I'm not sure about adding this, since--internal-testing-template refers to a particular template that is used for the tests (inpackages/react-scripts/fixtures/kitchensink). That particular template doesnot include anytypescript related stuff.
That's why adding--scripts-version=react-scripts-ts does not work for that test: this parameter overwrites the template used for the test, thus there is notsconfig.json as the build script expects.

@patrick91
Copy link
ContributorAuthor

Yup, but without it we are testing the wrong scripts right? I'm happy to do another PR with the updated tests if that's ok :)

@DorianGrey
Copy link
Collaborator

DorianGrey commentedMay 17, 2018
edited
Loading

The--internal-testing-template overwrites the template used during theinit process on project generation, ignoring the one caused by the--scripts-version option. The resulting project contains this enforced template, but still utilizes the build configuration provided by the scripts package.

It might take a little more to set this up properly, i.e. not only modifying the generation command, but the whole particular template. PR is welcome, though 👍

@heresandyboy
Copy link

Hi, I have been trying to figure out how to use .graphql files in create-react-app-typescript. My investigations have led me to this PR - was support for loading .graphql ever implemented? Are there any workarounds available? My main reason for switching from .ts files using gql`` is so that I can easily use fragments.

DaveyEdwards and typeofweb reacted with thumbs up emoji

Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.

Reviewers

1 more reviewer

@DorianGreyDorianGreyDorianGrey requested changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

7 participants

@patrick91@bahkostya@harrisrobin@simsim0709@eddiemoore@DorianGrey@heresandyboy

[8]ページ先頭

©2009-2025 Movatter.jp