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

feat(gatsby): Compile Gatsby Config Files AOT #34776

Merged
merged 32 commits into from
Feb 28, 2022
Merged

feat(gatsby): Compile Gatsby Config Files AOT #34776

merged 32 commits into from
Feb 28, 2022

Conversation

LekoArts
Copy link
Contributor

@LekoArts LekoArts commented Feb 9, 2022

@gatsbot gatsbot bot added the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Feb 9, 2022
@LekoArts LekoArts added topic: TypeScript Issues and PRs related to TS in general, public typings or gatsby-plugin-typescript and removed status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer labels Feb 9, 2022
@LekoArts LekoArts changed the title wip: TS AOT feat(gatsby): Compile Gatsby Config Files AOT Feb 21, 2022
Comment on lines 120 to 127
const gatsbyConfigRootDir = isCompileGatsbyFilesFlagSet()
? `${program.directory}/${COMPILED_CACHE_DIR}`
: program.directory
const pathToGatsbyConfig = systemPath.join(
program.directory,
gatsbyConfigRootDir,
`gatsby-config.js`
)
watchConfig(pathToGatsbyConfig, createGatsbyConfigNode)
Copy link
Contributor

Choose a reason for hiding this comment

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

Is compiled gatsby-config ever updated? In develop .ts file might not get siteMetadata hot updates?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@pieh At the moment it's only compiled once at the start of the server, not updated

Copy link
Contributor

Choose a reason for hiding this comment

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

For now I think this can be known limitation, but we should think how we would like to address it - do we keep parcel watcher? do we watch config file (we already do above) and instead watch source file and if source is ts file we trigger on-demand compilation for it, etc?

@LekoArts LekoArts marked this pull request as ready for review February 23, 2022 08:26
pieh
pieh previously approved these changes Feb 28, 2022
@pieh pieh added the bot: merge on green Gatsbot will merge these PRs automatically when all tests passes label Feb 28, 2022
@gatsbybot gatsbybot merged commit 04d1d37 into master Feb 28, 2022
@gatsbybot gatsbybot deleted the feat/ts-aot branch February 28, 2022 13:47
@LekoArts LekoArts added this to the TypeScript Improvements milestone Apr 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bot: merge on green Gatsbot will merge these PRs automatically when all tests passes topic: TypeScript Issues and PRs related to TS in general, public typings or gatsby-plugin-typescript
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants