![Create React App Officially Deprecated Amid React 19 Compatibility Issues](https://cdn.sanity.io/images/cgdhsj6q/production/04fa08cf844d798abc0e1a6391c129363cc7e2ab-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
@mrgrain/jsii-extend-interface
Advanced tools
A projen component to easily extend and adapt existing jsii interfaces
A projen component to easily extend and adapt existing jsii interfaces.
Jsii doesn't support TypeScript Utility Types like Partial
or Omit
, making it difficult to extend existing interfaces.
This component works around that limitation by generating a brand new interface based on the jsii specification of the extended interface and its parent interfaces.
From jsii's perspective, these interfaces are completely new types. From a maintainer's perspective, they require the same minimal effort as utility types do. Everybody wins!
Install with:
npm install --save-dev @mrgrain/jsii-extend-interface
Use the jsii FQN to extend an existing interface.
Use omit
to remove any properties you are not interested in.
new JsiiInterface(project, {
name: 'MyProjectOptions',
extends: 'projen.typescript.TypeScriptProjectOptions',
omit: ['sampleCode', 'projenrcTs', 'projenrcTsOptions']
});
New properties can be added with a @jsii/spec
definition.
Complex types can be used and will be imported using their FQN.
Any existing properties of the same name will be replaced.
new JsiiInterface(project, {
name: 'MyProjectOptions',
extends: 'projen.typescript.TypeScriptProjectOptions',
props:{
booleanSetting: {
type: { primitive: jsii.PrimitiveType.Boolean }
},
complexSetting: {
type: { fqn: "my_project.SomeEnum" }
}
}
});
Existing properties can be updated.
The provided partial @jsii/spec
definition will be merged (non-recursively) with the existing spec.
new JsiiInterface(project, {
name: 'MyProjectOptions',
extends: 'projen.typescript.TypeScriptProjectOptions',
updateProps:{
typescriptVersion: {
optional: false,
},
sampleCode: {
docs: {
summary: 'New summary',
default: 'false',
}
}
}
});
Extending an existing interface is optional. The component can be used to generated interfaces from scratch.
new JsiiInterface(project, {
name: 'MyProjectOptions',
props:{
complexSetting: {
type: { fqn: "my_project.SomeEnum" }
}
}
});
The default configuration makes assumptions about the new interface that are usually okay.
For more complex scenarios fqn
, filePath
and importLocations
can be used to influence the rendered output.
new JsiiInterface(project, {
name: 'MyProjectOptions',
extends: 'projen.typescript.TypeScriptProjectOptions',
fqn: 'my_project.nested.location.MyProjectOptions',
filePath: 'src/nested/my-project-options.ts',
importLocations: {
'my_project': '../enums'
},
props:{
complexSetting: {
type: { fqn: "my_project.SomeEnum" }
}
}
});
FAQs
A projen component to easily extend and adapt existing jsii interfaces
The npm package @mrgrain/jsii-extend-interface receives a total of 0 weekly downloads. As such, @mrgrain/jsii-extend-interface popularity was classified as not popular.
We found that @mrgrain/jsii-extend-interface demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.