profile
viewpoint

pshrmn/curi 253

A JavaScript router for single-page applications

pshrmn/notes 132

Quick references to remember how various things work

pshrmn/rrc 113

React Router v4 helper components

pshrmn/react-router-test-context 51

Create a pseudo context to assist in testing components that render React Router's location-aware components.

pshrmn/route-tester 50

Test React Router v4 <Route>s

pshrmn/qhistory 40

Wrap history with query support

pshrmn/hickory 22

History management for single page applications. Powers https://curi.js.org

pshrmn/understanding-rollup 10

Learn how Rollup bundling works

pshrmn/scroll-component 3

DEPRECATED: Use https://github.com/pshrmn/rcc

issue commentpshrmn/curi

@curi/static and svelte

I'm finally looking into this today, but I don't have an immediate answer. I think that I'll have to look into how Sapper works to figure out a solution.

wighawag

comment created time in 10 days

push eventpshrmn/curi

Paul Sherman

commit sha 8ebb30f4283b5d660b0cccc03230402652194944

Remove console logs from svelte basic example

view details

push time in 11 days

push eventpshrmn/curi

Paul Sherman

commit sha 9e18b8ffb36981aa7a84bddca339b954bcb6cbd6

Update Svelte version, use $$restProps, update examples (#246)

view details

Paul Sherman

commit sha 623efb16dceb8e05c4c0f8cf04b269ac167326aa

Publish - @curi/helpers@2.0.2 - @curi/interactions@2.0.2 - @curi/react-dom@2.0.3 - @curi/react-native@2.0.3 - @curi/react-universal@2.0.2 - @curi/router@2.1.1 - @curi/static@2.0.3 - @curi/svelte@2.0.0-beta.6 - @curi/types@2.0.2 - @curi/vue@2.0.0-alpha.13 - @curi-docs/website@0.2.25

view details

Paul Sherman

commit sha 026d664c36f46f5bf8f3397d5ba5c396c761963a

Updated size snapshots

view details

push time in 11 days

delete branch pshrmn/curi

delete branch : svelte-updates

delete time in 11 days

push eventpshrmn/curi

Paul Sherman

commit sha 9e18b8ffb36981aa7a84bddca339b954bcb6cbd6

Update Svelte version, use $$restProps, update examples (#246)

view details

push time in 11 days

PR merged pshrmn/curi

Update Svelte version, use $$restProps, update examples
  1. Updates Svelte version to latest, which allows the use of $$restProps instead of having to manually destructure the props object.
  2. Adds some webpack resolve properties that are recommended by svelte-loader.
+168 -48

0 comment

21 changed files

pshrmn

pr closed time in 11 days

PR opened pshrmn/curi

Update Svelte version, use $$restProps, update examples
  1. Updates Svelte version to latest, which allows the use of $$restProps instead of having to manually destructure the props object.
  2. Adds some webpack resolve properties that are recommended by svelte-loader.
+168 -48

0 comment

21 changed files

pr created time in 11 days

push eventpshrmn/curi

Paul Sherman

commit sha 3c06197c4d49fe0703fb8d0b3267d4f1918a4a26

Refactor documentation website styling to use Tailwind (#241)

view details

Paul Sherman

commit sha ef68991a9974921f4bf1ab0b2a28d767c5e6004c

Don't truncate heading elements

view details

Paul Sherman

commit sha 4ed6a35fd3d3cecf3e57f679aede6a5ebb050c78

Add linting to package source code (#242)

view details

Paul Sherman

commit sha c23400b55f66784d6c362e7f584d674e41816572

Use less modules (#243)

view details

push time in 11 days

create barnchpshrmn/curi

branch : svelte-updates

created branch time in 11 days

delete branch pshrmn/curi

delete branch : less-modules

delete time in 11 days

push eventpshrmn/curi

Paul Sherman

commit sha c23400b55f66784d6c362e7f584d674e41816572

Use less modules (#243)

view details

push time in 11 days

PR merged pshrmn/curi

Use less modules
+607 -742

0 comment

48 changed files

pshrmn

pr closed time in 11 days

startedrust-lang/rustlings

started time in 13 days

issue commentpshrmn/curi

@curi/static and svelte

rollup-plugin-svelte doesn't take care of those for you?

I'm going to be AFK for a few days, but if that doesn't work, I'll try to play around with this a bit next week. I need to give some more attention to both the svelte and static packages.

wighawag

comment created time in 21 days

issue commentpshrmn/curi

webiste on different folder structure

Oh, I think that there is actually a simpler solution for that, then. You can configure a base for your history object.

import { browser, createBase } from '@hickory/browser';
import { createRouter } from '@curi/router';

const router = createRouter(browser, routes, {
  history: { base: createBase('...') }
});

the trick will be to determine what the base is. I imagine that you would inspect the current URL and if the domain is cloudflare-ipfs.com you would check for ipfs/ipns to figure out what the base is.

I realized while looking at this that I forgot to add documentation on passing history options when you create the history object. I'll need to get that fixed.

wighawag

comment created time in 23 days

issue commentpshrmn/curi

webiste on different folder structure

Supporting having the same routes on both the root and in nested folders is a bit of a tricky case.

My first instance is that you could copy the routes.

const baseRoutes = [
 { name: 'One', path: 'one' },
 { name: 'Two', path: 'two' },
  // ...
];

const routes = prepareRoutes([
  { name: 'Folder', path: 'folder', children: [...baseRoutes] },
  ...baseRoutes
]);

However, that would fail the uniqueness of route names, so you should need to have something that walks through the routes and changes their names.

function asNestedRoutes(prefix, routes) {
  const prefixedRoutes = [];
  for (route of routes) {
    const copy = {
      ...route,
      name: `${prefix} ${route.name}`
    }
    if (route.children && route.children.length) {
      copy.children = asNestedRoutes(prefix, route.children);
    }
    prefixedRoutes.push(copy);
  }
  return prefixedRoutes;
}

const routes = prepareRoutes([
  { name: 'Folder', path: 'folder', children: asNestedRoutes('Folder', baseRoutes) },
  ...baseRoutes
]);

I haven't tested that, but in theory it should work.

What is your use case for wanting to have all of the routes also work as nested? Is this for international versions?

wighawag

comment created time in 24 days

startedmswjs/msw

started time in a month

issue closedReactTraining/react-router

goodbye react-router

You interfere with the policy with open source, today you disabled documentation and tomorrow what ? delete the repository ?

closed time in a month

gromov-io

issue closedReactTraining/react-router

Open source should not be linked to racism

<!-- Thank you for contributing!

Have a usage question?

The issue tracker is meant for bug reports only. This isn't the best place for usage questions. Questions here don't have as much visibility as they do elsewhere. Before you ask a question, here are some resources to get help first:

  • Read the docs: https://reacttraining.com/react-router
  • Check out the list of frequently asked questions: https://github.com/ReactTraining/react-router/blob/master/FAQ.md
  • Explore examples: https://reacttraining.com/react-router/web/example/basic
  • Look for/ask questions on Stack Overflow: https://stackoverflow.com/questions/ask?tags=react-router
  • Ask in chat: https://discord.gg/0ZcbPKXt5bYaNQ46

Think you found a bug?

The best bug report is a failing test in the repository as a pull request. Otherwise, please use the "BUG REPORT" template below.

Have a feature request?

Remove the template from below and provide thoughtful commentary and code samples on what this feature means for your product. What will it allow you to do that you can't do today? How will it make current work-arounds straightforward? What potential bugs and edge cases does it help to avoid? etc. Please keep it product-centric. -->

<!-- BUG TEMPLATE -->

Version

Please replace this sentence with the React Router version that you are using.

Test Case

https://codesandbox.io/s/react-router-gh6n7

Steps to reproduce

Expected Behavior

Actual Behavior

closed time in a month

MatchaDog

PR opened pshrmn/curi

Use less modules
+607 -742

0 comment

48 changed files

pr created time in a month

create barnchpshrmn/curi

branch : less-modules

created branch time in a month

delete branch pshrmn/curi

delete branch : eslint

delete time in a month

push eventpshrmn/curi

Paul Sherman

commit sha 4ed6a35fd3d3cecf3e57f679aede6a5ebb050c78

Add linting to package source code (#242)

view details

push time in a month

PR merged pshrmn/curi

Add linting to package source code
  1. Add typescript linting
  2. Prefer let arrow functions over function.

Linting was mostly straightforward. The @curi/router package had a decent bit of re-org for not using functions before they are defined, but I also had to use some eslint-disable-next-lines because of where the router and history are defined.

+2206 -512

0 comment

53 changed files

pshrmn

pr closed time in a month

Pull request review commentpshrmn/curi

Add linting to package source code

-export type AnyFn = (...args: Array<any>) => Promise<any>;+export type AnyFn = (...args: any[]) => Promise<any>; -export default function once(fn: AnyFn): AnyFn {+let once = (fn: AnyFn): AnyFn => {   let promise: Promise<any>; -  return function(): Promise<any> {+  return function() {     if (promise !== undefined) {       return promise;     } +    // eslint-disable-next-line prefer-spread,prefer-rest-params

Switching to using argument spreading increase the bundle size.

pshrmn

comment created time in 2 months

push eventpshrmn/curi

Paul Sherman

commit sha eb6c3c861ab10c7e5855850c3243fe4ef556046f

Prefer to use for..of

view details

push time in 2 months

PR opened pshrmn/curi

Add linting to package source code
  1. Add typescript linting
  2. Prefer let arrow functions over function.

Linting was mostly straightforward. The @curi/router package had a decent bit of re-org for not using functions before they are defined, but I also had to use some eslint-disable-next-lines because of where the router and history are defined.

+2202 -507

0 comment

53 changed files

pr created time in 2 months

push eventpshrmn/curi

Paul Sherman

commit sha ef68991a9974921f4bf1ab0b2a28d767c5e6004c

Don't truncate heading elements

view details

push time in 2 months

push eventpshrmn/curi

Paul Sherman

commit sha 3d72d34325005fa48be31c46a9fb5cfd83203a3d

smaller helpers, react lint version

view details

push time in 2 months

create barnchpshrmn/curi

branch : eslint

created branch time in 2 months

push eventpshrmn/curi

Paul Sherman

commit sha a3708157c44b31187061b8405fb693f40b569e38

Don't truncate heading elements

view details

push time in 2 months

push eventpshrmn/curi

Paul Sherman

commit sha 623d6384d79cc2514f37a27b1e71cd93b10edb2e

Release tailwinds styled site

view details

push time in 2 months

delete branch pshrmn/curi

delete branch : tailwind

delete time in 2 months

push eventpshrmn/curi

Paul Sherman

commit sha 3c06197c4d49fe0703fb8d0b3267d4f1918a4a26

Refactor documentation website styling to use Tailwind (#241)

view details

push time in 2 months

PR merged pshrmn/curi

Refactor documentation website styling to use Tailwind
+5014 -3158

0 comment

166 changed files

pshrmn

pr closed time in 2 months

PR opened pshrmn/curi

Refactor documentation website styling to use Tailwind
+5014 -3158

0 comment

166 changed files

pr created time in 2 months

create barnchpshrmn/curi

branch : tailwind

created branch time in 2 months

issue commentpshrmn/curi

Apollo Integration - Prefetching

I don't think that prefetch is actually what you want here.

prefetch is used for prefetching content for another route that the user might navigate to (i.e. loading code split routes early). The resolve function is always called when the route matches, so there needs to be some level of caching to prevent duplicate network requests (import() caches requests). I should probably update the docs/write a guide on using that.


As for your problem, are you saying that the resolved value in route B's respond function doesn't have the correct data? Your route definition looks correct to me. Do you see the network request for the query in dev tools? Does this issue only exist when you programmatically navigate (i.e. does it work if you navigate directly to that location)?

I'm trying to get a sense of the problem since what you shared looks fine to me. I haven't touched graphql in a minute, but I may try to whip together an example this weekend.

martavis

comment created time in 2 months

more