GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat: generators by NathanWalker · Pull Request #50 · NativeScript/rfcs

Conversation

@NathanWalker

@NathanWalker NathanWalker commented Dec 30, 2023 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Summary

Right now, there are no built-in generators for building apps. Everything from component creation, to generating types and auto configuring the project for their usage, to creating widgets (iOS and Android boilerplate setup like the folder where it goes and supporting files like extension.json).

Generators help speed up development but can also help encourage best practices from naming things to even initial file setup.

@nativescript/nx and xplat come with generators to help project setup/creation/development however they come with other aspects that make them not as easy to pick up and just use right after setting up a NativeScript development machine.

Basic example

Swift/Kotlin generators for when wanting to drop in either and use with {N} apps, eg:

ns g swift MyFile

ns g kotlin MyFile

This would do several manual steps in one go:

  • create a file with all the structure in place and into right place for {N} app to use right away
  • prompts could occur for those which need it, for example a Kotlin file may ask what package scope it should be in (eg: org.my-company.custom-kotlin)
  • could also work hand/hand to auto create TypeScript declarations based off any changes in those files and auto update project ref's so TS intellisense in the project is always up to date

Integration generators, eg:

// auto integrate flutter screen  
// sets up the podfile/app.gradle to use a folder of Dart code
// registers the flutter screen, creates boilerplate with the vm entry already named and ready for use
ns g flutter MyScreen 

// auto integrate RN modules
// install open-native, configure bundler for all named modules
ns g react-native module,module2,module3

// auto integrate Ionic Portal
// creating the build settings for it too
ns g capacitor MyPortal

// component generators
// would work for all flavors
// create start boilerplate component ready to use
// default to auto detect flavor in  use by introspecting project
ns g component MyComponent --flavor=solid

ns g component MyComponent --flavor=vue

// create web deploy target
// add a web project alongside {N} auto setup to share code with the {N} project - create with any flavor using preferred flavor project creators (prompting to drop in workspace if needed)
ns g web MySite --flavor=angular

Motivation

Improve developer experience and speed up project development.

Drawbacks

Depending on implementation direction chosen, may introduce some maintenance. However there are steps which could be taken to minimize extra maintenance overhead like keeping the generation as minimal as possible reducing surface area of potential external environment changes (like if Solid syntax changed somewhere in a component generated).

The generators could become plug/play as well by other communities to allow easier self sustaining generation by interested communities to allow them to self govern what's generated.

Adoption strategy

Just documentation.

Unresolved questions

Whether various tools out there like builder.io Mitosis could/should be used for component interop with the generator.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

shirakaba, horlarme, herefishyfish, wuilmerj24, and NathanWalker reacted with thumbs up emoji
All reactions
  • 👍 5 reactions
@NathanWalker
feat: generators
a1a7ba5
@cla-bot cla-bot Bot added the cla: yes label Dec 30, 2023
@NathanWalker
chore: cleanup
12ce371
@jcassidyav

jcassidyav commented Jan 23, 2024

Copy link
Copy Markdown

I played around with basic java/kotlin/swift/objective-c generator a while back here.

I got sort of bogged down in:

  • what context should they support

    • simple app
    • plugin
    • nx repo
  • Would this sort of thing be better in a VSCode extension instead.

dyazincahya reacted with rocket emoji
All reactions
  • 🚀 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@NathanWalker NathanWalker mentioned this pull request Jul 3, 2024
feat: native add command to add native source files to the project NativeScript/nativescript-cli#5806
Merged
3 of 5 tasks
@NathanWalker

NathanWalker commented Aug 5, 2024

Copy link
Copy Markdown
Author

One part of this has been addressed in 8.8, ns native add as mentioned here:
https://blog.nativescript.org/nativescript-8-8-announcement/#ns-native

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@wuilmerj24

wuilmerj24 commented Aug 6, 2024

Copy link
Copy Markdown

Hello, I think it would be a good idea to be able to create plugins like this in a future update.
ns create plugin > config plugin and setup > add android and iOS platforms

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

cla: yes

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@NathanWalker @jcassidyav @wuilmerj24
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.