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

Create (bootstrap)-independent version #390

Merged
merged 23 commits into from
Dec 10, 2018
Merged

Conversation

simialbi
Copy link
Contributor

@simialbi simialbi commented Nov 30, 2018

Q A
Is bugfix?
New feature? ✔️
Breaks BC?
Tests pass? ✔️
Fixed issues #260, PR #384

Like yiisoft/yii2-debug#340 for yii2-debug the same for yii2-gii.

Work in progress demo: http://demo.karlen.li/web/gii
For model generation: Table yii_user exists

@samdark
Copy link
Member

samdark commented Nov 30, 2018

Great to see you working on gii as well!

Some feedback (I know it's work in progress but still). Based on demo:

  1. It looks better w/o paddings of the main page.
  2. Header looks different. Not as good as it was.
  3. Text sizes and styles are different.
  4. Pressing "Preview" gives you nothing.

@simialbi
Copy link
Contributor Author

simialbi commented Dec 1, 2018

@samdark shall I rewrite gii.js to vanilla?

@samdark
Copy link
Member

samdark commented Dec 1, 2018

@simialbi ideally yes. That would ease the installation a lot when we'll apply your changes to Yii 3.0 modules (if you'd do it after this pull request that would be superb).

@cebe
Copy link
Member

cebe commented Dec 3, 2018

@samdark shall I rewrite gii.js to vanilla?

I don't think this is needed, the frontend of Gii can use jquery without conflicting with other code.
When writing extensions for Gii (custom generators) we can use jquery to optimize the frontend form, having to use native JS does not bring any benefit in this case.

@simialbi
Copy link
Contributor Author

simialbi commented Dec 3, 2018

I think it's ready for a review now. I removed typeahead.js beacause of the discussion of jquery dependance. I replaced it with native datalists. It's supported in the most modern major browsers: https://caniuse.com/#search=datalist. I looked for an alternative and e.g. Awesomeplete is a lightweight one.

As soon as you reviewed I'm going to clean up the code if you agree (globally apply yii2 code style, add phpdoc etc.)

@simialbi simialbi changed the title [WIP] Create (bootstrap)-independent version Create (bootstrap)-independent version Dec 3, 2018
@samdark
Copy link
Member

samdark commented Dec 4, 2018

There seems to be an issue with preview buttons:

buttons

Looks like it could be solved with background-repeat: no-repeat.

Copy link
Member

@samdark samdark left a comment

Choose a reason for hiding this comment

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

The code itself looks good to me.

@samdark samdark added this to the 2.1.0 milestone Dec 4, 2018
@schmunk42
Copy link
Contributor

Sorry, I may have asked this before, but why are all scss bootstrap files included in the source?
I thought this is bootstrap-free :)

@simialbi
Copy link
Contributor Author

simialbi commented Dec 5, 2018

It's bootstrap independent, not bootstrap free. Bootstrap is bundled to solve problems like this:
yiisoft/yii2-bootstrap4#49

@schmunk42
Copy link
Contributor

The issue linked above won't be a problem with npm btw. or at least it would be different, since you can install two versions when using native tooling - but not with composer. But this is more Yii 3.x related. CC: @samdark @cebe

I don't like the idea of bundling a whole CSS framework with a module, although I see that there has to be some style. And for Yii 2.x this might be the way to go.

But we should think about this for https://github.com/yiisoft/yii-gii/

@simialbi
Copy link
Contributor Author

simialbi commented Dec 5, 2018

I know it's not the best solution, but the only alternative I see is to build a dependency free (as far as possible) lightweight yii css framework for cases like this or yiisoft/yii2-debug.

@samdark
Copy link
Member

samdark commented Dec 5, 2018

It's fine for Yii 2.x and is close to what we need in Yii 3.0.

@schmunk42
Copy link
Contributor

schmunk42 commented Dec 5, 2018

@samdark You want to bundle Bootstrap 4 for Yii 3.x for gii, debug and for yii-bootstrap4? So it would be included 3 times in probably three different versions?

@simialbi
Copy link
Contributor Author

simialbi commented Dec 5, 2018

@schmunk42 you have to consider the following: gii and debug are development modules you don't need in production. So mabye it's not as tragic as it seems

@samdark
Copy link
Member

samdark commented Dec 5, 2018

@schmunk42 we may do it. As @simialbi said, there's nothing wrong with it. Still, ideally we'd do our own simplistic CSS.

@schmunk42
Copy link
Contributor

schmunk42 commented Dec 5, 2018

you have to consider the following: gii and debug are development modules you don't need in production. So mabye it's not as tragic as it seems

While I agree for debug, I had use-cases with gii, where I wanted to generate code on a website, ie. think about an online extension generator. But as said, this PR is perfectly fine for 2.x.

there's nothing wrong with it. Still, ideally we'd do our own simplistic CSS.

I totally agree for Yii 2.x, but we should consider the use-case in general, that you want to install two different version of a CSS framework; if you have something like AdminLTE you might also be tied to certain JS libs.

For 3.x we should try to use minimal custom CSS and don't try to find workarounds (in core modules) from the beginning.

@samdark
Copy link
Member

samdark commented Dec 5, 2018

Gii was never meant for embedding so even if there are use cases like that, these are extremely rare and I don't think these should be considered.

@samdark
Copy link
Member

samdark commented Dec 8, 2018

@simialbi I've made 2.0.8 release now we're ready to assemble 2.1.0. Would you please add changelog lines for this pull request? Thanks.

@simialbi
Copy link
Contributor Author

@samdark Done

@samdark samdark merged commit b7becd5 into yiisoft:master Dec 10, 2018
@samdark
Copy link
Member

samdark commented Dec 10, 2018

Merged. Thank you very much!

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.

4 participants