create-near-app icon indicating copy to clipboard operation
create-near-app copied to clipboard

Only create frontend template

Open ilblackdragon opened this issue 3 years ago • 4 comments

Currently by default it creates a full stack application. Which means that if building for existing app - need to deal with all the contract stuff. Ideally something like --frontend flag

ilblackdragon avatar Dec 15 '20 12:12 ilblackdragon

How about --no-contract or --contract none

chadoh avatar Dec 15 '20 12:12 chadoh

--contract none is interesting given this flag already exists

On Tue, Dec 15, 2020 at 4:44 AM Chad Ostrowski [email protected] wrote:

How about --no-contract or --contract none

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/near/create-near-app/issues/609#issuecomment-745264763, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABK27VQKW472HWW5UNA5STSU5K3VANCNFSM4U4IBYBQ .

-- Best regards, Illia Polosukhin

ilblackdragon avatar Dec 15 '20 15:12 ilblackdragon

An interesting idea I had; I'm not sure I like this or not: a value to --contract other than rust or assemblyscript is assumed to be an account name, and will result in no contract directory being added to the project, and the frontend contract initialization instead will be initialized to connect to the given --contract value. Once we have a good metadata API, we can also add the proper viewMethods and changeMethods, but for now we can add a TODO comment to the spot where the contract is initialized.

Thoughts?

chadoh avatar Dec 16 '20 20:12 chadoh

This is interesting in principle, but I want to point out that many frontends would work with various different contracts of the same shape. E.g. multisig, lockups, DAOs, etc.

Also names on mainnet and testnet will be different.

So yeah, it should be more pointing at contract metadata to generate the view methods. That said I haven't personally ever used Contract abstraction - account.functionCall works fine and you don't need to specify stuff ahead of time.

Obviously, in TypeScript world having more strict typing probably is better but not sure if your current Contract abstraction actually does that.

I would also avoid overloading one parameter with multiple meaning - this is generally a counter-pattern

On Wed, Dec 16, 2020 at 12:43 PM Chad Ostrowski [email protected] wrote:

An interesting idea I had; I'm not sure I like this or not: a value to --contract other than rust or assemblyscript is assumed to be an account name, and will result in no contract directory being added to the project, and the frontend contract initialization instead will be initialized to connect to the given --contract value. Once we have a good metadata API, we can also add the proper viewMethods and changeMethods, but for now we can add a TODO comment to the spot where the contract is initialized.

Thoughts?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/near/create-near-app/issues/609#issuecomment-746983804, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABK27SSKYVIB56SJXT6JZDSVELWBANCNFSM4U4IBYBQ .

-- Best regards, Illia Polosukhin

ilblackdragon avatar Dec 19 '20 10:12 ilblackdragon

4 years later, create-near-app creates either a contract or a frontend.

gagdiez avatar Jan 16 '24 10:01 gagdiez