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

WIP: Basepath support (split assetPrefix) #2

Open
wants to merge 167 commits into
base: canary
Choose a base branch
from

Conversation

tomaswitek
Copy link

No description provided.

@tomaswitek tomaswitek changed the title Basepath support WIP: Basepath support Aug 22, 2018
@tomaswitek tomaswitek changed the title WIP: Basepath support WIP: Basepath support (split assetPrefix) Aug 22, 2018
timneutkens and others added 17 commits August 28, 2018 12:44
In my use case, the client pings are failing since the requests do not send basic auth credentials right now.

This change was made in vercel#2509

I am not sure why it was undone as a part of vercel#3578

Can someone explain why? Thanks.
This fixes intermittent `loading...` on some requests which surfaced on zeit.co when upgrading
Some really nasty Internal Server errors come as a result of not having the correct module name here.
Babel loader v8 now for babel v7
other update fix bugs and performance improvements
## Issue

Currently react-error-overlays launch-editor functionality doesn’t work because the module paths are in the wrong format.

## Todo

- [x] Keep source-maps enabled

## Related

vercel#4979
This fixes an issue with styles jumping around when using `transition: all`
timneutkens and others added 30 commits September 27, 2018 17:42
- This makes sure the Next.js renderer / server doesn't have a dependency on the `http` module.
- Splits out util functions for SSR only
- Removes obsolete methods / methods that weren't being tree-shaken
* show warning if there is a title in _document.js Head

* dont loop through children in production

* only 1 loop through this.props.children 💪

* also raise warning in test env

* check for null childs
* Initial dev server

* Remove obsolete check

* Move hotReloader to dev-server

* Use parent renderErrorToHTML to remove dep on render.js

* Remove dev option from server itself
Remove `if(this.hotReloader)` as it's always guaranteed to be there.

vercel#5317 (comment)
* Remove obsolete check in dev-server

* Don’t require package.json at runtime

Inline the Next.js version at publish time, so that there’s no runtime dependency for this
### Next js 7+ and Typescript 3+ Example

No babel, tsc, pure typescript usage
Made by [next-with-typescript plugin](https://github.com/echoulen/next-with-typescript)
This PR removes the obsolete `_containerProps` context.
We don't need to `React.cloneElement`, twice.
The demo did not work. Updating to babel-plugin-inline-react-svg v1.0.1 did work.
This PR Fixes vercel#4920

So the problem is that when a next.js application is built on windows, the `pages-manifest.json` file is created with backslashes. If this built application is deployed to a linux hosting enviroment, the server will fail when trying to load the modules.

```
Error: Cannot find module '/user_code/next/server/bundles\pages\index.js
```

My simple solution is to modify the `pages-manifest.json` to always use linux separator (`/`), then also 
modify `server/require.js` to, when requiring page, replace any separator (`\` or `/`) with current platform-specific file separator (`require('path').sep`).

The fix in `server/require.js` would be sufficient, but my opinion is that having some cross-platform consistency is nice.

This change was tested by bulding an application in windows and running it in linux and windows, aswell as building an application in linux and running it in linux and windows. The related tests was also run.
# Conflicts:
#	client/index.js
#	lib/app.js
#	lib/link.js
#	lib/router/router.js
#	server/index.js
#	server/render.js
#	yarn.lock
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

Successfully merging this pull request may close these issues.