Skip to content

Add support for passing metadata into visitOptions of fastboot visit#66

Merged
rwjblue merged 2 commits intoember-fastboot:masterfrom
suchitadoshi1987:suchita/metadata
Nov 20, 2020
Merged

Add support for passing metadata into visitOptions of fastboot visit#66
rwjblue merged 2 commits intoember-fastboot:masterfrom
suchitadoshi1987:suchita/metadata

Conversation

@suchitadoshi1987
Copy link
Copy Markdown
Member

@suchitadoshi1987 suchitadoshi1987 commented Aug 21, 2020

Add support for passing metadata into visitOptions of fastboot visit

Context:
Currently, with local development of addons that rely on fastboot metadata, there are cases where the metadata is set by another library of the consuming app. Hence, local development of such addons can become challenging. This PR introduces a way to pass in the metadata through the visitOptions, so that the dummy apps could leverage it.
Once this change is in, we could potentially pass in the metadata into the middleware from here:
https://github.com/ember-fastboot/ember-cli-fastboot/blob/master/packages/ember-cli-fastboot/index.js#L339.

Ref: https://github.com/rileyhilliard/fastboot-addon-development
TODO:

  • Add Tests

Copy link
Copy Markdown
Member

@rwjblue rwjblue left a comment

Choose a reason for hiding this comment

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

In general, this seems fine but I'd prefer to change this a bit so that we grab options.visitOptions instead.

Then we can tweak the thing in the returned function to be something like:

let visitOptions = Object.assign({}, opts.visitOptions, { request: req, response: res });
fastboot
  .visit(path, visitOptions)
  .then(success, failure);

Copy link
Copy Markdown
Member

@rwjblue rwjblue left a comment

Choose a reason for hiding this comment

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

No giant rush, but we should also make sure to add some docs to the README about this before we land it.

@suchitadoshi1987 suchitadoshi1987 changed the title [WIP] Add support for passing metadata into visitOptions of fastboot visit Add support for passing metadata into visitOptions of fastboot visit Nov 20, 2020
@rwjblue rwjblue merged commit 6289968 into ember-fastboot:master Nov 20, 2020
@suchitadoshi1987 suchitadoshi1987 deleted the suchita/metadata branch November 20, 2020 16:52
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.

2 participants