Giter VIP home page Giter VIP logo

developer-relations's Introduction

@page DoneJS @hide title @hide sidebar

DoneJS logo

npm version Build Status Build Status Coverage Status

DoneJS is the easiest way to get a high-performance, real-time, web and mobile application done! The framework provides a nearly comprehensive combination of technologies for building complex JavaScript applications.

If you are looking for the fastest way to get a fully modern development environment setup and produce a lightning fast application, you’ve come to the right place.

DoneJS is a combination of the following technologies:

  • StealJS — ES6, CJS, and AMD module loader and builder
  • CanJS — Custom elements and model-view-viewmodel (MVVM) utilities
  • jQuery — DOM helpers
  • jQuery++ — Extended DOM helpers
  • QUnit or Mocha — Assertion library
  • FuncUnit — Functional tests
  • Testee or Karma — Test runner
  • DocumentJS — Documentation
  • can-ssr — Server-side rendering utilities for CanJS

DoneJS is an npm package that simply installs all the previous technologies. Check out DoneJS.com for the collective benefits of these technologies and guides on how to use them together to build an amazing application.

Contributing

Greenkeeper badge

Check out the contribution guide on DoneJS.com.

developer-relations's People

Contributors

chasenlehara avatar cherifgsoul avatar nlundquist avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

developer-relations's Issues

Use nightmare instead of zombie?

Zombie docs are really lacking, making it hard to use, and it's not very robust (you can't take screenshots, is limited by jsdom). Maybe it's faster but getting up and running with it is slow.

Perhaps Nightmare might be a better alternative? It uses Electron and looks like it has more comprehensive docs.

https://github.com/segmentio/nightmare

JavaScript Linters

JSHint

Started Contributors Commits Issues PRs Plugins?
2010 230 1,929 337 68

ESLint

Started Contributors Commits Issues PRs Plugins?
2013 486 5,698 209 41

Prettier

Started Contributors Commits Issues PRs Plugins?
2016 68 645 91 10

Importance of Plugins

I can imagine some use-cases for a linter that accepts plugins; such as linting the @tag code comments that bit-docs supports.

At any rate, I feel this is an important feature to have, and we could probably start making use of it right away.

Both ESLint and Prettier support plugins, but JSHint does not. For this reason, I think JSHint should be taken out of the running; JSHint hasn't discussed adding a plugin system since 2015.

See ESLint's "Working with Plugins".

Rewriting Files vs. Giving a Warning

Prettier actually rewrites the files that it lints. It takes the JavaScript in the file, parses it into AST, and spits it out.

This in contrast to how ESLint simply gives a warning and leaves the fixing up to you.

Supposedly the AST strategy of Prettier can catch formatting/style "errors", or inconsistencies that ESLint would miss. The example they give is:

foo({ num: 3 },
  1, 2)

foo(
  { num: 3 },
  1, 2)

foo(
  { num: 3 },
  1,
  2
)

Saying this would be missed by other linters, while Prettier would clean it up.

Maturity

Prettier, started in 2016, comes with a bold warning that it is "beta" and that you should always commit your files before linting them with Prettier, because it rewrites the file and might mess it up:

To format a file in-place, use --write. While this is in beta you should probably commit your code before doing that.

ESLint seems to be the better option as long as Prettier works the way it does, and as long as it comes with that warning. Prettier also warns that the API will probably change, so you will have to reimplement it a couple times before it stabilizes:

Warning: This is a beta, and the format may change over time. If you aren't OK with the format changing, wait for a more stable version.

You can read more about the ESLint philosophy here.

You can read more about the Prettier philosophy here.

Conclusion

Let's discuss:

  1. Do you think we would ever use Prettier in the future, once it finally stabilizes?
  2. Is it worth switching from JSHint to ESLint, for the main benefit of having plugins?
    a. Can you think of any good uses for the plugin system?
    b. Can you think of any other good reasons in support of switching?

Next Steps

Once we've reached a decision, we should re-evaluate what standardized rules we want to put in place for consistent coding.

Should auto scroll to new log or expression messages

When the trace log is populating in Author, it does not scroll down to new messages. If the Author hits Continue to the new page or evaluates an expression, the scroll bar should auto scroll to the bottom to show those new messages.

Evaluate online code editing services

Right now we use JS Bin for most of our examples, but I don’t think it supports everything we would need to do something like debug DoneJS issues. It doesn’t support some features (like multiple files), and it’s not the preferred tool by some Bitovi developers.

It would be great to evaluate the different options and determine whether we can start using one that better supports our needs. Outlining our needs (coming up with criteria) would be a great first step to working on this.

Examine our analytics

Right now we’re collecting a lot of analytics data but we’re not putting it to good use. Examine the analytics we’re collecting and determine how we can use the data.

Add CONTRIBUTING.md

Add a CONTRIBUTING.md file to each repo that links to either the DoneJS contribution guide (coming soon!) or a more specific one (e.g. the CanJS contribution guide for a CanJS project).

If there’s already a contribution guide in a repo’s README, then move it to CONTRIBUTING.md and format it similarly to the DoneJS contribution guide.

Otherwise, you can use the DoneJS contribution guide as an outline for what should be included. You can look at related projects to see how their templates were customized and here are some example commits that show updating a project to meet these guidelines:

Of course, if you’re unsure, please reach out to ask questions or open a PR anyway and we’ll fix it in the review process. Thank you for your help!

Below is a list of all the repos. Check off the repo once you’ve submitted a PR for it.

Analysis of GitHub Pages

I'm in the process of building a GitHub Pages website for the bit-docs organization.

However, there isn't a standardized methodology for using GitHub Pages across our organizations, and there are sizable deviations between the various implementations.

This post serves to document and compare the different strategies currently being implemented by each organization, in order to help decide on the best method for use within the bit-docs org.

It may also benefit the analyzed organizations by giving them an idea of how they might improve. Lastly, it should help someone who is new to these organizations navigate the projects.

Available Settings

These are the relevant settings and options that can be used in whatever way is seen to be fit.

"GitHub Pages"

GitHub Pages

What this means: Any branch can be set as the "GitHub Pages" branch.

"Default Branch"

Default Branch

What this means: Any branch can be set as the "Default Branch".

Current Paradigms

Each organization (DoneJS, CanJS, StealJS, etc) has taken a unique approach to generating their respective documentation websites.

The following section will investigate the facts, and evaluate the pros or cons of each approach.

DoneJS-next:

cd path/to/donejs
npm run document
cp -r site/* path/to/donejs-next
cd path/to/donejs-next
git add -A
git commit -am 'updating site'
git push

Analysis of the DoneJS-next approach

This is nice and clean, but requires too much user interaction. Setup could be tedious/error prone.

Proves that it's possible to have a GitHub Pages repo with a single master branch, but not so sure about the paradigm of pushing from the main repo towards the website repo; having the website repo pulling from the main repo towards itself is probably better because it would be more versatile if it was needing to pull from multiple sources.

To enable the website repo pulling in, rather than the current paradigm of being pushed towards, would require a second branch to hold the configuration that does the pulling in. So, then, the current master would become gh-pages, and master would be repurposed to hold configuration.

CanJS:

publish-docs:
	npm install
	git checkout -b gh-pages
	./node_modules/.bin/bit-docs -fd
	rm -rf test/builders/
	git add -f test/
	git add -f doc/
	git add -f index.html
	git add -f node_modules/can-*
	git add -f node_modules/es6-promise
	git add -f node_modules/steal
	git add -f node_modules/steal-*
	git add -f node_modules/when
	git add -f node_modules/jquery
	git add -f node_modules/jquery-ui
	git add -f node_modules/funcunit
	git add -f node_modules/syn
	git add -f node_modules/socket.io-client
	git add -f node_modules/feathers/package.json
	git add -f node_modules/feathers-authentication-client/package.json
	git add -f node_modules/feathers-hooks/package.json
	git add -f node_modules/feathers-rest/package.json
	git add -f node_modules/feathers-socketio/package.json
	git checkout origin/gh-pages -- CNAME
	git checkout origin/gh-pages -- release/
	git commit -m "Publish docs"
	git push -f origin gh-pages
	git rm -q -r --cached node_modules
	git checkout -
	git branch -D gh-pages

Analysis of the CanJS approach

This might not be an ideal setup because the Makefile treats the main repo as a scratch directory, pulls in files from the remote instead of using the local copies, force pushes, and automates the deletion of files and branches. This script is a good start but seems a bit fragile.

To improve this, I would:

  • Avoid that kind of straightforward branch checkout.
    • May need to add some logic.
    • There may be more subtle ways of doing this that don't affect the current index.
  • Avoid git checkout origin/gh-pages -- if possible.
  • Avoid any kind of automated rm -rf or git branch -D.
  • Build and copy files to a single output directory (wisdom from Yeoman)
    • This would allow the .gitignore to be simplified, and would replace the git add -f calls with harmless copy commands that don't modify the index against .gitignore's will.
    • Consolidating all built files to a single location makes it easier to see what is included, for debugging, and to package up for sharing (we're interested in "sharing" to gh-pages).
    • Aside: Take note of this trick.

StealJS:

  • Dedicated repo!
    • However, the repo name stealjs/stealjs can be confusing.
    • Perhaps stealjs/website would be more obvious.
  • Has two branches: master and gh-pages.
  • The StealJS org repos own their documentation in respective doc folders (not the usual docs).
    • Note: This breaks convention with what bit-docs does by default, by using the dest option to essentially swap the default of doc for docs, so source is now looked for in doc and generated files are output to docs. This is fine, just something to take note of.
  • It's not entirely clear how the generated files are pushed to the gh-pages branch, but probably a force add (similar to the CanJS Makefile) to subvert the .gitignore.

Analysis of the StealJS approach

Mixing source and built files (on the gh-pages branch) is bad. The repo name stealjs/stealjs is somewhat misleading because, for all the other organizations, the redundantly-named repo (f.ex: canjs/canjs or donejs/donejs) is the main repo for the product, not just the product's website.

Compared to how CanJS and DoneJS do GitHub Pages, this is the most straightforward approach, but it is lacking instructions or a build script for pushing to gh-pages, and would be better if it didn't mix source files into the gh-pages branch.

Document CSS:

Analysis of the Document CSS approach

The Grunt plugin is a nice abstraction, and would be a clean and useable solution.

Branching Strategies: master and/or gh-pages

Take Aways

Due to the fact that most organizations will need the ability to pull in multiple sources for generating to a single website, it would seem the best option would be to always create a separate, dedicated repository for holding the website so this dedicated repo can have two branches; one for holding configuration that pulls in and builds the sources, and one that holds the generated output only.

It is best practice to compile all built files to a single directory, and to commit that directory to the appropriate website repo branch in a non-destructive manner. It is imperative that the branch containing the source files is not polluted with built files in commit history, and vice versa. This means the source branch should .gitignore the directory containing built files, and the built branch should contain nothing but the contents of that generated directory. A final recommendation would be to give the dedicated repository an obvious name, such as YourOrg/website.

Recommended Solution

Create a bit-docs plugin that essentially:

  • Does subtree push.
    • Probably not, because this requires built directory to be in master's history.
  • Copies this logic.
    • Creates a git repo in the built directory:
      • git init
    • Adds the remote:
    • Creates branch gh-pages if it does not exist:
      • git checkout --orphan gh-pages
      • git symbolic-ref HEAD refs/heads/gh-pages
      • git reset
    • Fetches gh-pages history from the remote (if gh-pages exists):
      • git fetch --update-head-ok --progress --verbose remote-ee0138 gh-pages
    • Commits changes to gh-pages:
      • git add -A .
      • git commit --file=commitFile-184a81
    • Pushes gh-pages to remote:
      • git push remote-ee0138 gh-pages
    • Warns if there are uncommitted changes in your working directory.
    • If a file is removed from the built directory, it is successfully removed on gh-pages remote.
      • This alleviates the need to force push.
      • This means the gh-pages history can remain intact.
  • Wraps this npm package (will try first).

Whatever best accomplishes the suggested Take Aways.

Then, use this plugin in bit-docs/website.

Highlight guides related to our tech on our websites

In addition to a Guides section on each project site, it’d be helpful if we linked to guides published elsewhere on the web and included links to those guides in the relevant docs, e.g. linking to any guides that use can-route in the can-route docs.

Use 2 spaces instead of 4 spaces (or tabs) in *.md

If you use Spaces — 2, you can indent lists:

image

However, if you try and do the same thing with Tabs — 2 or 4, indenting always results in code formatting:

image

So, 2 spaces gives the most flexibility, because you can do:


  • list item
  • another

AND:

- list item in code format
- another in code format

Like that:


  - list item
  - another

AND:

    - list item in code format
    - another in code format

This means .editorconfigs like this should look more like:

; Unix-style newlines
[*]
end_of_line = LF
indent_style = tab
indent_size = 4

[{*.json,*.yml,*.md}]
indent_style = space
indent_size = 2

(notice addition of *.md)

CanJS GitHub example app design

Design a UI for an app that:

  • Has a form for creating a new issue (at least the title and description)
  • Shows a list of GitHub issues (at least the title and first line of the description)
  • Has controls for reordering the list of issues via drag & drop

I think the list will automatically save, so a separate save button isn’t required.

Use of checkboxes in .github/ISSUE_TEMPLATE.md

We might want to rethink the use of checkboxes in .github/ISSUE_TEMPLATE.md because it causes the issue list to show a "progress bar" (1 of 1 or 1 of 5) like this:

image

EDIT:

Perhaps we could replace

<!-- Use [x] to mark your choice. -->

with something like

<!-- Delete everything but your choice. -->.

Add links to our blog posts to our docs

It’d be helpful if we:

  • Had a section on each project site that listed the various blog posts that were available, both what we publish and elsewhere on the web.
  • Included links to those blog posts in the relevant docs, e.g. linking to all the can-route blog posts in the can-route docs.

Add new DoneJS command to print generator version

Right now in the generator-donejs ISSUE_TEMPLATE.md it asks for generator-donejs version but there is no convenient way to print this out.

Therefore I suggest we add a command to DoneJS that is the equivalent of what I do now to get that information:

cat node_modules/generator-donejs/package.json | grep '"version":'

Currently I'm not sure what the syntax of this command should be or in which repo the code for the command would need to live.

Add issue & pull request templates

Here are the issue & pull request templates that were added to DoneJS: donejs/donejs#805

Be sure to customize the template depending on the needs of the project. You can look at related projects to see how their templates were customized and here are some repos that follow these guidelines:

Of course, if you’re unsure, please reach out to ask questions or open a PR anyway and we’ll fix it in the review process. Thank you for your help!

Below is a list of all the repos. Check off the repo once you’ve submitted a PR for it.

Proposal: Easier debugging across related projects

I propose we make it easier to locally debug interdependent projects.

I've run into three instances so far (outlined below) where I've had to modify source code when, ideally, I should have just been able to add my local dependency to package.json and that's it.

We need to facilitate these common workflows (probably a couple if checks in the various source codes would suffice) and should document any additional steps in the appropriate CONTRIBUTING.md


1: donejs/donejs + donejs/generator-donejs

donejs/generator-donejs#135 (comment)


2: donejs/donejs + donejs/cli

donejs/cli#82 (comment)


3: bit-docs/bit-docs + project using bit-docs + local html generation plugin

I have to publish my package:

https://www.npmjs.com/package/bit-docs-website-theme

Just in order to use it locally. Seems like I should be able to do:

"bit-docs-website-theme": "file:///Users/leoj/src/bitovi/wip/bit-docs-website-theme"

In package.json, but that causes a 404 failure because some part of code insists on DLing from npm when I do ./node_modules/bit-docs/bin/bit-docs -fd.

So, I was forced to publish this package just to test it out, because I can't locate the bit of code that is attempting npm download, and making everything fail.

It's probably a similar case to that which I ran into when trying to locally debug the DoneJS CLI:

donejs/generator-donejs#135 (comment)

It seems like there must be some facility for debugging packages locally, without having to publish to npm constantly?

There must be a better way than adding INJECTING LOCAL COPY hacks (like I do in the link below), Right?

donejs/cli#82 (comment)

If not, a facility to allow local debugging would be a great thing to add into the frameworks in these places where it currently forces the use of remote npm.

Standardize "plugin" architecture across organizations

bit-docs, CanJS, StealJS and DoneJS all have different ways of specifying plugins to use with their respective core libraries.

I'd like to open up a discussion about the possibility of developing a standardized format for plugins.

A certain level of autonomy across orgs is of course a good thing, but I think this is one case where some cohesion would greatly benefit the user.

Standardize the labels in our GitHub repos

It’d be great if we consistently used the same labels across all of our GitHub repos.

Here are the ones that GitHub includes with new repos:

  • bug
  • duplicate
  • enhancement
  • help wanted
  • invalid
  • question
  • wontfix

Here’s what we regularly use as well:

  • design
  • developer relations
  • documentation
  • easy
  • p0, p1, p2, p3, & p4
  • regression

We can use github-label-sync to accomplish this goal. Ideally, this repo would contain a script that could be run whenever we needed to re-synchronize our labels.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.