Comments (7)
Hi @makepanic
Thank you for your feedback! 👍
A random thought from my side would be to decouple any css framework compatibility from core.
Do you mean putting the themes in separate addons (e.g ember-validated-form-bootstrap
)? Or would it maybe be enough to just filter out all unneeded code on build?
So something like the following configuration would allow a user to specify which component will be used for any validated-form form field type. This reduces copy pasting when specifying a custom rendering component.
You're absolutely right! We had the same idea but forgot to mention it in the RFC. I added it to the optional features, since this is not something crucial.
One could maybe also allow aliasing so "render": "bootstrap" would tell the addon to bundle the default set of bootstrap form components ("render": "foundation" to bundle foundation components and so on).
A global option for a default set of components is definitely reasonable.
FYI: I already added a very very basic partial implementation of this RFC in #128. If you want, take a look at it and give us your feedback!
from ember-validated-form.
Do you mean putting the themes in separate addons (e.g ember-validated-form-bootstrap)? Or would it maybe be enough to just filter out all unneeded code on build?
I think both are valid solutions. Filtering the addon tree on build would be easier for you, i guess.
FYI: I already added a very very basic partial implementation of this RFC in #128. If you want, take a look at it and give us your feedback!
Thanks, I'll try to take a look and add feedback
from ember-validated-form.
Great idea!
A random thought from my side would be to decouple any css framework compatibility from core.
This has an advantage of others not having to bundle components/styles that aren't needed (similar to other addons which strip module from the addon tree).
ember-validated-form could still ship defaults for any well-known css frameworks.
So something like the following configuration would allow a user to specify which component will be used for any validated-form form field type. This reduces copy pasting when specifying a custom rendering component.
// config/environment.js
...
"ember-validated-form": {
"render": {
"text": "validated-input",
"textarea": "validated-textarea",
"label": "validated-label",
"checkbox": "validated-checkbox",
...
}
}
...
One could maybe also allow aliasing so "render": "bootstrap"
would tell the addon to bundle the default set of bootstrap form components ("render": "foundation"
to bundle foundation components and so on).
This could mean that the developer could still overwrite the renderComponent on a per form field basis but also get custom rendering for the whole project without having to copy paste it all over the place.
I guess one could even combine it to allow default rendering for all form components but overwrite some:
// config/environment.js
"ember-validated-form": {
"extends": "bootstrap",
"render": {
"label": "some-special-label"
...
}
}
It's also possible to not have any magical extension logic but export some objects, which could be Object.assign
'd to create the final render configuration:
// config/environment.js
const {bootstrap} = require('ember-validated-form/configs');
"ember-validated-form": {
"render": Object.assign(bootstrap, {
"label": "some-special-label"
...
})
}
from ember-validated-form.
I think both are valid solutions. Filtering the addon tree on build would be easier for you, i guess.
I think filtering it brings the advantage of not having to maintain x other addons for every existing framework while still decreasing the payload significantly.. Like this, we have all of the ember-validated-form
related code in one place.
from ember-validated-form.
I think with lerna or yarn workspaces there wouldn't be much additional maintenance overhead while still having all ember-validated-form
code in one repo.
With filtering you also have to maintain additional broccoli code that filters the addon tree.
But it's up to you for what's easier to maintain.
from ember-validated-form.
Well, we'd still have to maintain all of the dependencies for every addon even if we have it in one repo.. Or did I miss something?
from ember-validated-form.
I'll go ahead and close this since the redesign has landed since a while 🙂
from ember-validated-form.
Related Issues (20)
- Configuration in config/environment.js not working? HOT 4
- TODO: Migrate from ember-i18n to ember-intl HOT 1
- Bootstrap classes not generating HOT 5
- queue is not a helper HOT 1
- Fails to build with embroider
- type=number additional properties HOT 1
- v1 version does not honor previous locale setting of ember-intl HOT 1
- Errors aren't being updated HOT 3
- Release v3.0.3? HOT 2
- Submit event missing event and sender parameters
- Documentation page unusable ("htmlsafe is not a function")
- Cleanup after embroider fixes HOT 1
- Docs are busted HOT 2
- Nested properties not validating (solved) HOT 1
- Help needed to use "on" modifier with <ValidatedInput /> HOT 2
- Adding custom inputs
- Embroider Support is broken HOT 1
- Master is incompatible with node < 18 HOT 2
- Checkbox group seem to be bugged HOT 3
- Ember 5.5 Form is not actually validating HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ember-validated-form.