Coder Social home page Coder Social logo

biotope / biotope-resource-loader Goto Github PK

View Code? Open in Web Editor NEW
9.0 4.0 6.0 5.22 MB

Home Page: https://resource-loader.biotope.sh

License: MIT License

JavaScript 39.54% TypeScript 59.46% Dockerfile 0.14% CSS 0.47% HTML 0.39%
resource-loader conditional-loading loader js biotope-resource-loader css resources async

biotope-resource-loader's Introduction

Biotope, a toolchain for lasting design systems.

shield build shield npm

Biotope helps you to build, distribute and adopt a library of web components with a consistent design and of high quality across all your websites and apps. With Biotope you can easily collaborate with your team to develop and maintain the user interface of all your digital experiences from a single location.

If you want to learn more about Biotope and how you can benefit from using this toolchain please visit https://biotope.sh

Quick Start

Installation

First and foremost, you need to install biotope either as global package:

npm i biotope -g

After that you can use the biotope commandline tool to start a new biotope project.

Setup your first project

Setting up your first biotope instance, you should just trust the cli tool to setup your project. Just run:

biotope create [project-name]

This command will ask you some questions and create a new biotope-boilerplate instance.
After the tool is done, you can change directory to the newly generated biotope instance and run it:

cd [project-name]
npm start

Developing your first component

After starting your project, if you've chosen the empty instance, you should see an empty overview page.
Now to add your first component, just run

biotope generate

After asking you some questions, a new component will be created and ready to be developed. After that, you can go into the newly generated files an change them at your will.

biotope-resource-loader's People

Contributors

alxbenz avatar anne-vi avatar ctmm avatar dependabot[bot] avatar depfu[bot] avatar iam-robin avatar janrembold avatar jhadenfeldt avatar jurekbarth avatar sheepfromheaven avatar smohadjer avatar tiagoaguiar31 avatar timomayer avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

biotope-resource-loader's Issues

Handlers get overwritten

Currently the iffe resource loader does overrife the handler options. This should be resolved!

Add headers to fetch resources

Prefetching/fetching resources is done via fetch. Fetch by default won't send any cookies with it's requests.

I would like to be able to configure the headers for different reasons: authentication, split testing

What do you think @SheepFromHeaven @timomayer?

Refactor resource handlers to return promises

@tiagomapmarques suggested on #148 that developers might wish to overwrite the promise resolution of the default handlers.

Currently all resource handlers (html, css, js) resolve have a default resolution of promises.
The current implementation allows developers to overwrite these handlers, through options passed on to ResorceLoader contructor, but only fully, not partially.

Therefore I am opening this issue as a way to centralize discussion on this feature request.

Move data-init to resource loader

Currently, initialising plugins is the responsibility of biotope-boilerplate.

Since resource-loader is the technology providing support for that kind functionality in the first place, it should part of this codebase.

Polyfill IE11

Currently the resource loader is not working for IE11 due to missing polyfills.

dependencies are loaded when the file it depends on is loaded, not yet in scope

we have the problem that we load dependencies when the file they depends on are loaded but maybe not yet parsed and in scope. so a variable/function which we asume to exist in the "depends on" file is not yet available. we need to change our dependency management so dependencies are only initialized when the "depends on" file is in scope, and not just loaded.

add possibility to load html

at the moment the loader is only able to load js, css. it should be possible to load html too.

when an html file is in the resources, the html file has to be inserted to the DOM (as child of the element with data-resource) afterwards the init function should be called.

Not loading correctly for a # in URL

Currently:
the resource loader does not correctly resolve urls on a page which has a # parameter in the URL

Expected:
I can have # in the URL and still use the resource loader correctly

Queue not emptying

Currently:
The resource loader will not fire the resourcesReady event as the queue get not cleared out correctly

Expected:
When all the resources are loaded and handled, the resourcesReady event should fire

events when data is loaded and initialized

the conditional loader should fire events when
all resources for a data-resource attr are loaded on the same DOM element
when data-init is executed on the same DOM element

when all resources in the page are loaded on the $(document)
when all things are initialized (with the main.js) on the $(document)

Why does dist folder include only the compressed version?

I do not want to use compressed version of scripts during development as they make debugging difficult. It's good to have the min.js version in dist folder, but you should include the none-compressed version (resourceLoader.js) as well, specially since most projects compress their resources themselves anyway. Giving users a choice to use the version they prefer would make the library more popular. Also it's easy to compress a none-compressed version, but not vice versa.

Add rerun possibility

Currently one cannot rerun the resource loader. We need this feature for dynamic HTML

resourcesReady does not mean a script has finished parsing

The resourcesReady event does not take into account the fact that scripts might not yet have finished loading/being parse.
This creates a racing condition on certain projects, especially ones that attach component contructor functions to jQuery.

Screenshot 2020-05-28 at 16 16 38

Remove dist folder

Is there a specific need for the dist folder? We could build the dist folder right before publishing to npm?

loading the same file within different components causes timing issues

When loading a small file that depends on a big file multiple times on a page it causes a timing issue which leads to an unwanted behaviour.

Finding with three.js and MTLLoader.js:
MTLLoader depends on three.js and can be loaded with the conditional loader. This works fine as long as there is only one instance. When there are multiple instances the loading is broken and the dependsOn feature is bypassed.

This is caused by https://github.com/frontend-framework/conditional-resource-loader/blob/ab0c084d473b32348bb00f3b052dae990cbe206f/src/resourceLoader.js#L213

Loading the file takes longer than executing the resourceLoader script, which causes the promise to resolve and start the next file load. If this file is significantly smaller than the first file, it gets loaded before the loading of the first file is finished. This is even enhanced when dealing with slow connections.

feature: first view, first load feature

make it possible that the resurceloader loads and executes resources first which are "above the fold" so visible in the first viewport a user sees and load the rest of the page afterwards in addition to:
#164

cleanup the new docs

In the new docs there are still a lot broken links in the footer section, please lets clean them up before 3.0 release so the docs look polished :)

default file handlers are missing

current status: ther eare no default file handlers built in version 2 (like we had in version 1)
therefore v2 is not working "out of the box" and not like described in the documentation.
you have to configure handlers in every project, example:
https://github.com/biotope/biotope-boilerplate/blob/master/src/resources/ts/main.ts

expected:
the loader should have default file handlers build in, which can be obverwritten but should work without any configuration needed per project.

Depfu Error: No dependency files found

Hello,

We've tried to activate or update your repository on Depfu and couldn't find any supported dependency files. If we were to guess, we would say that this is not actually a project Depfu supports and has probably been activated by error.

Monorepos

Please note that Depfu currently only searches for your dependency files in the root folder. We do support monorepos and non-root files, but don't auto-detect them. If that's the case with this repo, please send us a quick email with the folder you want Depfu to work on and we'll set it up right away!

How to deactivate the project

  • Go to the Settings page of either your own account or the organization you've used
  • Go to "Installed Integrations"
  • Click the "Configure" button on the Depfu integration
  • Remove this repo (biotope/biotope-resource-loader) from the list of accessible repos.

Please note that using the "All Repositories" setting doesn't make a lot of sense with Depfu.

If you think that this is a mistake

Please let us know by sending an email to [email protected].


This is an automated issue by Depfu. You're getting it because someone configured Depfu to automatically update dependencies on this project.

Performance improvements

Async load of files
Already collect data-resource from Dom and start loading the resources as early as possible (maybe suggest in documentationmove resource loader to of html)
...

RFC: Change package manager to npm

I would like to propose the change from yarn to npm package manager.

I would like to do so, because of npm audit and because it feels more "native".

What do you think about it?

Versioned loads

We should be able to load scripts versioned. @timomayer could you provide a example syntax, what you have thought about.

Add link to biotope.sh

Is your feature request related to a problem? Please describe.
We would like to improve the findability of the Biotope website when people are using a search engine.
A link from this repository to the parent homepage would help with that to let search engines understand that this page is important.

Describe the solution you'd like
Please add a link in the readme and/or in the documentation with a similar text to this:

Biotope Resource Loader is part of Biotope, a toolchain for lasting design systems.

Biotope helps you to build, distribute and adopt a library of web components with a consistent design and of high quality across all your websites and apps. With Biotope you can easily collaborate with your team to develop and maintain the user interface of all your digital experiences from a single location.

If you want to learn more about Biotope and how you can benefit from using this toolchain please visit https://biotope.sh

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.