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: default to vanilla JS instead of React #387

Merged
merged 1 commit into from
Jul 9, 2020
Merged

Conversation

chadoh
Copy link
Contributor

@chadoh chadoh commented Jul 2, 2020

Our user testing showed that not everyone was excited about defaulting to React.

Furthermore, defaulting to Vanilla and changing the argument syntax makes it easier to support new frontend templates (and other smart contract languages) down the road.

@chadoh chadoh self-assigned this Jul 2, 2020
@chadoh chadoh force-pushed the default-vanilla branch from ebab75c to 605537a Compare July 2, 2020 11:42
@mikedotexe
Copy link
Contributor

Let's remember this page in docs, too
https://docs.near.org/docs/quick-start/create-near-app

console.log('Error: ', e);
process.exit(1);
}
};
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed this function, since I believe this is the default behavior. If JavaScript encounters an error, it stops executing and logs the error.

command: '$0 <projectDir>',
desc: 'create a new blank react project',
builder: (yargs) => yargs
.option('projectDir', {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Listing this as an option made it show up in the help output alongside --rust and --vanilla options, which is not correct. I've moved a streamlined version of this .command right into the yargs block at the bottom.

.option('contract', {
desc: 'language for smart contract',
choices: ['assemblyscript', 'rust'],
default: 'assemblyscript'
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've renamed this from asc to assemblyscript everywhere for the purpose of making the --help output easier to understand without insider knowledge.

@mikedotexe
Copy link
Contributor

@mikedotexe
Copy link
Contributor

@mikedotexe
Copy link
Contributor

worth combing through the Google Slides to see if those need to be changed, too

@mikedotexe
Copy link
Contributor

chadoh added a commit to near/docs that referenced this pull request Jul 2, 2020
`create-near-app` is being updated to default to vanilla JS in near/create-near-app#387

there have been some other changes lately, too, and this updates the
docs to match

additionally, I doubt it makes sense to have an entire dedicated page
for `create-near-app` in the docs, so I've removed it. This sets us up
to have duplicated docs here and in the `create-near-app` README. This
moves us closer to a single source of truth and makes the docs easier to
maintain.
chadoh added a commit to near/near-cli that referenced this pull request Jul 2, 2020
near/create-near-app#387 removed the --vanilla flag and made vanilla JS
the default; we can remove this flag here
@chadoh
Copy link
Contributor Author

chadoh commented Jul 2, 2020

Thanks, @mikedotexe! I created draft PRs in the repos you noted above (see linked PRs above), except for the one in near-examples. I noticed that we have a few simple references to create-near-app in our examples; I'll clean all of these up and push right to master once we get this one merged. See below:

Screen Shot 2020-07-02 at 17 28 02

I also looked through a bunch of our slides and updated where needed. Not sure I caught all of them, but I caught a bunch in the workshops we'll likely do over & over, such as the intros to Rust and AssemblyScript.

@chadoh
Copy link
Contributor Author

chadoh commented Jul 3, 2020

@ashleynear @potatodepaulo I know y'all didn't scope this for near/devx#220, but I did it now anyhow because I think it's a necessary prerequisite to having someone complete near/bounties#17 (add a Vue template to create-near-app) or similar bounties in the future. Why? If you were a community contributor, would you feel confident suggesting changes to the shape of the flags used by create-near-app? Probably not. So when you see that right now we only have two flags, --vanilla and --rust, you'd probably add --vue. And that's going to result in some really annoying code throughout the index.js file.

But with this change, adding --frontend=vue is going to be very straightforward. A community contributor will be able to make improvements with confidence.

janedegtiareva pushed a commit to near/near-cli that referenced this pull request Jul 6, 2020
near/create-near-app#387 removed the --vanilla flag and made vanilla JS
the default; we can remove this flag here
janedegtiareva added a commit to near/near-cli that referenced this pull request Jul 6, 2020
* fix: update test with create-near-app assumptions

the structure of create-near-app changed in v1 and we need to change
this test to match

the commit that changed it is here: near/create-near-app@7ab9ae3

* refactor: remove obsolete --vanilla flag

near/create-near-app#387 removed the --vanilla flag and made vanilla JS
the default; we can remove this flag here

* Fix CI

* Update expected output from view call

Co-authored-by: Jane Degtiareva <jane.degtiareva@gmail.com>
@chadoh chadoh force-pushed the default-vanilla branch from 605537a to 7e9e888 Compare July 8, 2020 22:18
@chadoh chadoh requested a review from janedegtiareva July 8, 2020 23:46
@chadoh chadoh dismissed janedegtiareva’s stale review July 9, 2020 00:08

concern addressed in comment

@chadoh chadoh force-pushed the default-vanilla branch from 7e9e888 to 1bcc17f Compare July 9, 2020 01:04
Our user testing showed that not everyone was excited about defaulting
to React.

Furthermore, defaulting to Vanilla and changing the argument syntax
makes it easier to support new frontend templates (and other smart
contract languages) down the road.
@chadoh chadoh force-pushed the default-vanilla branch from 1bcc17f to 8264796 Compare July 9, 2020 11:24
@chadoh chadoh merged commit df22a0c into master Jul 9, 2020
@chadoh chadoh deleted the default-vanilla branch July 9, 2020 13:01
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

Successfully merging this pull request may close these issues.

3 participants