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

Update Redux core examples? #3910

Open
2 tasks
markerikson opened this issue Nov 25, 2023 · 2 comments
Open
2 tasks

Update Redux core examples? #3910

markerikson opened this issue Nov 25, 2023 · 2 comments
Milestone

Comments

@markerikson
Copy link
Collaborator

  • The counter-vanilla example is a UMD script tag, so that'll break. ESM module?
  • Nuke most of the examples?
@markerikson markerikson added this to the Post 2.0 milestone Nov 25, 2023
@markerikson
Copy link
Collaborator Author

From Lenz:

  <!--
    JSPM Generator Import Map
    Edit URL: https://generator.jspm.io/#U2VhYGBkDM0rySzJSU1hKEpNKa1wMNEz0jMEALgXm0gaAA
  -->
   <script type="importmap">
  {
    "imports": {
      "redux": "https://ga.jspm.io/npm:[email protected]/es/redux.js"
    },
    "scopes": {
      "https://ga.jspm.io/": {
        "@babel/runtime/helpers/esm/objectSpread2": "https://ga.jspm.io/npm:@babel/[email protected]/helpers/esm/objectSpread2.js"
      }
    }
  }
  </script>
  
  <!-- ES Module Shims: Import maps polyfill for older browsers without import maps support (eg Safari 16.3) -->
  <script async src="https://ga.jspm.io/npm:[email protected]/dist/es-module-shims.js" crossorigin="anonymous"></script>
  
  <script type="module">
    import * as redux from "redux";
  
    // Write main module code here, or as a separate file with a "src" attribute on the module script.
    console.log(redux);
  </script>

@AntonOfTheWoods
Copy link

AntonOfTheWoods commented Dec 18, 2023

@markerikson , this might be a bit of a hijack... sorry. I have a use case that seems pretty reasonable but I just can't get started. I have been happily using RTK for few years and now want to start using RTK Query. Within function components with hooks (as long as I add a few @ts-ignores due to this), it seems to be working ok.

Unfortunately, I need to be able to also use the store outside of function components (in inferno class components via inferno-redux -> I have some super-high-performance needs and plain react is just too slow...) and I just can't get started. I can't get any of the examples here to run and there don't seem to be any instructions on the expected way to run them. The supported way to install now appears to be with vite (which I have also been using for years) but most/all of the examples still use create-react-app, and I'm getting various different errors trying to install. Because there I couldn't find instructions, I don't know whether I'm just holding it wrong.

It is probably temporary but codesandbox also seems a bit foobared. I tried to download the class-based components example but it refused to download (something about Chrome now refusing sandbox downloads?) and there are also errors when trying to create a github repo.

So I am now a couple of hours in and still can't get an official example running. Is there something else I should be doing? Thanks!

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

No branches or pull requests

2 participants