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

[now-build-utils] Allow prerender groups to be defined with an integer #3081

Merged
merged 2 commits into from Sep 26, 2019

Conversation

leo
Copy link
Contributor

@leo leo commented Sep 26, 2019

This pull request removes the PrerenderGroup type in favor of a group parameter for the existing Prerender type.

This parameter takes in an integer that defines a group of prerenders that should be invalidated at the same time:

interface Prerender {
  expiration: number;
  lambda: Lambda;
  fallback: FileBlob | FileFsRef | FileRef;
  group: number;
}

Example: If two Prerender instances exist that have group set to 1, they will both be invalidated at the same time.

Copy link
Member

@styfle styfle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@Timer
Copy link
Member

Timer commented Sep 26, 2019

Just for clarification purposes, the intended return document from a builder would look along these lines, correct?

{
  "output": {
    "releases": {
      "type": "prerender",
      "expiration": 1,
      "lambda": "[Lambda]",
      "fallback": "[FileBlob | FileFsRef | FileRef]",
      "group": 1
    },
    "_next/data/releases.json": {
      "type": "prerender",
      "expiration": 1,
      "lambda": "[Lambda]",
      "fallback": "[FileBlob | FileFsRef | FileRef]",
      "group": 1
    },
    "community": {
      "type": "prerender",
      "expiration": 1,
      "lambda": "[Lambda]",
      "fallback": "[FileBlob | FileFsRef | FileRef]",
      "group": 2
    },
    "_next/data/community.json": {
      "type": "prerender",
      "expiration": 1,
      "lambda": "[Lambda]",
      "fallback": "[FileBlob | FileFsRef | FileRef]",
      "group": 2
    }
  }
}

@styfle styfle changed the title Allow prerender groups to be defined with an integer [now-build-utils] Allow prerender groups to be defined with an integer Sep 26, 2019
@leo
Copy link
Contributor Author

leo commented Sep 26, 2019

Correct @Timer 👍

Copy link
Member

@Timer Timer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks workable to me, barring fixing the build (dangling PrerenderGroup reference).

@kodiakhq kodiakhq bot merged commit 91f8368 into canary Sep 26, 2019
@kodiakhq kodiakhq bot deleted the group branch September 26, 2019 18:21
kodiakhq bot pushed a commit that referenced this pull request Sep 26, 2019
As of #3081, we make it necessary to group `Prerenders` together for being invalidated at the same time.

However, you might not want that. In turn, we'll make it optional.
styfle pushed a commit that referenced this pull request Sep 30, 2019
#3081)

This pull request removes the `PrerenderGroup` type in favor of a `group` parameter for the existing `Prerender` type.

This parameter takes in an integer that defines a group of prerenders that should be invalidated at the same time:

```
interface Prerender {
  expiration: number;
  lambda: Lambda;
  fallback: FileBlob | FileFsRef | FileRef;
  group: number;
}
```

**Example:** If two `Prerender` instances exist that have `group` set to `1`, they will both be invalidated at the same time.
styfle pushed a commit that referenced this pull request Sep 30, 2019
As of #3081, we make it necessary to group `Prerenders` together for being invalidated at the same time.

However, you might not want that. In turn, we'll make it optional.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants