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

Update to Webpack 3. Almost all dependency are updated. #357

Merged
merged 56 commits into from
Mar 9, 2018

Conversation

lionel-bijaoui
Copy link
Member

Reorganisation of the config files. Now use Prettier, so most files are will need to be updated to validate. This is stil an early WIP.

Known bugs: validation is broken since rewritten in without "module.exports"

icebob and others added 2 commits December 5, 2017 22:10
…nced-validate-fix

fixes vue-generators#345 - declare debouncedValidateFunc
…n of the config files. Now use Prettier, so most files are will need to be updated to validate. This is stil an early WIP.

Known bugs: validation is broken since rewritten in without "module.exports"
@lionel-bijaoui lionel-bijaoui mentioned this pull request Dec 6, 2017
11 tasks
@lionel-bijaoui
Copy link
Member Author

lionel-bijaoui commented Dec 6, 2017

  • Many things are still to fix and change. My goal is passing eslint with prettier rules on all files in src and dev while having everything work as before.
  • Only npm run dev was tested. npm run build still need to be updated.
  • I have broken the validation. We can't use module.exports anymore, and while changing that I clearly broke the validation mechanism. @icebob I will need your help to fix it.
  • I have moved files around (it copy the vue + webpack template). I tried some refactoring on the dev files, putting things in common and unifying as much as I was able to.
  • Constructive feedback and new ideas are welcome.

@zoul0813
Copy link
Member

zoul0813 commented Dec 6, 2017

Will review tomorrow morning

@zoul0813
Copy link
Member

zoul0813 commented Dec 7, 2017

I'm not sure if I'm comfortable with merging this in, as it's currently in an unusable state. The broken validators are a major issue, for example, as is the broken npm run build.

I like the direction you're heading in though.

Perhaps we should have two branches for v3? One as a 'v3-master' and another as a 'v3-dev'. This way we can merge "broken" code in so everyone can contribute to fixing it, and another for "stable" v3 changes?

@lionel-bijaoui
Copy link
Member Author

This is not supposed to be ready to merge yet.
This is a (bleeding edge) proof of concept and I will need more time to finish it then I will ask for a merge.
As i said :

My goal is passing eslint with prettier rules on all files in src and dev while having everything work as before.

I want feedback from the collaborator on the direction I going with this.
I don't want to work on my side and then realized no one like the way I organized the files, the prettier config or something like that.

My biggest problem is my lack of time, since at work, we are very close to the big launch + Holidays coming.
I'm doing my best to create a solid base for the future of VFG, please give me time ⌛️ and feedback ⚡️

Copy link
Member

@icebob icebob left a comment

Choose a reason for hiding this comment

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

Good job. Thanks!

zoul0813 and others added 20 commits December 12, 2017 12:02
…rmatValueToModel`

* Updated to fecha 2.3.2

* Moved the majority of logic from computed.value.set() to new `updateModelValue(newValue, oldValue)` method to allow other components to use similar techniques.
If `formatValueToModel` returns a function, then the function is called without setting the model value.  It is the functions responsibility to call `this.updateModelValue(newValue, oldValue)`.
Otherwise, calls `this.updateModelValue(newValue, oldValue)` to execute the original logic.

* If the input type is date, datetime, or datetime-local then it creates a debounced function for setting the value in fieldInput's mounted hook and then returns a function that calls this debounced function from `formatValueToModel`

* Reduced the repeated code for date formatting by adding a DATETIME_FORMATS constant, and using that to
get the "format" for fecha.parse()
…echa

fixes vue-generators#341 - introduced debounce functionality into `formatValueToModel`
…/range inputs, debounce `formatValueToModel` for number/range, removed `formatValueToField`

Number inputs now support `10e10` formats being typed in, and stores the evaluated value of `10e10` (`100000000000`) on the model.

* moved debouncedFormatDateTime to abstractField and renamed to debounceFormatFunc
* create a `debounceFormatFunc` for number/range inputs, as well as date/datetime/datetime-local
* changed @input to use `onInput` handler which checks for number/range and uses $event.target.valueAsNumber per @YgamiLight
* set value to NaN if !isNumber(value) (NOTE: NaN is represented as "null" in JSON though as JSON does not support NaN/Infinity)
* set all `inputType` checks and uses to use `inputType.toLowerCase()`, recommend doing this for all fields
* created DEBOUNCE_FORMAT_MS constants in inputField.vue, set to default of 1000 ... recommend turning this into a standard schema option for all fields
* wrapped one-liner conditionals with `{}` (just looks cleaner)
…idator, and returns `invalidIntegerl: "The value is not an integer"` as well as any errors generated by `number`

* wrapped one-liner conditionals/loops with `{}` (looks cleaner)
* simplified some conditionals by merging `if(cond1) { if(cond2) { } }` into `if(cond1 && cond2) { }`
…ield checks for `isNil(value)` and returns `null`, none options are always disabled

* updated tests to reflect "none is always disabled", could possibly be a selectOptions to allow users to select the "none" option to clear a previously selected value?
* added formatValueToField and return `null` when `isNil(value)`
…into feature/362-integer-validator

* 'master' of https://github.com/icebob/vue-form-generator:
  fixes vue-generators#361 - use $event.target.valueAsNumber for number/range inputs, debounce `formatValueToModel` for number/range, removed `formatValueToField`

# Conflicts:
#	dist/vfg-core.js
#	dist/vfg.js
…into feature/340-select-none

* 'master' of https://github.com/icebob/vue-form-generator:
  fixes vue-generators#362 - `integer` validator now calls `number` validator, and returns `invalidIntegerl: "The value is not an integer"` as well as any errors generated by `number`
  fixes vue-generators#361 - use $event.target.valueAsNumber for number/range inputs, debounce `formatValueToModel` for number/range, removed `formatValueToField`

# Conflicts:
#	dist/vfg-core.js
#	dist/vfg.js
…validators

* added `validateAsync` (default: false) form option
* added `isAsync` parameter to FormGenerator.validate()
* FormGenerator.validate() and AbstractField.validate() return Promise when `validateAsync` or `isAsync` is true
* renamed `click` handler to `onClick` in FieldSubmit
* added `onValidationError(model, schema, errors)` to FieldSubmit schema to handle validation errors
* added async validator support for FieldSupport
* changed `each` to `forEach` in various places, as "each" is an alias to "forEach" and "forEach" looks more explicit
* removed call to Vue.util.hyphenate as this is no longer supported by Vue, replaced with equivalent `String.replace` expression
* updated fieldSubmit.spec to add "valid form" and "invalid form" tests, valid forms will always call `onSubmit`, invalid forms will not call `onSubmit` (when validateBeforeSubmit = true)
* various code clean up
…-validation

fixes vue-generators#358 - support "validateBeforeSubmit" with async validators
@lionel-bijaoui
Copy link
Member Author

lionel-bijaoui commented Feb 27, 2018

@zoul0813 There is already vanilla js alternative and jQuery is optional. But I absolutely agree, all fields should be their own project.
It would greatly reduce the weight on our shoulder and make thing clearer (separated issues and all). @icebob was against this idea so it doesn't seem to be something that is going to happen.

I'm doing my best to finish the test as far as I can go and merge. Then I think every collaborator will be able to help. Still a looooot of work toward this new version, this is exciting and frightening 😀

Thank you !

EDIT: I should also mention that I wasn't available last week, that's why I progressed so little for a full week. I should finish before the end of this week. At least that's my goal.

@ChadTaljaardt
Copy link

Should this not be updated to webpack 4 instead of 3?

@lionel-bijaoui
Copy link
Member Author

@ChadTaljaardt This project started before the v4 was even announced. I feel like it will require a lot of changes and I'm not sure the plugin ecosystem is up to date already.
Maybe later this year will we be able to update. I don't want to lose more time on this.

@zoul0813
Copy link
Member

I thought @icebob said splitting the optional fields out was a good idea - could be mistaken, lots of discussions going on. I was under the impression the new group organization was setup to help facilitate the split of the optional fields into different packages (as well as create more projects with similar goals).

@lionel-bijaoui
Copy link
Member Author

I may have misunderstood. You are right, this new organization is perfect for that. Maybe @icebob changed his mind ? I sure hope so !

@lionel-bijaoui
Copy link
Member Author

Progress Update

  362 passing (3s)
  89 pending
  • index.spec.js - no skip
  • validators.spec.js - no skip
  • schema.spec.js - no skip
  • VueFormGenerator.spec.js - 4 skip
  • abstractField.spec.js - 1 skip
  • fieldCheckbox.spec.js - 1 skip
  • fieldChecklist.spec.js -2 skip
  • fieldCleave.spec.js - no skip
  • fieldDateTimePicker.spec.js - 1 skip (jQuery based)
  • fieldGoogleAddress.spec.js - no skip (will need some work later to make it work correctly)
  • fieldImage.spec.js - 1 skip
  • fieldInput.spec.js - no skip
  • fieldLabel.spec.js - no skip
  • fieldMasked.spec.js - 1 skip (jQuery based)
  • fieldNoUiSlider.spec.js - 1 skip
  • fieldPikaday.spec.js - 1 skip
  • fieldRadios.spec.js - no skip
  • fieldRangeSlider.spec.js - 3 skip (jQuery based)
  • fieldSelect.spec.js - no skip

@zoul0813
Copy link
Member

@lionel-bijaoui well, if he hasn't ... maybe we can do a "best of both worlds" solution, and split the optional fields up into separate packages anyway ... then have two versions of VFG ... a VFG Lite and a VFG Full, where VFG Full just includes all the optional packages in it's package.json ... this would then allow us to have the stream lined separate packages for easier development and testing of advanced fields, as well as provide devs with a "lite" version and a "full" version ... you could then start with the "lite" version and add any extra optional fields you wish, or just use the "full" version and get everything with a single package dep.

The "lite" version would just include basic form fields, anything that's part of the HTML5 standard (input, select, check, radio, buttons, hidden fields, etc).

@icebob thoughts?

@lionel-bijaoui
Copy link
Member Author

@zoul0813 It is already like that, you've got the core or full version. But from experience, we need an "engine" version without any field at all.

@zoul0813
Copy link
Member

@lionel-bijaoui the difference in what I'm proposing is that if you enable "full" you get it all ... you can't selectively decide that you want to use the "core" and then add in 1-2 optional fields ...

Splitting the optional fields up into there own packages would allow me to just npm install --save-dev vfg-core vfg-optional-field-name, and then I'd have the core and only that single optional field, as opposed to all of the optional fields.

@icebob
Copy link
Member

icebob commented Feb 28, 2018

Hi guys,

sorry for late. Yes, I support to split optional modules to separated packages in v3. And as @zoul0813 said, we can create a "full" bundle, which install all optional modules as npm dependencies.

@lionel-bijaoui
Copy link
Member Author

@icebob I'm so happy to hear that ! Will it use git submodule or separate package ?

@icebob
Copy link
Member

icebob commented Feb 28, 2018

I think separate npm packages in separate github repos under vue-generators org.

@icebob
Copy link
Member

icebob commented Feb 28, 2018

I will try to set npm publishing on travis, so every team member will able to release new versions without me. (Nowadays I'm very busy, sorry)

@lionel-bijaoui
Copy link
Member Author

lionel-bijaoui commented Feb 28, 2018

Progress Update

  416 passing (4s)
  35 pending

I worked on the overhaul of code coverage. I'm hopping this will pass Travis. Only one file to do ! I'm seeing the light at the end of the tunnel *u*

  • index.spec.js - no skip
  • validators.spec.js - no skip
  • schema.spec.js - no skip
  • VueFormGenerator.spec.js - 4 skip
  • abstractField.spec.js - 1 skip
  • fieldCheckbox.spec.js - 1 skip
  • fieldChecklist.spec.js -2 skip
  • fieldCleave.spec.js - no skip
  • fieldDateTimePicker.spec.js - 1 skip (jQuery based)
  • fieldGoogleAddress.spec.js - no skip (will need some work later to make it work correctly)
  • fieldImage.spec.js - 1 skip
  • fieldInput.spec.js - no skip
  • fieldLabel.spec.js - no skip
  • fieldMasked.spec.js - 1 skip (jQuery based)
  • fieldNoUiSlider.spec.js - 1 skip
  • fieldPikaday.spec.js - 1 skip
  • fieldRadios.spec.js - no skip
  • fieldRangeSlider.spec.js - 3 skip (jQuery based)
  • fieldSelect.spec.js - no skip
  • fieldSelectEx.spec.js - 4 skip (jQuery based)
  • fieldSpectrum.spec.js - 3 skip (jQuery based)
  • fieldStaticMap.spec.js - no skip
  • fieldSubmit.spec.js - 3 skip
  • fieldSwitch.spec.js - no skip
  • fieldUpload.spec.js - no skip

@lionel-bijaoui
Copy link
Member Author

lionel-bijaoui commented Mar 5, 2018

Progress Update

  425 passing (4s)
  26 pending

I cleaned the files and remove obsolete function. I'm not going to do any more work on the test. My goal now is to make the build successful.

  • index.spec.js - no skip
  • validators.spec.js - no skip
  • schema.spec.js - no skip
  • VueFormGenerator.spec.js - 4 skip
  • abstractField.spec.js - 1 skip
  • fieldCheckbox.spec.js - 1 skip
  • fieldChecklist.spec.js -2 skip
  • fieldCleave.spec.js - no skip
  • fieldDateTimePicker.spec.js - 1 skip (jQuery based)
  • fieldGoogleAddress.spec.js - no skip (will need some work later to make it work correctly)
  • fieldImage.spec.js - 1 skip
  • fieldInput.spec.js - no skip
  • fieldLabel.spec.js - no skip
  • fieldMasked.spec.js - 1 skip (jQuery based)
  • fieldNoUiSlider.spec.js - 1 skip
  • fieldPikaday.spec.js - 1 skip
  • fieldRadios.spec.js - no skip
  • fieldRangeSlider.spec.js - 3 skip (jQuery based)
  • fieldSelect.spec.js - no skip
  • fieldSelectEx.spec.js - 4 skip (jQuery based)
  • fieldSpectrum.spec.js - 3 skip (jQuery based)
  • fieldStaticMap.spec.js - no skip
  • fieldSubmit.spec.js - 3 skip
  • fieldSwitch.spec.js - no skip
  • fieldUpload.spec.js - no skip
  • fieldVueMultiSelect.spec.js - no skip

@lionel-bijaoui
Copy link
Member Author

lionel-bijaoui commented Mar 5, 2018

@icebob I don't know how to activate Codacy for this branch, but except for that, everything is ready for the merge on my side.
Dev, build, test are working, travis is happy and coveralls is working.

@icebob
Copy link
Member

icebob commented Mar 9, 2018

@lionel-bijaoui Great job! Thank you!

config/index.js Outdated
build: {
env: { NODE_ENV: "\"production\"" },
index: path.resolve(__dirname, "../../api/src/Template/Layout/layout_a.ctp"),
assetsRoot: path.resolve(__dirname, "../../api/webroot/"),
Copy link
Member

Choose a reason for hiding this comment

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

What are these paths?

Copy link
Member Author

Choose a reason for hiding this comment

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

oups sorry ! I based my work on an existing project. I will fix that ASAP

Copy link
Member

@icebob icebob left a comment

Choose a reason for hiding this comment

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

Thanks

@icebob icebob merged commit 64d0421 into vue-generators:v3 Mar 9, 2018
@lionel-bijaoui lionel-bijaoui added this to Done in v3.0 Oct 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
v3.0
Done
Development

Successfully merging this pull request may close these issues.

None yet

5 participants