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

Is this a sample project or a dev tool? #51

Open
WofWca opened this issue Sep 4, 2023 · 6 comments
Open

Is this a sample project or a dev tool? #51

WofWca opened this issue Sep 4, 2023 · 6 comments

Comments

@WofWca
Copy link
Contributor

WofWca commented Sep 4, 2023

The first couple of lines of README say

Sample project with a simple implementation of the webxdc read and write APIs.

  • the repo is marked as "template"

But for a sample project this looks a little too convoluted, e.g. the "Limitations" section in README looks unnecessary for a sample project, this sounds more like it applies to the webxdc.js stub dev tool. This makes it look like it's required reading to know how this sample project works, which it isn't.
I think sample project must be as short and easy to swallow as possible. We have this in https://docs.webxdc.org/get_started.html#a-simple-example, but I don't know, it looks like we're saying that this is the repo of that simple example.

If it's a dev tool, we shouldn't be regarding it as a sample project in https://docs.webxdc.org/.

I think we need to clearly separate the stub webxdc.js and the sample index.html into different projects (also see "Stop the copy-paste of create-xdc.sh, webxdc.js").

@WofWca WofWca changed the title Is this a sample project or a development tool? Is this a sample project or a dev tool? Sep 4, 2023
@adbenitez
Copy link
Collaborator

we should separate the emulator and typescript types definition to a node package developers can install as dev dependency without copying files manually, and the package could offer a vite plugin to transparently inject webxdc.js file without needing the file copied manually

@adbenitez
Copy link
Collaborator

adbenitez commented Sep 4, 2023

we already have https://www.npmjs.com/package/webxdc-types but it is completely different from webxdc.d.ts in the hello repo, we need to merge webxdc.d.ts to that package

@WofWca
Copy link
Contributor Author

WofWca commented Sep 4, 2023

the package could offer a vite plugin

Idk, it doesn't sounds like a good reason to add Vite, it's just a matter of cp node_modules/webxdc-js-stub/webxdc.js ..

@adbenitez
Copy link
Collaborator

the vite plugin is an extra feature the module can provide, you don't need "to add vite" providing a vite plugin is basically exporting a function that does something and users add to their plugin section in vite config, if you/user don't use vite ok just copy the file manually every time and implement your own equivalent of vite plugin thing

@r10s
Copy link
Collaborator

r10s commented Sep 7, 2023

I think we need to clearly separate the stub webxdc.js and the sample index.html into different projects

well not sure if splitting into two projects helps here, that may result in a subproject inside hello or so, or forcing some packet manager. both with all its troubles. i am not sure that makes things easier to understand and helps onboarding devs.

i think, "hello" is great as a pattern esp, for ppl that are not familiar with js, packet manager or git tooling, just having very few files that one can start with and understand things. i do not see it as an issue if things are duplicated afterwards, eg. create-xdc.sh needs to be adapted anyways (sure, you can do that with vite and whatnot - but you would have to learn it as well)

so, not against adding other tooling and projects and examples - but we should really keep things simple in hello, no npm, no typescript, no packet manger, no transpiling, no git specials.

as long as we make things simpler in hello, of course, we can adapt here as well. also the README can be improved, for sure

to answer the initial question: it is a sample project that can act as a dev tool :)

@WofWca
Copy link
Contributor Author

WofWca commented Sep 8, 2023

forcing some packet manager

We can make a separate project for the stub webxdc.js while keeping webxdc.js in this project as a copy-pasted file, stating where the file is coming from (see #52), like it sort of is with webxdc.d.ts (see #53).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants