Skip to content

update docs #64

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

Closed
2 tasks done
icebob opened this issue Sep 2, 2016 · 16 comments
Closed
2 tasks done

update docs #64

icebob opened this issue Sep 2, 2016 · 16 comments

Comments

@icebob
Copy link
Member

icebob commented Sep 2, 2016

@icebob icebob changed the title update docs to new version update docs Sep 2, 2016
@lionel-bijaoui
Copy link
Member

I have updated the doc and completed some stuff. Please tell me if you find some problem. I tried to sort properties alphabetically but it is not yet consistent (some field are not sorted yet).
I will now finish the test for #63

@icebob
Copy link
Member Author

icebob commented Sep 5, 2016

Thanks! I will check it.

@lionel-bijaoui
Copy link
Member

lionel-bijaoui commented Sep 6, 2016

I just realized fieldStaticMap is not in the doc...
EDIT : I created the entry, can you fill in information ? https://www.gitbook.com/book/icebob/vueformgenerator/edit#/edit/master/fields/staticmap.md

@icebob
Copy link
Member Author

icebob commented Sep 6, 2016

Hmm, it was a quick test field only. But it stay. I fill the docs, thanks.

@icebob
Copy link
Member Author

icebob commented Sep 8, 2016

🎉 v0.4.1 released
https://github.com/icebob/vue-form-generator/releases/tag/v0.4.1

@lionel-bijaoui
Copy link
Member

Sorry about the pressure. If you want I can help with the custom fields if you give me a topo.

@icebob
Copy link
Member Author

icebob commented Sep 8, 2016

It would be good.

For custom fields:
Write some sentences about if you need an extra custom field. you can create it yourself.
Main points:

  • use VueFormGenerator.abstractField as a mixins for your field
  • register the new field as a global components
  • and use it on your schema

And add some code snippet from dev as a sample:
Example custom field: https://github.com/icebob/vue-form-generator/blob/master/dev/fieldAwesome.vue
Register globally: https://github.com/icebob/vue-form-generator/blob/master/dev/app.vue#L44
Use in the schema: https://github.com/icebob/vue-form-generator/blob/master/dev/schema.js#L183

@lionel-bijaoui
Copy link
Member

This is very powerful. How about we make it possible to choose which fields to load ? For example Keen UI does that.
You can choose to load all or individual components. That would reduce the size of the plugin (right now it is bigger than Vue.js once build with Webpack).

@icebob
Copy link
Member Author

icebob commented Sep 8, 2016

I think it is not neccessary. Because the code of fields is tiny. Check this webpack stat:
image
You can see, the code of fields is only 1.8% of the whole size. The full src folder is only 2%.
The big parts is vue, moment, and lodash.

@icebob
Copy link
Member Author

icebob commented Sep 8, 2016

You can check too, if you make a build and drop the stat.json file to https://chrisbateman.github.io/webpack-visualizer/

@lionel-bijaoui
Copy link
Member

why is lodash so big ? It seem like we only use some functions from it.
How about we unpack Moment.js ? Make it a dependency of vue form generator ?
For example, I will use Moment.js (and maybe lodash) in my project alongside vfg. Will Webpack understand that there is common chunks (I don't think so because it is minified) ?
After all, using it inside vfg is not magically removing the dependency it have from those libs. It just doesn't allow for optimized bundling later on and space lost for no good reason.

@icebob
Copy link
Member Author

icebob commented Sep 11, 2016

I think, this stats made before Dedupe, so it contains unused parts too. I think it, because stats.json said the full size is 1.2MB, but the bundle size is only ~400kB after build.

In a separated branch we can try to remove these dependencies and use as external deps. But I don't know, how we do that, Because if we set these libs to externals in webpack config, it will try to load from global var. But it won't work if you are try to using vfg from other webpack project. More information: https://webpack.github.io/docs/library-and-externals.html

@lionel-bijaoui
Copy link
Member

lionel-bijaoui commented Sep 12, 2016

I'm going to test it. A very modularized version of the app would be a plus.
My goal is:

  • a simple, all in one (except for CSS of course) bundled JS.
    The user only need to include the lib with a script tag and it work as expected (like today build).
  • a commonjs version with dependency and the possibility to load individual fields or not (some fields have dependency that other don't so it could save some space in the end).

The link you provided give me everything I need to make it work.
EDIT: I opened a new issue for that #67

@lionel-bijaoui
Copy link
Member

@icebob can I merge the doc with master ?
https://www.gitbook.com/book/icebob/vueformgenerator/edit#/edit/custom-fields/fields/custom_fields.md

@icebob
Copy link
Member Author

icebob commented Sep 12, 2016

Yes please. Thank you!

@icebob icebob closed this as completed Sep 12, 2016
@Rchanger
Copy link

how can i provide the schema through json file .

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

No branches or pull requests

3 participants