-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(router): allow empty route.path for correct catchAll ranking (#582)
- Loading branch information
1 parent
68b1f96
commit a106fee
Showing
25 changed files
with
371 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,7 @@ | |
|
||
# shuvi.js | ||
/.shuvi/ | ||
build/ | ||
|
||
# production | ||
/dist/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,18 @@ | ||
{ | ||
"private": true, | ||
"name": "example-basic", | ||
"scripts": { | ||
"dev": "shuvi dev", | ||
"build": "shuvi build", | ||
"start": "shuvi start" | ||
}, | ||
"dependencies": { | ||
"shuvi": "1.0.0-rc.5" | ||
"shuvi": "workspace:*" | ||
}, | ||
"devDependencies": { | ||
"@types/node": "^18.6.1", | ||
"@types/react": "^18.0.17", | ||
"@types/react-dom": "^18.0.6", | ||
"@types/react": "18.0.9", | ||
"@types/react-dom": "18.0.6", | ||
"typescript": "^4.7.4" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import React from 'react'; | ||
import { RouterView } from '@shuvi/runtime'; | ||
|
||
export default function Layout() { | ||
return ( | ||
<div | ||
style={{ | ||
minHeight: '100vh' | ||
}} | ||
> | ||
/$/layout.tsx | ||
<RouterView /> | ||
</div> | ||
); | ||
} | ||
|
||
export const loader = async () => { | ||
console.log('[demo] /$/layout loader'); | ||
return {}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import * as React from 'react'; | ||
|
||
export default function Home() { | ||
return <>/$/pages.tsx</>; | ||
} | ||
export const loader = async () => { | ||
console.log('[demo] /$/page loader'); | ||
return {}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import React from 'react'; | ||
import { RouterView } from '@shuvi/runtime'; | ||
|
||
export default function Layout() { | ||
return ( | ||
<div | ||
style={{ | ||
minHeight: '100vh' | ||
}} | ||
> | ||
/calc/layout.tsx | ||
<RouterView /> | ||
</div> | ||
); | ||
} | ||
|
||
export const loader = async () => { | ||
console.log('[demo] /calc/layout loader'); | ||
return {}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import * as React from 'react'; | ||
|
||
export default function Home() { | ||
return <>/calc/pages.tsx</>; | ||
} | ||
export const loader = async () => { | ||
console.log('[demo] /calc/page loader'); | ||
return {}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import React from 'react'; | ||
import { RouterView } from '@shuvi/runtime'; | ||
|
||
export default function Layout() { | ||
return ( | ||
<div | ||
style={{ | ||
minHeight: '100vh' | ||
}} | ||
> | ||
/home/layout.tsx | ||
<RouterView /> | ||
</div> | ||
); | ||
} | ||
|
||
export const loader = async () => { | ||
console.log('[demo] /home/layout loader'); | ||
return {}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import * as React from 'react'; | ||
|
||
export default function Home() { | ||
return <>/home/pages.tsx</>; | ||
} | ||
export const loader = async () => { | ||
console.log('[demo] /home/page loader'); | ||
return {}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.