-
-
Notifications
You must be signed in to change notification settings - Fork 26.8k
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
Offline mode #373
Comments
I'm not sure how this fits with |
I’m concerned about issues like this: npm/npm#8581. If the solution involves
If you know how to handle these points, I’m happy to review a PR explaining your thought process. |
I believe that issue is exactly what 3.9 fixes. You could detect npm version and avoid the flag if running older than 3.9? I'd be happy to do a pr, is this the right call to modify? |
Yes, this is the right call. What you suggest seems reasonable, please go for it! It would also help if you could help me understand how to reproduce exactly that issue in < 3.9 so we can verify 3.9 indeed fixes it in our case. |
To reproduce you need a package (Hope that helps, it's not a trivial issue...) |
Yeah, I meant this in the context of If you submitted a PR, I’d appreciate step-by-step instructions to reproduce this exact issue with |
Oh, right, sorry. The user would have to have an old version of one of the dependencies of |
Thanks for explanation! I’ll try reproing that if you submit a PR. 😉 |
Just double checking I'm editing |
Yea, it’s meant to prevent accidental breaking changes since people almost never have to update the CLI, and since old CLIs must always work with new |
Did anyone get to this issue? Does create-react-app work properly offline? |
No but if you pick up #375 and make it pass Travis, it could be in next version :-) |
I could give it a try, seems like the other guy has been busy. Is it a matter of making travis tests pass? Does this commit meet all the functional requirements? |
I don’t think it meets #375 (comment). |
Are you doing this, @gafemoyano? If not, I'd like to try to resolve this as well. |
We might have another solution to this soon. |
Sorry I haven't been able to figure it out cause... well I don't have reliable internet access. For now I've just been keeping a clean project generated with the latest version and copy/pastying it when I need to start a new app. I know it's not really a solution to this, but it's good enough considering that upgrading between CRA versions hasn't been difficult at all. |
Okay, check it out. https://github.com/yarnpkg/yarn It supports offline mode. |
Oh wow this came out literally 45 minutes ago, congrats!! |
Yarn won't be bundled with CRA. We should change the CLI to detect if Yarn is present. If it is, we should install with Yarn, and offline mode will "just work". If not, we'll fall back to npm with current behavior. |
Cool, I'll read up about Yarn and report back if I can handle the integration, unless @lukyth wants to get started right away. |
@gafemoyano It's fine. I just thought if you didn't want to do this anymore, I'd love to give it a try as well. 😄 |
Please comment in #896 if you work on this. |
yarn supports offline mode only when the flag --offline is added, so we need to check if yarn failed and if it did, install with the flag. Probably should check the error to see exactly what failed. |
Not sure what the status on this or on #896,i would love to work on this if possible |
@chiptus since that issue is closed, I believe any discussion can be held here. Just please post a comment in #896 that you want to work on this and link back to this issue. We love contributions! I would make sure that #1423 isn't already doing what this goes to accomplish; you can try to coordinate with @voxsim. |
Yea, #1423 just fixed this! |
npm wizards, we need your help!
Per @pselle’s suggestion, we should try to find a way to make
create-react-app
work offline.I’m not well versed in npm flags and likely won’t have time for this, so this is a perfect opportunity for you to contribute and significantly improve the user experience of Create React App.
Here is the behavior we’re looking for:
create-react-app my-app
should use the most recent version ofreact-scripts
if you are online. We are not changing this: we always want the users to get the most recent one.create-react-app my-app
should not crash offline if you ran it at least once before. It should be able to use locally cachedreact-scripts
in this case, if it exists.create-react-app my-app
should use cachedreact-scripts
if it knows the latest npm version is cached locally. In other words, even if you are online, we shouldn’t just refetch the whole thing if we have it locally and we know it is the latest version. This is not required but would make a big difference for most people.react-scripts
depends onsome-package@1.0.0
, thensome-package@1.0.1
comes out, but we keep using the cachedsome-package@1.0.0
.How to achieve this? I have no idea.
Maybe this would be helpful: https://addyosmani.com/blog/using-npm-offline/.
We already use
bundledDependencies
(which is a bit unusual) as part of our build process so in realityreact-scripts
is being downloaded as a single tarball rather than through the usual npm process. Perhaps this can give us the leverage to make this better (e.g. by caching that tarball somehow).The text was updated successfully, but these errors were encountered: