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

v4.0 #262

Closed
37 tasks done
kennethnym opened this issue Jun 27, 2020 · 67 comments · Fixed by #265
Closed
37 tasks done

v4.0 #262

kennethnym opened this issue Jun 27, 2020 · 67 comments · Fixed by #265
Labels
dependencies Pull requests that update a dependency file Major change WIP
Milestone

Comments

@kennethnym
Copy link
Collaborator

kennethnym commented Jun 27, 2020

This is an issue tracking this library's upgrade to v4.0.

New features:

  • Support for Bulma 0.9.1
    • Spacing helpers
    • Light/Dark color helpers
    • Remove <List /> component
    • is-clickable helper
    • is-max-desktop and is-max-widescreen for Container
  • Standalone display prop without viewport modifiers. (5f1b1eb)
  • Support is-size-7 (2162f3f)
  • Support font family modifiers (d82cee8)
  • Support for is-sr-only modifier (e9fc3d2)
  • Tree shaking
  • Update Documentation for installation process (Now there will be only one no more advanced configuration need it)
  • TypeScript support
  • Add missing table-container component (fix: add missing Table.Container element #274)
  • Add missing hoverable prop for Table component (fix: add missing table hoverable prop #273)
  • Add missing rounded prop for Form.Select component (aed5774)
  • Add various state props for Form.Select (d2afa6d)
  • BREAKING name prop of Form.Radio is no longer required. (b365663)
  • BREAKING Simplify responsive props (Simplify Responsive prop #279)
  • BREAKING remove Breadcrumb item prop and replace it with Breadcrumb.Item
  • Ability to show the first and last page in Pagination (Add pagination first last pages #283)
  • BREAKING Remove loading Button prop in favor of a unified state prop that already exists. Button can have multiple state at once - the state prop will be removed because it can only take one state at a time. (0da8632) Reverting this, does not make sense to have focus, hover and/or hover at the same time
  • Add focus, hover and loading (UPDATE loading state is applied to Control instead of Input, removing) state props for Form.Input. (aff9690)
  • Add rounded prop for Form.Input (corresponds to is-rounded) (af1c3a2).
  • Add centered prop for InputFile
  • BREAKING Remove Form.Textarea default rows of 4. (2153d5b)
  • Add has-fixed-size support for Form.Textarea (2153d5b)
  • Add various state props (loading, focused, etc.) for Form.Textarea (2153d5b) Reverting this, does not make sense to have focus, hover and/or hover at the same time
  • BREAKING Form.InputFile is now a controlled component
  • BREAKING Heading will now pick the appropriate header element based on the supplied size. For example, size={4} tells Heading to render h4 under the hood. Default size will now be 3 Won't do, the user will select the appropiate element with renderAs
  • Allow override of renderAs for various components for consistency's sake. Except Table because with any other component will not work

Housekeeping:

cc @couds

edit: marked breaking changes.

@kennethnym kennethnym added dependencies Pull requests that update a dependency file WIP Major change labels Jun 27, 2020
@kennethnym
Copy link
Collaborator Author

@couds Bulma 0.9.0 contains some breaking changes, so we have to do a v4 release on this. Maybe push #258 to v5?

@kennethnym kennethnym changed the title Update to Bulma 0.9.0 v4.0 Jul 1, 2020
@kennethnym kennethnym pinned this issue Jul 1, 2020
@kennethnym
Copy link
Collaborator Author

For TypeScript support, I am currently stuck on supporting advanced imports. It seems like to only way to support advanced imports is to manually re-export all component types under their corresponding advanced import path.

@couds couds mentioned this issue Jul 1, 2020
4 tasks
@kennethnym
Copy link
Collaborator Author

Other than that, type definintions should be largely complete.

@kennethnym kennethnym added this to the v4 milestone Jul 1, 2020
@couds
Copy link
Owner

couds commented Jul 1, 2020

@MrCreeper1008 in which branch are the typescript definitions? I have an idea to fix the import that want to check

@kennethnym
Copy link
Collaborator Author

It's on ts-defs

@kennethnym
Copy link
Collaborator Author

I think we should come up with a better way of importing components, because imo current way of doing it is a bit cluncky. Maybe we should consider supporting tree-shaking?

@kennethnym
Copy link
Collaborator Author

@couds we should also probably rewrite all class components with react hooks, since react recommends hooks over classes.

@couds
Copy link
Owner

couds commented Jul 8, 2020

Hi @MrCreeper1008 I think we can do it but that is not a breaking change so we can do it later (v4.1 for example) so let out it as optional for the 4.0.

@verheyenkoen
Copy link
Contributor

@MrCreeper1008 @couds Maybe create a dedicated branch for that? Or can we just send pull requests on a per component basis?

@kennethnym
Copy link
Collaborator Author

Typedefs for compoentns are finished. We're just considering changing how components are imported, so we're holding this off until that is settled

@alexpchin
Copy link

Hi, loving the work! Just wondering whether you have an ETA for this update? It seems almost there?

@kennethnym
Copy link
Collaborator Author

yea it is almost there. waiting @couds to rewrite imports.

@couds
Copy link
Owner

couds commented Aug 17, 2020

Hi @MrCreeper1008 Thanks a lot for all the work you are doing. This couple a week had been crazy for me. (Changing job and finishing a lot of stuff), I think I will have finally time after Sep 15. I will try my best to do it the weekend of that week. T_T

@kennethnym
Copy link
Collaborator Author

if you want i can finish the rest so you can focus on your stuff.

kennethnym pushed a commit that referenced this issue Aug 23, 2020
* remove sass and all dependencies

* Fix eslint issues

* update dev dependencies

* update Readme

* Fix prettier errors

* fix button ref test

* change Object.keys for Object.values
@timorthi
Copy link

Hi, love the library and 4.0 looks to be a great update. Is there anything we can do to help push the project closer to a 4.0 release? 😄

@kennethnym
Copy link
Collaborator Author

The only big thing left to do is closing #276, so it would be great if you could help with that.

@kennethnym
Copy link
Collaborator Author

Also would be great if you could help improve the documentation.

@kennethnym
Copy link
Collaborator Author

kennethnym commented Oct 4, 2020

I should be able to finish v4 this week, but it will be released definitely by next week. Sorry for the delays. There are too much stuff going on right now.

Update: all changes are implemented! still deciding whether to rewrite class components. @couds

@davepwsmith
Copy link
Contributor

davepwsmith commented Nov 3, 2020

I am using #next in a hobby application - have noticed that a few of the type exports are missing from index.d.ts, namely:

export {Menu} from './components/menu';
export {Tag} from './components/tab';
export {Tile} from './components/tile';

Not sure if this is overlooked, or intentional, but thought better to point it out :)

D

@kennethnym
Copy link
Collaborator Author

Turns out the memory issue is an issue on ts-jest: kulshekhar/ts-jest#1967. Basically, compiled modules are cached redundantly.

@fgs-dbudwin
Copy link

Reading that issue, it looks like the underlying issue may be with Jest itself--the issue was crossposted here: jestjs/jest#10550

Not much activity on it. I take it that you're not using ts-jest which is why you're not seeing the same issues I am.

@kennethnym
Copy link
Collaborator Author

kennethnym commented Nov 12, 2020

My guess is that the issue only happens in large projects with many test cases. A solution is for us to ship a commonjs version of our code that you can import in tests (like react-bulma-components/lib/index.cjs) but I am reluctant to do so because I reckon very few people will use it and it's not worth the extra installation time. @couds thoughts?

@fgs-dbudwin
Copy link

fgs-dbudwin commented Nov 12, 2020

Can you explain to me what changed between v3 and v4 to expose this issue?

@kennethnym
Copy link
Collaborator Author

in v3 import statements are transpiled but in v4 they aren't anymore to enable tree shaking.

@kennethnym
Copy link
Collaborator Author

Marked breaking changes.

@kennethnym
Copy link
Collaborator Author

Some missing features are added when I am writing the new documentation. Decided to also perform some housekeeping tasks in v4 to tidy up the code base.

@couds
Copy link
Owner

couds commented Apr 9, 2021

Hi @ALL I took a while but finally we have a release candidate for V4. You can try it installing the next tag npm i react-bulma-components@next

If not big issues are found I will release it next week

Thanks for the patience!

@davepwsmith
Copy link
Contributor

davepwsmith commented Apr 10, 2021

@couds I have been using the v4 branches for a while, and this seems to break quite a lot that was previously working in terms of types in particular, but also functionally - is there an easy way to see what has changed, or view the docs so that I can work out how to update these?

One thing in particular that I think will need updating is the types on renderAs - I am using Gatsby, and it won't let me use a gatsbyLink as renderAs, which is pretty crucial e.g. for navigation. (#314 (comment))

I'm going to take a look and see if there is anything I can do about it, but thought I would let you know early!

@kennethnym
Copy link
Collaborator Author

can you open a new issue for the problem you have with gatsby and renderAs? as for the changelog i think @couds is documenting all the changes in CHANGELOG.md on the next branch.

@davepwsmith
Copy link
Contributor

Me again (perhaps it's only me that's using this unstable branch!) - I have found that the changes in RC.3 have made gatsby fail to build:

 ERROR #98124  WEBPACK

Generating JavaScript bundles failed

undefined

If you're trying to use a package make sure that 'undefined' is installed. If you're trying to use a local file make sure that the path is correct.

File: src/pages/index.tsx:1:94

Everything works fine with RC.2, but 3, 4 and 5 throw this.

@couds
Copy link
Owner

couds commented Apr 19, 2021

Hi @davepwsmith

I made a mistake building RC.3, check the latest one (Should be RC.5) it should work correctly

@davepwsmith
Copy link
Contributor

davepwsmith commented Apr 19, 2021

Afraid not @couds - neither .3, .4 or .5 work, all with the same error.

@couds
Copy link
Owner

couds commented Apr 19, 2021

Weird. I will check this afternoon what its broken on the build and deploy a RC.6.

If possible can you share a simple repo to reproduce the issue?

Thanks

@davepwsmith
Copy link
Contributor

@couds
Copy link
Owner

couds commented Apr 21, 2021

@davepwsmith Fixed on RC.7 Thanks for reporting.

@davepwsmith
Copy link
Contributor

Just to confirm that this is all good at my end with a more complicated example than the one I gave you! Thanks.

@bino98
Copy link

bino98 commented Apr 22, 2021

Hi.

Some typescript type definition maybe different.
The problematic part is MenuListItemProps used in <Menu.List.Item>.
https://github.com/couds/react-bulma-components/blob/v4.0.0-RC.7/src/components/menu/index.d.ts#L10

An type mismatch error occurs even if I use it according to the usage of bulma documents.

<Menu>
  <Menu.List>
      <Menu.List.Item>
        /* ↓ Type mismatch.. 'string[] | ReactElement<any, string | JSXElementConstructor<any>>[]' */
        hogehoge
      </Menu.List.Item>
  </Menu.List>
</Menu>

My team is using RC.7.

@couds
Copy link
Owner

couds commented Apr 22, 2021

Hi @bino98 I will take s look. Thanks!

@davepwsmith
Copy link
Contributor

For what it's worth, unless you are specifically trying to restrict what people put inside these elements, I think you will pretty much always want ReactNode? It is the type that the react typings use for children (e.g. in PropsWithChildren<>).

It is a very broad type though, so if you did want to restrict further than that I would understand!

https://github.com/DefinitelyTyped/DefinitelyTyped/blob/2034c45/types/react/index.d.ts#L194

@bino98
Copy link

bino98 commented Apr 22, 2021

Thank you comments.

I forgot to write past comment, even if use a ReactNode in <Menu.List.Item>, this problem occurs.

for examples..

<Menu>
  <Menu.List>
      <Menu.List.Item>
        <HogeLabel>hogehoge</HogeLabel>
      </Menu.List.Item>
  </Menu.List>
</Menu>

sorry if I'm wrong

@davepwsmith
Copy link
Contributor

Hi @bino98 - sorry my comment was directed at @couds. You are correct that the types aren't right.

@couds I can PR for this - but I also noticed that the title attribute is already typed as ReactNode... this means that you can put just about anything as the title here, extending to basically a whole other website! Should this not just be "string"?

I am struggling to even get the "next" branch set up at the moment though, npm i is complaining about package hashes and babel won't run...

@couds
Copy link
Owner

couds commented Apr 22, 2021

Hi @davepwsmith

I will take a look about the issue with the env.

About the title, I prefer to keep it as a ReactNode, there are scenarios where we could want a more complex title (and anchor or anything else)

@couds
Copy link
Owner

couds commented Apr 22, 2021

@davepwsmith I pushed the fix to the Item definition. Thanks.

I was not able to reproduce the issue installing the package.

btw I recommend to use npm ci instead of npm i when installing the dependencies (it will only use the lock file and its faster

couds added a commit that referenced this issue Apr 24, 2021
* Upgrade Bulma; add spacing modifiers

* Remove List component

* Update CHANGELOG.md

* Move bulma to peerDependencies

* Bump lodash from 4.17.15 to 4.17.19

Bumps [lodash](https://github.com/lodash/lodash) from 4.17.15 to 4.17.19.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](lodash/lodash@4.17.15...4.17.19)

Signed-off-by: dependabot[bot] <support@github.com>

* Remove yarn.lock

* Audited packages

* fix: add missing Table.Container element (#274)

* fix: add missing Table.Container element

* Address review feedback

* fix: add missing table hoverable prop (#273)

* Rewrite TypeScript Definitions (#252)

* Define <Element /> and <Box /> component types

* Add typedefs for more components

* Add typedefs for more components

* Try to add support for renderAs prop

* brute forced every single html elements to apply dynamic props based on renderAs

* removed some html elements because too many cases breaks ts

* removed more html elements for renderAs props

* removed more html elements for renderAs props

* Tries to fix renderAs dynamic prop typing

* Clean up the code

* Add types for more components

* Tidy up code

* Add types for more components

* Add types for the remaining components

* clean up the code

* remove ref attribute; fix menu type def

* Add Table.Container type

* Add Table hoverable prop

* Remove List component

* Remove sass and all dependencies #262  (#278)

* remove sass and all dependencies

* Fix eslint issues

* update dev dependencies

* update Readme

* Fix prettier errors

* fix button ref test

* change Object.keys for Object.values

* WIP: split some component typedefs into individual files.

* Move index typedef to root

* Move index typedef to src

* Move rest of component typedefs into their own files

* Trying to make tree-shaking work

* Add clickable helper

* Update bulma peer dep to 0.9.1

* Fix jest tests not able to run

* Upgrade bulma peer dep to 0.9.2

* Refactor responsive modifier props

* Change storybook import alias

* Rewrite import statements in stories to use named exports

* Update typedefs

* Fix Jest tests

* Fix decreased test coverage

* Add support for flexbox helpers; add spacing helpers typedef

* Add pagination first last pages (#283)

* feat: add pagination first last pages originally done by @haflinger

- ref: #100

* feat: add story for the showFirstLast feature in pagination

* feat: add size, position and rounded props to pagination

* fix: remove duplicated checking on first/last page btns

* feat: update typescript def for the new pagination props

* Add test case for showFirstLast prop

Co-authored-by: Kenneth Ng <ngcreeper@outlook.com>

* Add missing TypeScript exports

* Add documentation (#251)

* init documentation

* fix dependencies

* import only used components

* Improve docs distribution
create folder/files structure

* Add npm script for starting docs website

* Add columns basic documentation

* documentation (#266)

* documentation

* Update card.md

* Update tiles.md

* Update box.md

* Update card.md

* Update content.md

* Update media.md

* new

* Update gap.md

* Update nesting.md

* Update options.md

* Update responsiveness.md

* Update card.md

* Update dropdown.md

* Update menu.md

* Update message.md

* Update navbar.md

* Update pagination.md

* Update panel.md

* Update tabs.md

* Update box.md

* Update button.md

* Update icon.md

* Update notification.md

* Update progress-bar.md

* Update tag.md

* Update container.md

* Update level.md

* new

* new

* new

* Tidy up code

* Update column size documentation

* Fix small typo in column size doc

* Update column responsiveness doc

* Update column nesting doc

* Accidentally removed Section import in column nesting doc

* Add missing code example in column responsiveness doc

* Update column gap doc

* Update column options doc

* Update column basics doc

* Update container doc

* Update level doc

Co-authored-by: Kenneth <kenneth.ng.5226@outlook.com>

* Update bulma to 3.4.0

* Add pagination first last pages (documentation) (#284)

* docs: add doc for pagination first/last btns, size, position and rounded

* chore: code consistency

Co-authored-by: John Benavides <john.elric@gmail.com>
Co-authored-by: Quadri Sheriff <59125401+Quadrisheriff@users.noreply.github.com>
Co-authored-by: Yuen Ying Kit <yingkityuen@gmail.com>

* Documentation: Use `next` branch of library

* Update pagination documentation

* Update import statements in docs

* Fix incorrect type path

* Fix incorrect type path

* Update README.md

* Move old logo to documentations folder

* Fix incorrect bulma version

* Fix missing array type for Select

* Remove Button state prop

* Fix Warning: Failed prop type: Invalid prop value supplied to Select (#288)

* Fix Warning: Failed prop type: Invalid prop value supplied to Select

* Fix stylistic issues
- Format code with Prettier
- Use double quote for JSX strings
- Introduce local defaultValue function

* Remove tests that check no error is thrown

* Fix defaultValue function

* Group Select value PropTypes tests

* Move value PropTypes tests in Select component group

* Use dot notation

* Change input-file to a controled component

* 4.0.0-0

* update typescript definitions for input-file

* Implement state props for Form.Input

* Remove loading prop from Form.Input

* Add rounded prop to Form.Input

* Migrate to storybook addon-docs from docusaurus (#289)

* Add addon-essentials storybook plugin

* Rewrite <Box /> doc

* WIP: implement breadcrumb doc

* WIP: Implement Breadcrumb doc

* Implement Breadcrumb doc

* Update box doc

* Add button doc

* Implement Card doc

* Add theme to storybook

* WIP: Add column doc

* Add Columns doc

* Add Columns doc

* Add Container doc

* Add Content doc

* WIP: add dropdown doc

* Add Dropdown doc

* Add Footer doc

* Implement Form doc

* WIP: add Form.Input doc

* Implement Form.Input doc

* Document rounded prop of Form.Input

* Allow override of renderAs of Form.Input; remove default HTML attrs propTypes

* Add is-flex helper support

* Also support other display classes via display modifier prop

* Forgot to apply display prop to class names; fix test

* Support text size 7

* Add support for font family modifiers

* Add is-sr-only modifier support

* Add doc landing page; Add renderAs and modifier doc

* Add checkbox doc

* Remove some deprecated packages; audited packages

* Revert storybook upgrade

* WIP: Textarea doc

* Add some missing Form.Textarea props

* Add Textarea doc; remove Element story code

* Remove loading prop from Form.Textarea and Form.Input

* Add rounded props for Form.Select

* WIP: add Select doc

* Finish Select doc

* Add various state props for Select

* Add Radio doc

* Fix failing InputFile test

* Rename InputFile value prop to files; update InputFile type

* Add Menu doc

* Add message doc

* Fix missing Modal ts props

* Fixes issues with modal children (#302) (#303)

* Revert "Fix missing Modal ts props"

This reverts commit f2e1a0a.

* Update modal types to include document, children, classname

* Add string column widths to types (#304)

* 4.0.0-1

* Add Breadcrumb.Item component to replace Breadcrumb items prop (#293)

* WIP: Add Breadcrumb.Item component

* Add test and types for Breadcrumb.Item

* Add centered prop to InputFile

* Add InputFile doc

* Add InputFile prop table

* Add InputFile label control

* Heading will now render appropriate header element based on supplied size.

* Revert prev commit

* Add Heading doc

* Add missing m/p spacing helpers

* Use default export on component level ts definition (#308)

* add icon to dropdown props definition (#310)

Co-authored-by: Matt McCorry <matt@auktechnologies.com>

* 4.0.0-2

* Update docs and improve/normalize components props (#309)

* Update columns docs

* add Block component

* fix tests

* more docs

* add more components to the docs

* added all elements

* Add missing links to bulma.io documentation

* [WIP] use Element.proptypes and defaultProps instead of modifier

* update can i use

* use Element proptypes ans defaultprops

* breadcrumb component

* add card

* refactor dropdow to stop using class component

* dropdown docs

* Menu component

* Enable classProperties in babel

* Fix storybook webpack issue

* Add level doc

* Message docs

* Fix render as a color constants

* add bulma docs link to message story

* update modal component

* update snapshots

* remove modifier dependency

* remove modifiers folder

* if button type its reset or submit force renderAs button

* remove modifiers import from d.ts files

* finish Element docs (for now)

* normalize normalize position (center -> centered)

* docs improvements

* delete documentation folder

* more default props

* fixes

* update reponsive text alignment

* Rename textAlignment to textAlign

* even more...

* refactor pagination to functional component

* remove babel plugin not need it anymore

* update dependencies

* add pagination docs

* Panel docs

* tabs docs

* dome Form component docs

* Fix input tests

* Texta area and tests

* Select docs

* Checkbox

* Radio docs

* Add label story

* Passdown size prop from Field to childrens

* update test and lower coverage (for now)

* Finish form docs

* remove unused files

* - Container Docs
- Remove Fluid from container
- Add fluid as a possible value of breakpoint
- Add Max prop to container

* Level docs

* rename position to align

* update Changelog

* remove Media.Content component (duplicates Content Component)

* Hero

* Add Section docs

* Update Footer docs

* add Tile docs

* remove notification and color props from Tile

* improve Tile docs

* Improve responsive gap prop

* remove unused mock

Co-authored-by: Kenneth <kenneth.ng.5226@outlook.com>

* 4.0.0-RC.0

* - Normalize align on Navbar.Container
- Add size to Navbar (is-spaced)
- Normalize non-responsive display prop
- Add invisible prop to all components
- Ignore size on Hero if hasNavbar is true

* small fixes

* 4.0.0-RC.1

* add relative to display prop allowed values

* add text prop to icon component

* Fix build and tests

* improve order of common proptypes

* Fix #313 add size as optional prop

* Fix issue with RenderAsComponent type (#316)

Uses ElementType (https://flow.org/en/docs/react/types/#toc-react-elementtype) to fix #314

* Allow Color and size custom props
Add Color custom&extend docs

* - Fix tests
- Remove proptypes from bundle

* normalize Statues

* Improve Changelog

* 4.0.0-RC.2

* Test package configurations

* Add hero halfheight size

* Fix test runner

* Allow pass IconType to control to use on isIcon function

* 4.0.0-RC.3

* update bulma peer dependency

* fix package json files field

* 4.0.0-RC.4

* include ts definitions on package

* 4.0.0-RC.5

* add shades as valid buttons colors

* fix imports on TS (Gatsby)

* 4.0.0-RC.6

* add cjs and esm builds

* 4.0.0-RC.7

* Fix Menu.Item.List children proptype

* More improvements

* 4.0.0-RC.8

* build library as a prepublish step

* add renderAs to TagGroup

* fix prepublish script

* update travis to node 14

* regenerate package-lock

* Try to fix CI

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
Co-authored-by: John <john.elric@gmail.com>
Co-authored-by: Yuen Ying Kit <yingkityuen@gmail.com>
Co-authored-by: Quadri Sheriff <59125401+Quadrisheriff@users.noreply.github.com>
Co-authored-by: 1r3n33 <59848434+1r3n33@users.noreply.github.com>
Co-authored-by: John Benavides <john.benavides@gartner.com>
Co-authored-by: David Smith <davepwsmith@users.noreply.github.com>
Co-authored-by: Matt McCorry <mccorry@gmail.com>
Co-authored-by: Matt McCorry <matt@auktechnologies.com>
@bino98
Copy link

bino98 commented Apr 28, 2021

congrats for v4 release! 🎉

@kennethnym
Copy link
Collaborator Author

Thank you 😄

@couds couds unpinned this issue Jun 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file Major change WIP
Projects
None yet
10 participants