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(next-swc/relay): Add javascript to language #42894

Merged
merged 4 commits into from Nov 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions packages/next-swc/crates/core/src/relay.rs
Expand Up @@ -15,6 +15,7 @@ use swc_core::{
#[serde(rename_all = "lowercase")]
pub enum RelayLanguageConfig {
TypeScript,
JavaScript,
Flow,
}

Expand Down Expand Up @@ -99,6 +100,9 @@ impl<'a> Relay<'a> {
RelayLanguageConfig::TypeScript => {
format!("{}.graphql.ts", definition_name)
}
RelayLanguageConfig::JavaScript => {
format!("{}.graphql.js", definition_name)
}
};

if let Some(artifact_directory) = &self.config.artifact_directory {
Expand Down
2 changes: 1 addition & 1 deletion packages/next-swc/crates/core/tests/telemetry.rs
Expand Up @@ -48,7 +48,7 @@ export function getServerSideProps() {
None,
handler,
&Default::default(),
comments.clone(),
comments,
|_| next_ssg(eliminated_packages.clone()),
|_| noop(),
)
Expand Down
2 changes: 1 addition & 1 deletion packages/next/server/config-shared.ts
Expand Up @@ -460,7 +460,7 @@ export interface NextConfig extends Record<string, any> {
relay?: {
src: string
artifactDirectory?: string
language?: 'typescript' | 'flow'
language?: 'typescript' | 'javascript' | 'flow'
}
removeConsole?:
| boolean
Expand Down