Giter VIP home page Giter VIP logo

unpoly-demo's Introduction

Progressive enhancement for HTML

Unpoly enhances your HTML with attributes to build dynamic UI on the server.

Unpoly works with any language or framework. It plays nice with existing code, and gracefully degrades without JavaScript.

This branch tracks the current major version, Unpoly 3.x.
If you're using Unpoly 2.x, use the 2.x-stable branch.
If you're using Unpoly 1.x or 0.x, use the 1.x-stable branch.

Getting started

Development

Installing development dependencies

To build Unpoly you require Node.js, Webpack and other npm packages.

Install the Node version from .nvmrc.

To install Webpack and other required npm packages, run:

npm install

Quick start

The following will build the library and open a web browser with the test suite:

npm run dev

To run individual tasks instead, see below.

Building the library

Tests don't consume the sources directly, but from a transpiled build in dist/.

To make fresh build, run:

npm run build-dev

This will build transpiled files such as:

dist/unpoly.js
dist/unpoly.css
dist/unpoly-migrate.js
dist/jasmine.js
dist/specs.js

There is also a task npm run build for a production build. This does not build files for testing, but also outputs minified versions.

Watching files for changes

During development it is impractical to make a full build after every change. Instead it is recommend to watch the project:

npm run watch-dev

This will make a fresh build and then watch the project for changes to the source files. When a source changes, affected build files are automatically recompiled. The incremental recompilation is much faster than a full build.

Running tests

Tests run using a browser-based Jasmine runner.

To start a web server serving the Jasmine runner:

npm run test

This will open a server on http://localhost:4000 and opens that URL with your default browser.

In addition to the unit tests, there is an optional support repo unpoly-manual-tests. It contains a Rails app to play with Unpoly features that are hard to test well with a unit test. E.g. the visual look of overlays, or edge cases when booting Unpoly.

Making a new release

You can use this repository to publish a new version of the unpoly npm package.

The release process currently requires Ruby. To install these dependencies:

  • Install the Ruby version from .ruby-version
  • Run bundle install

There is a guided CLI interface to lead you through the release process. To start the process run:

bundle exec rake release:process

Credits

unpoly-demo's People

Contributors

adam12 avatar apollo13 avatar dependabot[bot] avatar lcmen avatar triskweline avatar

Stargazers

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

Watchers

 avatar  avatar  avatar

unpoly-demo's Issues

Uncaught error in demo website after navigating with browser back button

Bug description

Hi, I was interested in the unpoly project and was navigating the demo when I found this bug. Navigation breaks due to an uncaught error after using the browser back button.

Reproduction project

https://demo.unpoly.com/

unpoly version is 3.2.2

Steps to reproduce the behavior:

  1. Go to https://demo.unpoly.com/
  2. Click on 'Companies', then the first Company, then their first Project
  3. Navigate back using the browser back button
  4. Multiple errors thrown in console, and site navigation no longer functional

Expected behavior

No exceptions thrown. Navigation still functional

Browser version

  • OS: MacOS 10.15.5
  • Browser: Chrome
  • Version: 114.0.5735.198

Additional context

Video recording of repro here:

unpoly_bug.mp4

Perhaps related to: unpoly/unpoly#469 ??

Project deletion from modal seems broken

Steps to reproduce:

the modal now shows all companies. It should (imo) close the modal and go back to the previous projects page (preferably with a flash message that the project was removed successfully) and update the projects page to no longer include that project.

Cookie “_unpoly_demo_layers_session” does not have a proper “SameSite” attribute value

Bug description

Message from FF dev Tools

Cookie “_unpoly_demo_layers_session” does not have a proper “SameSite” attribute value. Soon, cookies without the “SameSite” attribute or with an invalid value will be treated as “Lax”. This means that the cookie will no longer be sent in third-party contexts. If your application depends on this cookie being available in such contexts, please add the “SameSite=None“ attribute to it. To know more about the “SameSite“ attribute, read https://developer.mozilla.org/docs/Web/HTTP/Headers/Set-Cookie/SameSite

Reproduction project

Demo Website
https://demo.unpoly.com/tasks

Steps to reproduce the behavior:

  1. open firefox
  2. go to https://demo.unpoly.com/tasks
  3. enable Developer Tools
  4. disable cache
  5. remove all cookies
  6. reload page
  7. see message in output (see screenshot)

Expected behavior

no warning / future-proof “SameSite” attribute value

Browser version

  • Windows
  • Firefox
  • 118

Additional context

none

2023-09-22_09h59_54

imperfection: Layout display was forced before the page was fully loaded

with a slow connection / or throttling with devtool you can sometimes produce this warning and possibly notice the mentioned effect:

Layout-Darstellung wurde erzwungen, bevor die Seite vollständig geladen war. Falls Stylesheet noch nicht geladen sind, kann dies zu einem kurzzeitigen Darstellung des Inhalts ohne Formatierung führen.
translation: 
Layout display was forced before the page was fully loaded. If stylesheets are not yet loaded, this can lead to a temporary display of the content without formatting.

seen several times on the very first visit (no cache no cookies...) and throttling to 3G on https://demo.unpoly.com/companies

grafik

Add license

Some things (like the loading indicator) would be nice to poach from this project, but it would be helpful to indicate explicitly what license this repo is covered under.

Show off the up-disable

One of my favourite additions of unpoly 3 is the up-disable to disable a form while it is submitted. I would suggest adding this to the demo since it's trivial to add and improves the UX very much.

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.