- 10 6月, 2019 3 次提交
-
-
由 Lukáš Huvar 提交于
* Adding Typescript description to next fixes #7529 * Change default export * Improve typing for next * Remove dev server typings
-
由 JJ Kasper 提交于
* Fix next start in serverless mode with public directory * Add public folder to serverless test suite
-
由 JJ Kasper 提交于
* Add export const config support and make withAmp a no-op * Use babel plugin for PageConfig * Fix serverless-loader exports * Add backwards compatibility for withAmp
-
- 05 6月, 2019 1 次提交
-
-
由 Lukáš Huvar 提交于
* Cookies and Query parsing for API request * Adding JSON and SEND * First body parsing * Body parsing * Remove extra try catch * Fix tests * Only server bundling for API routes * Update packages/next-server/server/api-utils.ts Co-Authored-By: NTim Neutkens <tim@timneutkens.nl> * Revert on demand server changes * Use content-type for parsing * Update packages/next-server/server/api-utils.ts Co-Authored-By: NJan Potoms <potoms.jan@gmail.com> * Add tests for server compilation * Add body limit * Change API to function chaining * Limit test
-
- 31 5月, 2019 2 次提交
-
-
由 Joe Haddad 提交于
-
由 Joe Haddad 提交于
* Revise dynamic route generation This implements a new tree-based route sorting algorithm that uses a Depth-First-Traversal approach to correctly sort the routes. This provides better clarity over a `.sort()` based approach and will scale well as we add new features in the future. * Update import
-
- 29 5月, 2019 2 次提交
-
-
由 Tim Neutkens 提交于
* Run prettier over packages/**/*.js * Run prettier over packages/**/*.ts * Run prettier over examples * Remove tslint * Run prettier over examples * Run prettier over all markdown files * Run prettier over json files
-
由 JJ Kasper 提交于
* Add canonicalBase config to allow setting absolute path for canonical link * Make sure canonicalBase is set for export and serverless * Move canonicalBase to amp.canonicalBase * Update tests with canonicalBase config * Update tests * run lint-fix * Fix canonicalBase config parsing * Fix canonicalBase during export * Update amphtml tests
-
- 28 5月, 2019 1 次提交
-
-
由 Joe Haddad 提交于
* Update escape string regexp operators * temp * Extract getRouteRegex func * First iteration of dynamic routing for production only * Correctly order prod * Add serverless support * Single line it * noop routes * Format doc * Fix dynamic routing for dev * Add flag for dynamic routing * Update packages/next-server/lib/router/router.ts Co-Authored-By: NJJ Kasper <jj@jjsweb.site> * remove example * Add router tests * Format code * Sort routes * Update to not use posix path methods
-
- 27 5月, 2019 1 次提交
-
-
由 Joe Haddad 提交于
* Format next server * Extract findPageComponents logic from renderToHTMLWithComponents * Apply a little formatting * Lift up component loading
-
- 24 5月, 2019 1 次提交
-
-
由 JJ Kasper 提交于
-
- 23 5月, 2019 2 次提交
-
-
由 JJ Kasper 提交于
-
由 JJ Kasper 提交于
* Add automatic exporting of pages with no getInitialProps * Add support for exporting serverless to static and serving the html files during next start * Fix missing runtimeEnv when requiring page, re-add warning when trying to export with serverless, and update tests * Update flying-shuttle test * revert un-used pagesManifest change * remove query.amp RegExp test * Fix windows backslashes not being replaced * Re-enable serverless support for next start * bump * Fix getInitialProps check * Fix incorrect error check * Re-add check for reserved pages * Fix static check * Update to ignore /api pages and clean up some tests * Re-add needed next.config for test and correct behavior * Update RegExp for ignored pages for auto-static * Add checking for custom getInitialProps in pages/_app * Update isPageStatic logic to only use default export * Re-add retrying to CircleCi * Update query during dev to only have values available during export for static pages * Fix test * Add warning when page without default export is found and make sure to update pages-manifest correctly in flying-shuttle mode * Fix backslashes not being replaced * Integrate auto-static with flying-shuttle and make sure AMP is handled in flying-shuttle * Add autoExport for opting in
-
- 11 5月, 2019 1 次提交
-
-
由 Lukáš Huvar 提交于
* First basic API support * Change require functionality * Change 501 to 404 * Change wording * Fix test
-
- 04 5月, 2019 1 次提交
-
-
由 Luis Fernando Alvarez D 提交于
-
- 24 4月, 2019 1 次提交
-
-
由 Tim Neutkens 提交于
* Add .d.ts files * Drop next declarations from index.d.ts * Bring back number of errors * Fix more errors * Fix rewriteUrlForExport
-
- 15 4月, 2019 2 次提交
-
-
由 JJ Kasper 提交于
-
由 Tim Neutkens 提交于
* Add x-powered-by * Remove ampEnabled type
-
- 12 4月, 2019 1 次提交
-
-
由 JJ Kasper 提交于
* Add WithAmp to enable AMP support for pages instead of .amp.js * Update handling for exporting AMP * Fix ampPath in export for / path and revert isAmp logic to handle right * Update amphtml test suite * Add handling for noDirtyAmp during export and update amp-export test suite * Update serverless and export-default-map test suites * Update require-page tests
-
- 06 4月, 2019 1 次提交
-
-
由 JJ Kasper 提交于
This adds a query for debugging AMP bind init data
-
- 05 4月, 2019 1 次提交
-
-
由 JJ Kasper 提交于
* Add amp request header and check for amp query in serverless mode * Add serverless test for an AMP page * Update to handle querystring weirdness * Update serverless test config
-
- 03 4月, 2019 1 次提交
-
-
由 JJ Kasper 提交于
* Added amp-toolbox-optimizer and added optimizing AMP pages as dirty and clean * Fix amp-optimizer breaking serverless build * Exclude amp-toolbox-optimizer from serverless build * Added check to make sure hybrid AMP pages optimize cleanly during export * Add check to make sure noDirtyAmp is applied
-
- 02 4月, 2019 1 次提交
-
-
由 Tim Neutkens 提交于
-
- 26 3月, 2019 1 次提交
-
-
由 Luis Fernando Alvarez D 提交于
Related to #6776
-
- 20 3月, 2019 1 次提交
-
-
由 JJ Kasper 提交于
-
- 19 3月, 2019 1 次提交
-
-
由 JJ Kasper 提交于
* Add support for .amp.js pages and resolving /page?amp=1 to page.amp.js * Update amp tests * Update example and clean up amp page resolving * Add nested amp test * page => normalizedPage * Add type to page options * Add handling of amp with all pageExtensions and normalize page * Make sure findPageFile only falls back to amp if enabled
-
- 14 3月, 2019 1 次提交
-
-
由 JJ Kasper 提交于
* Show a better error when someone throws undefined * Update error wording Co-Authored-By: Nijjk <22380829+ijjk@users.noreply.github.com> * Update error wording in test Co-Authored-By: Nijjk <22380829+ijjk@users.noreply.github.com> * Update test and add check for statusCode before updating error
-
- 02 3月, 2019 2 次提交
-
-
由 Joe Haddad 提交于
* Format a few documents * Drop `renderToAMP` and `renderToAMPHTML`
-
由 Joe Haddad 提交于
-
- 18 2月, 2019 1 次提交
-
-
由 Joe Haddad 提交于
Per consensus in a mixed-application scenario, we'll use the `amp` query parameter convention.
-
- 16 2月, 2019 1 次提交
-
-
由 Connor Davis 提交于
Closes: #6244 This will block the following keys: ``` NODE_.+ __.+ ``` There doesn't seem to be a way to simulate a failed build or else I'd add tests for it.
-
- 14 2月, 2019 1 次提交
-
-
由 Tim Neutkens 提交于
* Add initial AMP implementation * Implement experimental feature flag * Implement feedback from sbenz * Add next/amp and `useAmp` hook * Use /:path*/amp instead * Add canonical * Add amphtml tag * Add ampEnabled for rel=“amphtml” * Remove extra type
-
- 29 1月, 2019 1 次提交
-
-
由 Connor Davis 提交于
Fixes #6144
-
- 26 1月, 2019 1 次提交
-
-
由 Tim Neutkens 提交于
This reverts commit 9112f63e.
-
- 23 1月, 2019 1 次提交
-
-
由 Tim Neutkens 提交于
* Move phases back to next/constants * Fix typescript error
-
- 14 1月, 2019 1 次提交
-
-
由 Tim Neutkens 提交于
* Remove next/asset Reasoning described in #5970 * Remove next/asset tests * Bring back asset-page
-
- 31 12月, 2018 1 次提交
-
-
由 Anderson Leite 提交于
Fixes #5845 Implement tslint for core files **What is this?** Implements tslint for both next and next-server, but keeps standardjs/eslint for the .js files that are still there, we're gradually migrating to Typescript. **How does it work?** Before every commit (pre-commit) we execute the following `tslint` command: `tslint -c tslint.json 'packages/**/*.ts` **TSLint Rules** In order to avoid as much changes as possible I marked some rules as false. This way we can improve the linter but making sure this step will not break things. (see tslint.json) **Note** After merging this PR, you'll need to update your dependencies since it adds tslint to package.json
-
- 28 12月, 2018 1 次提交
-
-
由 Tim Neutkens 提交于
**This does not change existing behavior.** building to serverless is completely opt-in. - Implements `target: 'serverless'` in `next.config.js` - Removes `next build --lambdas` (was only available on next@canary so far) This implements the concept of build targets. Currently there will be 2 build targets: - server (This is the target that already existed / the default, no changes here) - serverless (New target aimed at compiling pages to serverless handlers) The serverless target will output a single file per `page` in the `pages` directory: - `pages/index.js` => `.next/serverless/index.js` - `pages/about.js` => `.next/serverless/about.js` So what is inside `.next/serverless/about.js`? All the code needed to render that specific page. It has the Node.js `http.Server` request handler function signature: ```ts (req: http.IncomingMessage, res: http.ServerResponse) => void ``` So how do you use it? Generally you **don't** want to use the below example, but for illustration purposes it's shown how the handler is called using a plain `http.Server`: ```js const http = require('http') // Note that `.default` is needed because the exported module is an esmodule const handler = require('./.next/serverless/about.js').default const server = new http.Server((req, res) => handler(req, res)) server.listen(3000, () => console.log('Listening on http://localhost:3000')) ``` Generally you'll upload this handler function to an external service like [Now v2](https://zeit.co/now-2), the `@now/next` builder will be updated to reflect these changes. This means that it'll be no longer neccesary for `@now/next` to do some of the guesswork in creating smaller handler functions. As Next.js will output the smallest possible serverless handler function automatically. The function has 0 dependencies so no node_modules are required to run it, and is generally very small. 45Kb zipped is the baseline, but I'm sure we can make it even smaller in the future. One important thing to note is that the function won't try to load `next.config.js`, so `publicRuntimeConfig` / `serverRuntimeConfig` are not supported. Reasons are outlined here: #5846 So to summarize: - every page becomes a serverless function - the serverless function has 0 dependencies (they're all inlined) - "just" uses the `req` and `res` coming from Node.js - opt-in using `target: 'serverless'` in `next.config.js` - Does not load next.config.js when executing the function TODO: - [x] Compile next/dynamic / `import()` into the function file, so that no extra files have to be uploaded. - [x] Setting `assetPrefix` at build time for serverless target - [x] Support custom /_app - [x] Support custom /_document - [x] Support custom /_error - [x] Add `next.config.js` property for `target` Need discussion: - [ ] Since the serverless target won't support `publicRuntimeConfig` / `serverRuntimeConfig` as they're runtime values. I think we should support build-time env var replacement with webpack.DefinePlugin or similar. - [ ] Serving static files with the correct cache-control, as there is no static file serving in the serverless target
-
- 19 12月, 2018 1 次提交
-
-
由 Tim Neutkens 提交于
This brings us one step closer to outputting serverless functions as renderToHTML now renders the passed components, which allows us to bundle the renderToHTML function together with statically imported components in webpack.
-
- 14 12月, 2018 1 次提交
-
-
由 Tim Neutkens 提交于
-