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

💡 RFC: Finalize Astro global design/interface #506

Closed
drwpow opened this issue Jun 21, 2021 · 6 comments
Closed

💡 RFC: Finalize Astro global design/interface #506

drwpow opened this issue Jun 21, 2021 · 6 comments

Comments

@drwpow
Copy link
Member

drwpow commented Jun 21, 2021

Astro.request, etc.

@jasikpark
Copy link
Contributor

Would it be helpful to add automatic type documentation generation with api-extractor from Microsoft? https://github.com/microsoft/rushstack

@natemoo-re
Copy link
Member

@jasikpark I think this issue is more to track that we want to take some time to think about the design of this. Currently we have some global state, page/route specific state, and other overlapping concerns wrapped into this single Astro global. We likely want to namespace them.

@jasikpark
Copy link
Contributor

I suppose if I want to ask about that I should push it into its own issue, my interest in adding automatic type documentation would be so it's a bit more obvious what is all globbed onto the Astro global, since it's not clear to me what the extent of bits added to it are, though I suppose I could have just led with that question 😅 instead of suggesting a solution first.

@matthewp matthewp mentioned this issue Jun 29, 2021
3 tasks
@FredKSchott FredKSchott changed the title Finalize Astro global design/interface 💡 RFC: Finalize Astro global design/interface Jun 30, 2021
@johnhenry
Copy link
Contributor

johnhenry commented Nov 4, 2021

Not sure if this is the right place to put this...
since the Astro global is not available in externally loaded scripts, I wonder if it would make sense to allow the Astro global to be passed into externally loaded functions?

// file:///./fetchAndTransform.mjs
export default (url, parameters, Astro) =>Astro.fetchContent(url).then(content=>{
// transform content based on parameters
})
---
import fetchAndTransform from "./fetchAndTransform.mjs";
const transformedContent = fetchAndTransform("../pages/post/*.md", { wrap:"li", replaceURL:false }, Astro);
---
<ul>{[...transformedContend]}</ul>

@johnhenry
Copy link
Contributor

Not sure if this is the right place to put this... since the Astro global is not available in externally loaded scripts, I wonder if it would make sense to allow the Astro global to be passed into externally loaded functions?

// file:///./fetchAndTransform.mjs
export default (url, parameters, Astro) =>Astro.fetchContent(url).then(content=>{
// transform content based on parameters
})
---
import fetchAndTransform from "./fetchAndTransform.mjs";
const transformedContent = fetchAndTransform("../pages/post/*.md", { wrap:"li", replaceURL:false }, Astro);
---
<ul>{[...transformedContend]}</ul>

Or does this already work? I recently tried something like this again. It's not throwing an error, but Astro.fetchContent returns an empty array no matter what I pass it?

@FredKSchott
Copy link
Member

Hey everyone! Our current RFC process is beginning to break down at this size, with over 50 open RFCs currently in the "discussing" stage. A growing community is a great problem to have, but our ability to give you RFC feedback has suffered as a result. In an effort to improve our RFC process, we are making some changes to better organize things.

From now on, all RFCs will live in a standalone repo: https://github.com/withastro/rfcs

This allows us to do three things: 1) Use threaded discussions for high-level ideas and improvements, without necessarily requiring an implementation for every idea. 2) Improve the quality of our RFC template and the speed/quality of all feedback. 3) Support inline comments and explicit approvals on RFCs, via a new Pull Request review process.

We hope that this new process leads to better RFC weekly calls and faster feedback on your RFCs from maintainers. More detail can be found in the new RFC repo README.


We can't automatically convert this issue to an RFC in the new repo because new RFC template is more detailed that this one. But, you can still continue this discussion in the new repo by creating a new Discussion in the RFC repo and copy-and-pasting this post (and any relevant follow-up comments) into it. Discussions are available for high-level ideas and suggestions without the requirement of a full implementation proposal.

Then, when you are ready to propose (or re-propose) an implementation for feedback and approval, you can create a new RFC using the new RFC template. More detail about how to do this can be found in the new RFC repo README.

Thanks for your patience as we attempt to improve things for both authors and reviewers. If you have any questions, don't hesitate to reach out on Discord. https://astro.build/chat

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

No branches or pull requests

5 participants