GithubHelp home page GithubHelp logo

react-cosmos-classic's Introduction

Cosmos

React Cosmos

Getting Started

Choose one of the Getting Started guides to dive into React Cosmos.

Check out the Next.js integration to get started with React Server Components.

Visit reactcosmos.org/docs to view the full documentation.

Community

To chat with other community members you can join the React Cosmos Discord.

You can also ask questions, voice ideas, and share your projects on GitHub Discussions.

Our Code of Conduct applies to all React Cosmos community channels.

Contributing

Please see our CONTRIBUTING.md.

Become a Sponsor to support the ongoing development of React Cosmos.

Live Demo

Visit reactcosmos.org/demo/ for a live demo of React Cosmos.

React Cosmos

react-cosmos-classic's People

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

react-cosmos-classic's Issues

Compatibility with core-js 3

What's up?

Currently I'm unable to set babel's preset-env to use the corejs: 3 option, which involves installing core-js@^3, without react-cosmos failing on an error about @babel/runtime-corejs2:

[Cosmos] Export Failed! See errors below:

ModuleNotFoundError: Module not found: Error: Can't resolve 'core-js/library/fn/object/values' in '<my-package path>/node_modules/@babel/runtime-corejs2/core-js/object'
<stack trace>

Mkay, tell me more...

I'm using a custom webpack config, with a custom babel config setting the value with a custom babel preset... so I'm definately not discounting that this could be an issue with my setup and not an issue with cosmos. I'll try to get some time in the next day to setup a simplified example to replicate, but I wanted to get the issue up in case someone just knows how to fix this.

I'd love to contirbute towards fixing this, but I'm really struggling to work out how @babel/runtime-corejs2 even becomes a dependency of react-cosmos's published package.

Apollo client proxy is getting blocked by CORS policy when fetching from backend.

Unable to get cors configured in cosmos for apollo client.

I am trying to setup the cosmos apollo proxy to fetch live data from our gql backend within comps. The cors policy on the backend is enabled and configured for our normal app environment and localhost:8989 has been added to the whitelist for cosmos. I have tried using the same client configuration options as our live site but I am still getting blocked on the pre-flight request. The same client configuration works just fine when running the normal app locally but I cannot get this to work within cosmos no matter what I seem to try.

Access to fetch at 'https://backenddomain' from origin 'http://localhost:8989' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.

The app is a create react app and cosmos is configured to use the same react-scripts/config/webpack.config file as the app.

I have tried adjusting the credentials property on the apollo client config but all options seem to get the same result. The only difference I see on the options request made from the full app running locally and the cosmos options request is that the Sec-Fetch-Site options from cosmos is set to cross-site and from the app its same-site.

Any ideas on what I might be able to try to get this to work from within cosmos?

difference

Remove Cosmos Next packages

  • Configure TravisCI and Codecov
  • Remove Cosmos Next packages (and docs)
    • Remove TS config
  • Strip react-cosmos package of Cosmos Next code
  • Update README to point to Cosmos Next
  • Rename react-cosmos as react-cosmos-classic
    • Rename bin command to allow Cosmos Classic and Cosmos Next in same project
    • Publish to NPM
      • Test new package in react-testing-examples project

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.