profile
viewpoint
Michael Jackson mjackson @ReactTraining Carlsbad, California https://mjackson.me Founder @ReactTraining, creator @unpkg. Thriller.

janl/mustache.js 14029

Minimal templating with {{mustaches}} in JavaScript

jaredpalmer/after.js 3759

Next.js-like framework for server-rendered React apps built with React Router 4

acdlite/redux-router 2329

Redux bindings for React Router – keep your router state inside your Redux store

knowbody/react-router-docs 56

Rewrite of the React Router docs - work in progress

dabit3/react-authentication-in-depth 55

Example of User Authentication using React with React Router and AWS Amplify

hassox/react_phx_stdio 41

Demo app rendering react on the server

alex88/heroku-buildpack-vips 32

Heroku buildpack with vips

mjackson/bufferedstream 27

A robust stream implementation for node.js and the browser

mjackson/bencode 14

Bencode library for PHP

mjackson/broccoli-rev 12

A Broccoli plugin for adding revision checksums to file names

issue closedReactTraining/history

Any way to pause listeners?

I have a use case in a React application where I need to manipulate history stack by

  • triggering history.goBack
  • and then history.replace right after

However, I would like to bypass the listener for the first history.goBack call such that the route doesn't get rendered unnecessarily.

Public API doesn't seem to offer this kind of functionality. Would you be open to consider adding a capability to pause listeners?

closed time in 2 days

donysukardi

issue commentReactTraining/history

Any way to pause listeners?

It should be pretty easy to do this using the public API. history.listen returns a function you can use to stop listening for new locations, so just surround your call to goBack with an unlisten followed by a history.listen call.

Otherwise, keep a variable around and just ignore the change yourself, like:

let isPaused = false;
history.listen(location => {
  if (!isPaused) handleLocationChange(location);
});

function handleLocationChange(location) {
  // ...
}

// Somewhere in your app code
isPaused = true;
history.goBack();
isPaused = false;
history.replace();
donysukardi

comment created time in 2 days

issue closedReactTraining/history

Expose previous location when using history.listen

I can't really understand why the previous location isn't exposed when using history.listen. This seems like critical information, especially given that route changes occur even on hash updates, which often need to be differentiated from actual route updates to determine whether or not to show a new screen.

closed time in 2 days

andrewplummer

issue commentReactTraining/history

Expose previous location when using history.listen

let prevLocation = history.location;
history.listen(location => {
  // Do whatever you want with the previous location here.
  prevLocation = location;
});
andrewplummer

comment created time in 2 days

issue commentReactTraining/history

Add engines to package.json

Is there a particular reason you need this? This isn't a node library, per se.

MichaelDeBoey

comment created time in 2 days

issue closedReactTraining/history

Page is refreshed by calling history.go(), while history.back() isn't

We have iframe based micro-frontends. There is a need of changing the state of the inside app from outside one without full-reloading of the inside one. There is <BrowserRouter /> which uses Native History API.

I have tested the behavior on single app without any iframes.

When I click anchors in the app, React router doesn't refresh the whole app, and replaces parts of the app. In my case -- it's pagination.

I can call window.history.back() and it will not trigger page refresh. The same, I can do window.history.go(-1) and it will not trigger page referesh.

Then I decided what if I make window.history.pushState(null, null, 'page/2') and call window.history.go() -- page will be refreshed from scratch.

I can solve my task by replacing BrowserRouter by Router and exposing history object to window.ReactRouterHistory, but I think it's too much, when I can do window.history.back() without a page refresh.

Is it a bug? Why the page is fully refreshed by go(), but isn't when go(-1)? Is there a proper way to do this?

Thank you!

closed time in 2 days

Carduelis

issue commentReactTraining/history

Page is refreshed by calling history.go(), while history.back() isn't

It sounds like you want this library to be something it's not. This library isn't meant to replace the browser's built-in history API. It's just a thin layer the router uses to communicate with the browser. But users are still free to call the browser's built-in methods however they wish.

Carduelis

comment created time in 2 days

issue commentReactTraining/history

History is not compatible with the use of <base/>

In case 1, keep in mind the <base> tag is only supposed to be used for relative URLs in the current document. So history.push('/foo/bar') should not use the <base href> since it is an absolute path, but history.push('foo') should. This is why you don't see the <base href> in the first result, but you do in the second.

In case 2, there's really not much we can do. We would have to temporarily remove the <base> element from the page to prevent pushState from navigating to the new domain.

StringEpsilon

comment created time in 2 days

push eventmjackson/unpkg

Michael Jackson

commit sha 92c1a4043f1e690676da63c12662182390587b05

Use node 12 runtime

view details

Michael Jackson

commit sha 9f44cbf0135ede5201115449debf3b7a34538921

Add idle_timeout to App Engine config

view details

push time in 3 days

issue commentrollup/rollup

Else branch follows the wrong if statement

Would someone mind explaining briefly what the bug is? I've looked at it, but I can't say for sure I understand how and why Rollup is modifying the code here.

Is it because the warning() call is a no-op in production, so that else block is empty? What does Rollup do in that scenario?

TrySound

comment created time in 3 days

push eventmjackson/unpkg

Michael Jackson

commit sha 9f44cbf0135ede5201115449debf3b7a34538921

Add idle_timeout to App Engine config

view details

push time in 3 days

push eventmjackson/unpkg

Michael Jackson

commit sha 92c1a4043f1e690676da63c12662182390587b05

Use node 12 runtime

view details

push time in 3 days

push eventmjackson/unpkg

Michael Jackson

commit sha fe833797e8dc47a57986801ac7102662ca7301d2

Use eslint-config-react-app

view details

Eric Rodrigues Pires

commit sha 5a574ec4645a29f5e77cfa59f8f2c28b7f7aacf7

Reflect origin in CORS Fixes #226

view details

dependabot[bot]

commit sha a50a353b64ad9af3e77cd92d63a548335af4fc26

Bump mixin-deep from 1.3.1 to 1.3.2 Bumps [mixin-deep](https://github.com/jonschlinkert/mixin-deep) from 1.3.1 to 1.3.2. - [Release notes](https://github.com/jonschlinkert/mixin-deep/releases) - [Commits](https://github.com/jonschlinkert/mixin-deep/compare/1.3.1...1.3.2) Signed-off-by: dependabot[bot] <support@github.com>

view details

Øystein Kjærnet

commit sha d16ea57fde47e5b5139d00a12debf451786df440

Revert "Reflect origin in CORS" This reverts commit 5a574ec4645a29f5e77cfa59f8f2c28b7f7aacf7.

view details

Christophe Querton

commit sha 98534453aa3d96726f4be35a7c67e90639b953d0

Updates GitHub link, seems like unpkg moved.

view details

Michael Jackson

commit sha 780d0076a1c0540d1dc6dd07be3476442b2d4fec

Update function name

view details

Michael Jackson

commit sha 6bab4325e1ebfa64500b76c235a9b1b4754aa479

Remove ./ from beginning of package.json main Fixes #241

view details

Sebastian Silbermann

commit sha ebe058b0927510d5f7cb93e71f7d8807b7b9cb52

Create FUNDING.yml

view details

Michael Jackson

commit sha 7215072c724348b8d40a710b06a538f97a5953f3

Add Google Cloud logo + sponsorship info - Also fixed some horizontal scrolling issues

view details

Michael Jackson

commit sha 33edf5beecd6e0346bf28b100063c6893f160866

Fixed some layout issues

view details

Michael Jackson

commit sha bb0b62943fb98d1976fa7f3026905ca58eee3e37

Margin tweak

view details

Michael Jackson

commit sha 78c9de2e0e091a2c9728f5d2f24c009c4b4599bd

Use NODE_ENV when building client bundles

view details

Michael Jackson

commit sha a50e52b5f4e43ad7650884b844c6f87d56bbee04

Fix build warnings

view details

Michael Jackson

commit sha 1811d1c7ff3415f5783d8b73de2ac2c21c3d7b76

Add current build id to footer

view details

Michael Jackson

commit sha b5d1b2232a82dde78ff1794cb5919b70f54ea6fb

Change funding to GitHub sponsors

view details

push time in 3 days

startedalangpierce/sucrase

started time in 4 days

startedImmutableWebApps/unpkg-immutable-example

started time in 4 days

startedsharkdp/bat

started time in 8 days

pull request commentfacebook/react

Nesting Fixture

Just a quick note here (already spoke with @gaearon about this on Twitter DM): This won't work with React Router v6+ because we don't expose context at all in the react-router package. The reason we did it in v5 was because changes in the context API required us to maintain a reference to the context object. But v6 uses hooks to access things on context instead of exposing the object itself.

gaearon

comment created time in 10 days

push eventmjackson/unpkg

Michael Jackson

commit sha b5d1b2232a82dde78ff1794cb5919b70f54ea6fb

Change funding to GitHub sponsors

view details

push time in 11 days

startedneoclide/coc.nvim

started time in 17 days

issue commentrollup/rollup

this.addWatchFile does not listen for new files added to a directory

I believe this may be fixed by listening for the add event (in addition to the change and unlink events) in the file watcher here, but I'm not familiar enough with the code to be sure. FWIW I cloned the repo and was going to fix the bug myself but I couldn't get all tests to pass locally.

mjackson

comment created time in 17 days

push eventmjackson/rollup-watch-dir

Michael Jackson

commit sha 156c4c81478448577082a2c1d21df0878b4b45c7

Initial commit

view details

push time in 17 days

issue openedrollup/rollup

this.addWatchFile does not listen for new files added to a directory

<!-- ⚡️ katchow! We 💛 issues.

Please - do not - remove this template. Please - do not - skip or remove parts of this template. Or your issue may be closed.

👉🏽 Need help or tech support? Please don't open an issue! Head to https://gitter.im/rollup/rollup or https://stackoverflow.com/questions/tagged/rollupjs

👉🏽 Is this issue related to an official plugin? Please do not open an issue here, go to the plugins repository instead: https://github.com/rollup/plugins/issues

❤️ Rollup? Please consider supporting our collective: 👉 https://opencollective.com/rollup/donate -->

  • Rollup Version: 2.23.0
  • Operating System (or Browser): macos
  • Node Version (if applicable): 14.3.0
  • Link to reproduction (IMPORTANT, read below): https://github.com/mjackson/rollup-watch-dir

<!-- Issues without minimal reproductions will be closed! Please provide a link to one by:

  1. Using the REPL at https://rollupjs.org/repl/, or
  2. Using the REPL.it reproduction template at https://repl.it/@rollup/rollup-repro (allows full use of all rollup options and plugins), or
  3. Provide a minimal repository link (Read https://git.io/fNzHA for instructions). These may take more time to triage than the other options.

For some bugs it this may seem like overkill but believe us, very often what seems like a "clear issue" is actually specific to some details of your setup. Having a runnable reproduction not only "proves" your bug to us but also allows us to spend all our effort fixing the bug instead of struggling to understand your issue. -->

Expected Behavior

I'm expecting a rebuild when a new file is added to a directory that was passed to this.addWatchFile.

Actual Behavior

New files do not trigger a rebuild.

<!-- Most issues can be expressed or demonstrated through the REPL or a repository. However, the situation may arise where some small code snippets also need to be provided. In that situation, please add your code below using Fenced Code Blocks (https://help.github.com/articles/creating-and-highlighting-code-blocks/) -->

created time in 17 days

push eventmjackson/rollup-watch-dir

Michael Jackson

commit sha 7108b2074958f4675b3e240475e65f2850a1c966

Initial commit

view details

push time in 17 days

create barnchmjackson/rollup-watch-dir

branch : master

created branch time in 17 days

created repositorymjackson/rollup-watch-dir

created time in 17 days

fork mjackson/rollup

Next-generation ES module bundler

https://rollupjs.org

fork in 17 days

issue commentreach/reach-ui

CI builds are slow

One of the main things I did in the router repo to speed up testing and builds was to ditch lerna workspace run (or whatever it's called, can't remember). All the build + test infrastructure is able to work with the monorepo format, so e.g. I only have a single instance of Jest/Rollup running when I need to test/build. This eliminates startup time for spinning up individual processes, which can be significant in a repo with many packages.

mjackson

comment created time in 19 days

issue commentrollup/plugins

[pluginutils] strange behavior for include/exclude pattern

I ran into this same issue today which really confused me for a while. I am trying to use an absolute path as my include value which works with minimatch, but doesn't work with createFilter.

f = createFilter('/a/b/**/*')
f('/a/b/c.js') // false

minimatch.match(['/a/b/c.js'], '/a/b/**/*') // ['/a/b/c.js']

IMO this could be fixed by adding support for absolute paths in include and exclude, so I'm 👍 on adding support for a leading /.

The workaround for me for now involves using path.relative just so I can get a relative path that will then be resolved correctly...

LarsDenBakker

comment created time in 20 days

create barnchmjackson/rollup-id-split

branch : master

created branch time in 21 days

created repositorymjackson/rollup-id-split

created time in 21 days

issue commentmicrosoft/TypeScript

Revisiting _ underscore for unused parameters: create `unused` type

At the very least, a function parameter should not be considered to be "unused" if a parameter that comes after it is used. In that case, the "unused" parameter is actually serving a purpose by taking up a slot in the argument list.

function fun(a, b) {
  // The `a` parameter should not be considered "unused"
  console.log(b);
}
aryzing

comment created time in 25 days

push eventreach/reach.tech

Travis CI

commit sha 48f0c0414728054afb0504b948bd03e1cd078ff9

Update reach-ui website https://travis-ci.com/reach/reach-ui/builds/174505675

view details

push time in a month

push eventreach/reach-ui

Michael Jackson

commit sha 93c60e77182f34ed7cd1eb18ca603b1c37409177

Add router website

view details

push time in a month

push eventreach/reach.tech

Michael Jackson

commit sha 888e86dab2b44f33559d78cc56c0b76463e5dfbd

Put the router website back!

view details

push time in a month

push eventreach/reach.tech

Travis CI

commit sha 69770b33f3f2eb9b2c258ac74c77ea5509f2fa91

Update reach-ui website https://travis-ci.com/reach/reach-ui/builds/174477713

view details

push time in a month

PR opened reach/reach-ui

Change reacttraining.com/reach-ui to reach.tech

Hey @chancestrickland, just wanted to pass this by you to make sure you're ok with this change. I moved the website for all the Reach UI stuff back to https://reach.tech today and setup a redirect from reacttraining.com/reach-ui to reach.tech

+580 -584

0 comment

42 changed files

pr created time in a month

create barnchreach/reach-ui

branch : use-reach-tech

created branch time in a month

push eventreach/reach.tech

Travis CI

commit sha e2d70a5128dd155063c9c1945ea728fa79779313

Update reach-ui website https://travis-ci.com/reach/reach-ui/builds/174272159

view details

push time in a month

push eventreach/reach-ui

Michael Jackson

commit sha 41bf1241d430e80852d45c511c0ec0c7a5ecbe2e

Remove /reach-ui/ path prefix from website

view details

push time in a month

push eventreach/reach.tech

Travis CI

commit sha 6d49b986dbc6dbf0ad0b3663b543df4b1420e6e9

Update reach-ui website https://travis-ci.com/reach/reach-ui/builds/174237530

view details

push time in a month

issue openedreach/reach-ui

CI builds are slow

🐛 Bug report

Current Behavior

yarn build currently takes about 9 minutes to complete in CI. See e.g. https://travis-ci.com/github/reach/reach-ui/jobs/357412345

Expected behavior

I'd expect to be able to run the tests in under a minute.

Reproducible example

N/A

Suggested solution(s)

I'm not sure what could be slowing it down, but I've heard from some folks that ts-node is kinda slow. Are we invoking it to build each individual test?

created time in a month

push eventreach/reach-ui

mrm007

commit sha 4e563d1240ea88f9bc23d3bc6335b1fb1e18a399

Handle left collision with a wide MenuList (#189)

view details

Michael Jackson

commit sha e116ad338a6e758eb442dd7cf6cc4cdf67d57465

Update website hosting repo

view details

push time in a month

push eventreach/reach.tech

Michael Jackson

commit sha 7d0f36c2de95e5231d04ab7fc578d83757b21858

Use different Firebase project

view details

push time in a month

push eventreach/reach.tech

Michael Jackson

commit sha 859363255b5d8a6a1b744100cc93db342f6ec3b9

Add hosting deploy token

view details

push time in a month

push eventunpkg/react

Michael Jackson

commit sha 5ed766b070240d9e8c0e2d05c80b2d083a9c0f35

Initial commit

view details

Michael Jackson

commit sha 2c8bc69c8e52d2fa42dce688cb6183f240648857

Initial commit

view details

Michael Jackson

commit sha 7f033b93bcf1b741f199c0f10f98f03b0f14f9d3

Version 16.13.1

view details

push time in a month

push eventunpkg/react

Michael Jackson

commit sha 5ed766b070240d9e8c0e2d05c80b2d083a9c0f35

Initial commit

view details

Michael Jackson

commit sha d29189d96a856b35da8b0da8e06ca8f6998db069

Initial commit

view details

Michael Jackson

commit sha e2faae11b9737352839e2aa21015c1c75a4ea7f7

Version 16.8.0

view details

push time in a month

push eventunpkg/react

Michael Jackson

commit sha 5ed766b070240d9e8c0e2d05c80b2d083a9c0f35

Initial commit

view details

push time in a month

push eventunpkg/react

Michael Jackson

commit sha cf5b36b18ebd713062cd36b6f48bceea82bcadf5

Initial commit

view details

push time in a month

push eventunpkg/react

Michael Jackson

commit sha cf5b36b18ebd713062cd36b6f48bceea82bcadf5

Initial commit

view details

Michael Jackson

commit sha 47536462a69134184ab676cac4ae078a69ef2bdd

Version 16.13.1

view details

push time in a month

push eventunpkg/react

Michael Jackson

commit sha cf5b36b18ebd713062cd36b6f48bceea82bcadf5

Initial commit

view details

Michael Jackson

commit sha 70a6c0b549bb3dc4e1cb612b4ed08b374150b8c6

Version 16.8.0

view details

push time in a month

create barnchunpkg/react

branch : v16.13.1

created branch time in a month

create barnchunpkg/react

branch : v16.8.0

created branch time in a month

create barnchunpkg/react

branch : master

created branch time in a month

created repositoryunpkg/react

Mirror of https://www.npmjs.com/package/react

created time in a month

delete branch ReactTraining/react-router

delete branch : website-new

delete time in a month

push eventReactTraining/react-router

Michael Jackson

commit sha ba7d9c1747eadf96cf5aac6747752f1d5f6b8afc

Update website repo

view details

push time in a month

push eventReactTraining/react-router

Michael Jackson

commit sha b4c3d68bc808c8b5be81a864b45ba69598643149

Add monorepo deploy key

view details

push time in 2 months

push eventReactTraining/react-router

Michael Jackson

commit sha a707792b9a2c62740f96cd3a9cb36b000e6e3af0

Add script to build to new website monorepo

view details

push time in 2 months

create barnchReactTraining/react-router

branch : website-new

created branch time in 2 months

Pull request review commentReactTraining/react-router

Implement useAndroidBackButton hook

 const URLEventType = 'url'; /**  * Enables support for the hardware back button on Android.  */-export function useHardwareBackButton() {+export function useAndroidBackButton() {+  const index = useIndex();+  const navigate = useNavigate();++  const handleHardwardBackPress = React.useCallback(() => {+    if (index === 0) {+      return false; // home screen+    } else {+      navigate(-1);+      return true;+    }+  }, [index, navigate]);++  const handleHardwardBackPressRef = React.useRef(handleHardwardBackPress);+   React.useEffect(() => {-    function handleHardwardBackPress() {-      return undefined;-      // TODO: The implementation will be something like this-      // if (history.index === 0) {-      //   return false; // home screen-      // } else {-      //   history.back();-      //   return true;-      // }+    handleHardwardBackPressRef.current = handleHardwardBackPress;+  }, [handleHardwardBackPress]);++  React.useEffect(() => {+    function eventHandler() {+      return handleHardwardBackPressRef.current();     } -    BackHandler.addEventListener(-      HardwareBackPressEventType,-      handleHardwardBackPress-    );+    BackHandler.addEventListener(HardwareBackPressEventType, eventHandler);      return () => {-      BackHandler.removeEventListener(-        HardwareBackPressEventType,-        handleHardwardBackPress-      );+      BackHandler.removeEventListener(HardwareBackPressEventType, eventHandler);     };   }, []); } -export { useHardwareBackButton as useAndroidBackButton };

I'd prefer to keep the double exports. useAndroidBackButton is essentially just an alias for useHardwareBackButton.

nutlike

comment created time in 2 months

Pull request review commentReactTraining/react-router

Implement useAndroidBackButton hook

+import * as React from 'react';+import { act, create as createTestRenderer } from 'react-test-renderer';+import {+  MemoryRouter,+  Routes,+  Route,+  useIndex,+  useNavigate+} from 'react-router';++describe('useIndex', () => {+  it('returns the index of the current location', () => {+    let aboutIndex, aboutNavigate, homeIndex;++    function Home() {+      homeIndex = useIndex();+      return <h1>Home</h1>;+    }++    function About() {+      aboutIndex = useIndex();+      aboutNavigate = useNavigate();+      return <h1>About</h1>;+    }++    act(() => {+      createTestRenderer(+        <MemoryRouter initialEntries={['/home', '/about']} initialIndex={1}>+          <Routes>+            <Route path="/home" element={<Home />} />+            <Route path="/about" element={<About />} />+          </Routes>+        </MemoryRouter>+      );+    });++    expect(aboutIndex).toEqual(1);++    act(() => {+      aboutNavigate(-1);+    });++    expect(homeIndex).toEqual(0);

Another great test, thank you! 👍

nutlike

comment created time in 2 months

Pull request review commentReactTraining/react-router

Implement useAndroidBackButton hook

+import * as React from 'react';+import { BackHandler } from 'react-native';+import { act, create as createTestRenderer } from 'react-test-renderer';+import {+  NativeRouter,+  Routes,+  Route,+  Outlet,+  useAndroidBackButton,+  useLocation+} from 'react-router-native';++describe('useAndroidBackButton', () => {+  let backHandlerAddEventListener;+  let backHandlerRemoveEventListener;+  let handleHardwardBackPress;+  let location;+  let testRenderer;++  beforeEach(() => {+    backHandlerAddEventListener = jest+      .spyOn(BackHandler, 'addEventListener')+      .mockImplementation((_, fn) => {+        handleHardwardBackPress = fn;+      });+    backHandlerRemoveEventListener = jest+      .spyOn(BackHandler, 'removeEventListener')+      .mockImplementation(() => {});+  });++  afterEach(() => {+    backHandlerAddEventListener.mockRestore();+    backHandlerRemoveEventListener.mockRestore();+  });++  it('handles hardware back button presses', () => {+    function Layout() {+      location = useLocation();+      useAndroidBackButton();+      return <Outlet />;+    }++    function Home() {+      return <h1>Home</h1>;+    }++    function About() {+      return <h1>About</h1>;+    }++    act(() => {+      testRenderer = createTestRenderer(+        <NativeRouter initialEntries={['/home', '/about']} initialIndex={1}>+          <Routes>+            <Route path="/" element={<Layout />}>+              <Route path="/home" element={<Home />} />+              <Route path="/about" element={<About />} />+            </Route>+          </Routes>+        </NativeRouter>+      );+    });++    expect(backHandlerAddEventListener).toHaveBeenCalledTimes(1);++    act(() => {+      expect(handleHardwardBackPress()).toEqual(true);+    });++    expect(location.pathname).toBe('/home');++    act(() => {+      expect(handleHardwardBackPress()).toEqual(false);+    });++    act(() => {+      testRenderer.unmount();+    });++    expect(backHandlerRemoveEventListener).toHaveBeenCalledTimes(1);

This test looks great! 👍

nutlike

comment created time in 2 months

Pull request review commentReactTraining/react-router

Implement useAndroidBackButton hook

 const URLEventType = 'url'; /**  * Enables support for the hardware back button on Android.  */-export function useHardwareBackButton() {+export function useAndroidBackButton() {+  const index = useIndex();+  const navigate = useNavigate();++  const handleHardwardBackPress = React.useCallback(() => {+    if (index === 0) {+      return false; // home screen+    } else {+      navigate(-1);+      return true;+    }+  }, [index, navigate]);++  const handleHardwardBackPressRef = React.useRef(handleHardwardBackPress);

I think you should be ok to skip using this ref and instead just pass handleHardwareBackPress directly to the second useEffect in the dependency array. Would you agree?

nutlike

comment created time in 2 months

startedgo-gitea/gitea

started time in 2 months

pull request commentReactTraining/react-router

Added support for the as prop in Link components

Yes, it should. I'll update the migration guide.

benjdlambert

comment created time in 2 months

release ReactTraining/react-router

v0.0.0-experimental-ffd8c7d0

released time in 2 months

release ReactTraining/react-router

v6.0.0-beta.0

released time in 2 months

created tagReactTraining/react-router

tagv0.0.0-experimental-ffd8c7d0

Declarative routing for React

created time in 2 months

push eventReactTraining/react-router

Michael Jackson

commit sha 262b45dd8d6cbdc3a984259c5591ffc3de80d600

Version 6.0.0-beta.0

view details

Michael Jackson

commit sha ffd8c7d06968b0a79c81c40e9c7ffc34f6f1fa5b

Merge branch 'dev' into dev-experimental

view details

Michael Jackson

commit sha 81a5079bf90da0741a61001297926113b112b1d4

Version 0.0.0-experimental-ffd8c7d0

view details

push time in 2 months

push eventReactTraining/react-router

Michael Jackson

commit sha 262b45dd8d6cbdc3a984259c5591ffc3de80d600

Version 6.0.0-beta.0

view details

push time in 2 months

created tagReactTraining/react-router

tagv6.0.0-beta.0

Declarative routing for React

created time in 2 months

push eventReactTraining/react-router

Michael Jackson

commit sha a09ba587559c5f2c232ca7e7a2868259ef23a362

Remove pending/preload APIs These will go into the experimental channel until useTransition is stable.

view details

Michael Jackson

commit sha 06675286e31d15d354605cfb0c46160dc8ea95ae

Merge branch 'dev' into dev-experimental

view details

Michael Jackson

commit sha 2079b7795d84525d12f4f77f5b0d1b76dc5b268b

Revert "Remove pending/preload APIs" This reverts commit a09ba587559c5f2c232ca7e7a2868259ef23a362.

view details

push time in 2 months

push eventReactTraining/react-router

Michael Jackson

commit sha a09ba587559c5f2c232ca7e7a2868259ef23a362

Remove pending/preload APIs These will go into the experimental channel until useTransition is stable.

view details

push time in 2 months

delete branch ReactTraining/react-router

delete branch : dev-docs

delete time in 2 months

push eventReactTraining/react-router

Michael Jackson

commit sha c83e226f17816bb56c569836e9ffc1b4053a4388

Remove pending/preload APIs These will go into the experimental channel until useTransition is stable.

view details

push time in 2 months

push eventReactTraining/react-router

Michael Jackson

commit sha c83e226f17816bb56c569836e9ffc1b4053a4388

Remove pending/preload APIs These will go into the experimental channel until useTransition is stable.

view details

Michael Jackson

commit sha d9823dd1d559b7692abf99e72633b93b3423c378

Merge branch 'dev' into dev-experimental

view details

Michael Jackson

commit sha 9b60b649f82cfa7077d91e84417af77d8729fc65

Revert "Remove pending/preload APIs" This reverts commit c83e226f17816bb56c569836e9ffc1b4053a4388.

view details

push time in 2 months

push eventReactTraining/react-router

Michael Jackson

commit sha 9f3ac8bac9fe8125eec0d20279ad1db66d56f951

More docs

view details

Michael Jackson

commit sha 8bae34cd4a900822df08ae50c985e056d283924a

More docs

view details

Michael Jackson

commit sha fa6f257230d500a142ba92b4643a71fb868b24a1

Update to history v5, move to peer dep

view details

Michael Jackson

commit sha e6f0bb4bbb46b9da6c191367c6c9aad9cf787fcb

Make react-router a regular dep of rrd and rrn

view details

Michael Jackson

commit sha 22d28dfc719718a3a897476e5d5a647ab43bf25f

Rename things to better align with history lib resolveLocation => resolvePath useResolvedLocation => useResolvedPath

view details

Michael Jackson

commit sha cc8e6dcdd8a0fc7bbe3eb6553a34d5c69eb1cdd8

Fix failing build

view details

Michael Jackson

commit sha a2fb3d09a7a84150c50b627d6124293ba60907d2

Add missing space

view details

Michael Jackson

commit sha 814ce0e7f04818badd5b50586545512b4d9f726a

Add back missing .d.ts files to the output

view details

Michael Jackson

commit sha b9d27ed210ccd764295385173a756f8fd0b35ca3

Use tsc-generated source maps as input to Rollup

view details

Michael Jackson

commit sha 64844de10b5322cfc0adcb215cee91b0beda0747

Update fixture to history v5

view details

Michael Jackson

commit sha 86e5595e597c5ccb527b762568c8029c9586b2ae

Ignore missing .d.ts file

view details

Michael Jackson

commit sha cd03ff710e49c125bd826ad9303a3f83777d0a01

Finish up API reference

view details

Michael Jackson

commit sha 459118fccb2cb5af7340c7c2dfa61db128be2165

More work on docs

view details

Michael Jackson

commit sha 922d199f0d955d14f67aebc57e63deb5da4d4182

Use collapsible blocks for type declarations

view details

Michael Jackson

commit sha d0a80c67488f0025b3d4ca58a844fb021c0952f4

Merge branch 'dev' into dev-experimental

view details

push time in 2 months

push eventReactTraining/react-router

Michael Jackson

commit sha 922d199f0d955d14f67aebc57e63deb5da4d4182

Use collapsible blocks for type declarations

view details

push time in 2 months

delete branch ReactTraining/react-router

delete branch : dev-details

delete time in 2 months

push eventReactTraining/history

Michael Jackson

commit sha 28c89f4091ae9e1b0001341ea60c629674e83627

Put type declarations in collapsible blocks

view details

push time in 2 months

push eventReactTraining/history

Michael Jackson

commit sha 09bca52ec58b30dd08aefd66d39ae4486907d5df

Put type declarations in collapsible blocks

view details

push time in 2 months

push eventReactTraining/react-router

Michael Jackson

commit sha 1abb095dd4883afee565e696e4bfa16f7dd4f144

trying out <details> blocks for api reference

view details

push time in 2 months

create barnchReactTraining/react-router

branch : dev-details

created branch time in 2 months

push eventReactTraining/react-router

Michael Jackson

commit sha 459118fccb2cb5af7340c7c2dfa61db128be2165

More work on docs

view details

push time in 2 months

push eventReactTraining/react-router

Michael Jackson

commit sha 86e5595e597c5ccb527b762568c8029c9586b2ae

Ignore missing .d.ts file

view details

Michael Jackson

commit sha cd03ff710e49c125bd826ad9303a3f83777d0a01

Finish up API reference

view details

push time in 2 months

push eventReactTraining/react-router

Michael Jackson

commit sha a2fb3d09a7a84150c50b627d6124293ba60907d2

Add missing space

view details

Michael Jackson

commit sha 814ce0e7f04818badd5b50586545512b4d9f726a

Add back missing .d.ts files to the output

view details

Michael Jackson

commit sha b9d27ed210ccd764295385173a756f8fd0b35ca3

Use tsc-generated source maps as input to Rollup

view details

Michael Jackson

commit sha 64844de10b5322cfc0adcb215cee91b0beda0747

Update fixture to history v5

view details

push time in 2 months

push eventReactTraining/react-router

Michael Jackson

commit sha fa6f257230d500a142ba92b4643a71fb868b24a1

Update to history v5, move to peer dep

view details

Michael Jackson

commit sha e6f0bb4bbb46b9da6c191367c6c9aad9cf787fcb

Make react-router a regular dep of rrd and rrn

view details

Michael Jackson

commit sha 22d28dfc719718a3a897476e5d5a647ab43bf25f

Rename things to better align with history lib resolveLocation => resolvePath useResolvedLocation => useResolvedPath

view details

Michael Jackson

commit sha cc8e6dcdd8a0fc7bbe3eb6553a34d5c69eb1cdd8

Fix failing build

view details

push time in 2 months

issue commentReactTraining/history

Query string is returned twice when it has spaces in it

Hmm, it looks like the double render could be a hash history bug. The hashchange event sometimes fires multiple times in quick succession, so there is some code in createHashHistory that tries to prevent from firing the listener multiple times. But in this case since the query string is apparently changing I bet it's firing once for each encoding.

selbekk

comment created time in 2 months

issue closedReactTraining/history

[feature request] Add `toString` method to location

Ref ReactTraining/react-router#7405

It might be useful to have a toString method for location object which can be used to get a fully constructed pathname - /pathname#hash?search .

Example usage

import { Navigate, useLocation } from 'react-router-dom'

function LoginRedirect() {
  const location = useLocation()

  return <Navigate to={`/login?redirect=${location.toString()}`} >
}

closed time in 2 months

afzalsayed96

issue commentReactTraining/history

[feature request] Add `toString` method to location

We already have a createPath method:

import { createPath } from 'history';
let string = createPath(location);
afzalsayed96

comment created time in 2 months

push eventReactTraining/react-router

Michael Jackson

commit sha 8bae34cd4a900822df08ae50c985e056d283924a

More docs

view details

push time in 2 months

issue closedReactTraining/history

Incorrect types for push

It seems that history.push is typed incorrectly. I'm trying to pass the function as reference to redux-saga's call effect which causes an error:

const path: History.Path = ...;
yield call({ context: history, fn: history.push }, path);

The error is:

TS2769: No overload matches this call. Argument of type 'string' is not assignable to parameter of type 'LocationDescriptorObject<PoorMansUnknown>'.

closed time in 2 months

TeoTN

issue commentReactTraining/history

Incorrect types for push

It looks like you're using the types for version 4 which are maintained in https://github.com/DefinitelyTyped/DefinitelyTyped. You'll probably want to open an issue over there instead of here.

TeoTN

comment created time in 2 months

pull request commentReactTraining/react-router

Added support for the as prop in Link components

Why not just use useHref and useNavigate to build your own link component?

There are a lot of reasons why links on the web should be <a> elements, mainly because they are accessible (work well with screen readers, right click, etc.). In v6 I think I'd rather just give people an accessible <Link> component, and then let people use the lower-level hooks to create inaccessible links themselves if they want to.

benjdlambert

comment created time in 2 months

issue commentReactTraining/react-router

[v6] feature suggestion: possibility to use nested routes with absolute paths

What does your current route config look like in v5 @smashercosmo? Are you doing the whole thing in JSX with absolute paths?

smashercosmo

comment created time in 2 months

release ReactTraining/history

v5.0.0

released time in 2 months

created tagReactTraining/history

tagv5.0.0

Manage session history with JavaScript

created time in 2 months

push eventReactTraining/history

Michael Jackson

commit sha 026d9e56bdee4e05341b70bae1fb6261fdb80bf0

Version 5.0.0

view details

push time in 2 months

push eventReactTraining/history

Michael Jackson

commit sha ef40006b921c57ef03ae5e5ec6376072095485b1

Remove api doc generation script

view details

push time in 2 months

more