Code Monkey home page Code Monkey logo

Comments (4)

VizuaaLOG avatar VizuaaLOG commented on May 29, 2024

Yes, what you are saying is valid. We might as well have the core do the searching and delegate to each plugin to allow it to them setup.

I created a new branch and commit making that change. I don't see a problem with that, but if you do please let me know.

from bulmajs.

rajibahmed avatar rajibahmed commented on May 29, 2024

I have read through the code base. Seem like a nice implementation :) 👍
I am confused about the file naming. which file should developer include to get the functionality of notification ?

is it bulma.js ? or notification.js ?

And if you develop dropdown plugin? How would people be able to use both with minimal setup ?

from bulmajs.

rajibahmed avatar rajibahmed commented on May 29, 2024

I looked at html docs now @ https://vizuaalog.github.io/BulmaJS/

I would prefer the api to be more simple

// Import BulmaJS core and plugins
import Bulma from 'path/to/bulmajs/src/core';
import Notification from 'path/to/bulmajs/src/plugins/Notification';

// Register plugins with the core
Bulma.registerPlugin('notification', Notification);

// If you want to use the DOM API, execute the following function
// when the DOM has loaded
Bulma.traverseDOM();

// If you would like global access to Bulma
window.Bulma = Bulma; // This can be anything you wan

My preference would be, I am not 100 % sure how to do this.
But calling classes plugin seems limiting to me. Naming something plugins give it a
bit of limitation IMO.

// Import BulmaJS core and plugins
import Bulma from 'path/to/bulmajs/src/core';
import Notification from 'path/to/bulmajs/src/plugins/Notification';

let notification_elements = $('.notification') || document.getElementByClassname('.notifications')

Notification.track(notification_elements); // can pass in options 
Dropdown.track(dropdown_elements, options);

Bulma.connect(Notification, Dropdown); //variable args list

// If you would like global access to Bulma
window.Bulma = Bulma; // This can be anything you wan

from bulmajs.

VizuaaLOG avatar VizuaaLOG commented on May 29, 2024

I don't see a problem at the moment with the current way things work.

I think for simplicity and being able to just 'drop' the JS to quickly prototyping, manually setting up every plugin to look through the HTML is a little bit overkill. I prefer the current way where the data- tags are used. If someone doesn't like this method, then they can not use the data- API and instead create the instances themselves through the regular JS API.

from bulmajs.

Related Issues (20)

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.