Code Monkey home page Code Monkey logo

meteor-blaze-bs4's Introduction

Meteor Blaze Bootstrap 4 Components

Generic Bootstrap 4 components library for Meteor Blaze. See the DEMO

JavaScript Style Guide GitLicense Project Status: WIP – Initial development is in progress, but there has not yet been a stable, usable release suitable for the public.

Note, that we are in status WIP, which means "Initial development is in progress, but there has not yet been a stable, usable release suitable for the public." However, there are already releases on atmosphere for trying out the latest state.

Features

  • NEW! All components are imported using dynamic import, resulting in an initial package size of about 3KB!
  • All Bootstrap components as parameterized Blaze Templates (see the project overview for supported components)
  • Write Template code that is easier to reason about
  • Keeps the naming conventions from Bootstrap
  • Abstracts base classes (like btn) away, so you can focus on the code that matters
  • Passing arbitrary data- attributes to components without the need for further config
  • Pass events as parameters or use the classic event mapping from Blaze
  • Rich examples DEMO that runs in analogy to the Bootstrap documentation

Getting started

This package comes with out-of-the-box Botstrap 4 components that can be included in any Meteor Blaze project.

Prerequisites

This package comes without a hard-wired dependency to Bootstrap. This is to make sure that you can choose the Bootstrap version to run by yourself. You need therefore to add Bootstrap yourself:

$ meteor npm install --save bootstrap jquery popper.js

In your client app you need to import Bootstrap and this package like the following:

import 'meteor/jkuester:blaze-bs4'
import 'bootstrap'
import 'bootstrap/dist/css/bootstrap.css' // this is the default BS theme as example
import popper from 'popper.js'
global.Popper = popper // fixes some issues with Popper and Meteor

Installing this package

You can install the package from atmosphere via:

$ meteor add jkuester:blaze-bs4

The templates are automatically added and are immediately available. Note, that the

How to use

The components are loaded using dynamic imports, so the initial bundle size is kept small.

To import the packages, you need to first import the context via

import { BlazeBs4 } from 'meteor/jkuester:blaze-bs4'

BlazeBs4.button.load().then(loaded => console.log('button template loaded'))

you can also load multiple components at once using

import { BlazeBs4 } from 'meteor/jkuester:blaze-bs4'

Promise.all([
  BlazeBs4.button.load(),
  BlazeBs4.tooltip.load(),
  BlazeBs4.modal.load()
]).then(loaded => console.log('required templates loaded'))

For a full documentation of each supported component, please run the examples DEMO

Running the tests locally

The package folder blaze-bs4/ contains all the components and also the test files. We use mocha and chai to run the unit tests.

To run the tests cd into the blaze-bs4 folder and run the following command:

$ TEST_WATCH=1 meteor test-packages ./ --driver-package meteortesting:mocha

Running the examples locally

When developing components and improving this package you may also want to improve the examples project. To run it you need clone this project to your local machine. Inside

$ git clone [email protected]:jankapunkt/meteor-blaze-bs4.git

The project contains a folder named examples which serves multiple purposes:

  • Mime the code examples from the Bootstrap 4 components documentation.
  • Run the code lint using JavaScript Standard Style.
  • Run the tests against the components. The package itself contains no Bootstrap, so we can only test the full intended behavior including events , effects, popups, modals etc. using the examples project.
  • Build the client-side project to server as Github-Page environment.

In order to set up the example project you need to first install the dependencies:

$ cd meteor-blaze-bs4/examples && meteor npm install

From there you can then run several scripts, that

Testing the package components

To test the package you can run inside the example project

$ meteor npm run test

which will run a mocha test suite that refreshes when the example or package code changes. Suitable for development.

To run the cli-only tests you need to execute the following script:

$ meteor npm run test-cli

Run the example project

You can also run the example project locally. To do that you need to execute

$ meteor npm run examples

Build the example project for Github pages

The build script uses meteor-build-client to create a client-only bundle of the example project that can be loaded via Github pages. Not, that this requires meteor-build-client to be installed.

To build the client app execute the following script

$ meteor npm run build

Deployment

This package does not need additional deployment configuration. Atmosphere publishing will be done by Jan Küster. Merged PRs will be automatically published.

Built With

Contributing

Please see the contribution guidelines.

Current Progress

1.0

See the project overview.

Versioning

We use SemVer for versioning. For the versions available, see the tags on this repository.

The conventions for versioning are:

  • major - Increment, if there is a major change in Bootstrap that affects major changes in this package. This will be 0 until all components have been implemented and 1 once all components have been basically implemented.
  • minor - Increment, if there are severe changes in a component or new features added.
  • patch - Increment, if there are minimal changes / updates / fixes in a component.

Authors

See also the list of contributors who participated in this project.

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Acknowledgments

meteor-blaze-bs4's People

Contributors

jamgold avatar jankapunkt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

meteor-blaze-bs4's Issues

No compatible binary build found

Describe the bug
I have been testing your package in a project, and when I did meteor update I got the error message

error: No compatible binary build found for this package. Contact the package author and ask them to publish it for your platform.

To Reproduce
Steps to reproduce the behavior:

  1. Run meteor update or meteor add jkuester:blaze-bs4

Expected behavior
I expected meteor update to work how it always has

Desktop (please complete the following information):

  • OS: MacOS X 10.14.6
  • Browser chrome
  • Version 78.0.3904.70

Additional context
Add any other context about the problem here.

Own component for dropdown item

Action

should be an own component:

{{> dropdownitem href="#dropdowns" label="Action" link=true }}

but it should also work like

{{#dropdownitem href="#dropdowns" link=true}}
  <i class="fa fa-fw fa-someicon"></i> <span>Action</span>
{{/dropdownitem}}

jumbotron component needs to load BlazeBs4.jumnbotron.load()

Describe the bug
In order to dynamically load the jumbotron component, one has to BlazeBs4.jumnbotron.load(), spelled jumnbotron (extra n), which is not very intuitive, nor documented.

To Reproduce
Steps to reproduce the behavior:

  1. use BlazeBs4.jumbotron.load() fails

Expected behavior
use BlazeBs4.jumbotron.load() instead of BlazeBs4.jumnbotron.load()

Desktop (please complete the following information):

  • OS: Mac OS X 10.14.6
  • Browser firefox
  • Version 72.0.1

Fix GitHub Pages

Describe the bug
The GitHub pages are broken. Seems to be a client-side router issue.

To Reproduce
Look at GitHub pages

Expected behavior
There should be no route issues

Additional context
Can be fixed by using # instead of / routes

TODO Components

  • Alerts
  • Badge
  • Breadcrumb
  • Buttons
  • Button group
  • Card
  • Carousel
  • Collapse
  • Dropdowns
  • Forms
  • Input group
  • Jumbotron
  • List group
  • Modal
  • Navs
  • Navbar
  • Pagination
  • Popovers
  • Progress
  • Scrollspy
  • Tooltips

Button misses form attribute

Describe the bug
Button missies form attribute

To Reproduce
create a button with form attribute

{{> button form="test"}}

it won't contain this attribute.

Expected behavior
Should be an attribute of the button

Navbar toggler not expanding

Hi, love the project. When viewing the example demos on your site (https://jankapunkt.github.io/meteor-blaze-bs4/navbars) on a phone, pressing on the toggler button does not show the navbar items. The same happens if I use a narrow browser window on a PC (eg Chrome). The same behaviour is also occurring with the main navbar on the actual demo site also. Am I missing something?
Cheers, Dan

Dynamic import and static import not switchable

Describe the bug

There ist no way to switch between dynamic and static Imports.

To Reproduce
Steps to reproduce the behavior:
Change the environment variable using the package from atmosphere. The dynamic import remains.

Expected behavior
There should be a switch between dynamic and static.

Additional context
See aldeed:autoform v7 for how it's done right

Button should use type instead of colortype

A button should also use type to assign colors to keep type attributes consistent with all other components.
HTML type attributes like type="submit" should rather be set by a flag like submit=true.

Update documentation accordingly.

Arbitrary data- and aria- attributes for all components

There is a folder utils which contains a file named dataAtts.js which exports some generic utility functions to allow Templates to receive arbitrary data- attributes.

Each Template in blaze-bs4 folder of the package needs to have this feature. An implementation example can be found in the button Template.

Sidenote: Performance should for now be secondary (although not be ignored) in favour of completeness of functionality.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.