Giter Club home page Giter Club logo

pal-nodejs's Introduction

Aurelia

License: MIT npm version CircleCI TypeScript Twitter

Backers on Open Collective Sponsors on Open Collective Discord Chat

Aurelia 2

This is the Aurelia 2 monorepo, containing core and plugin packages, examples, benchmarks, and documentation for the upcoming major version of everybody's favorite modern JavaScript framework, Aurelia.

Introduction

Aurelia is a modern, front-end JavaScript framework for building browser, mobile, and desktop applications. It focuses on aligning closely with web platform specifications, using convention over configuration, and having minimal framework intrusion. Basically, we want you to just write your code without the framework getting in your way. ๐Ÿ˜‰

Aurelia applications are built by composing a series of simple components. By convention, components are made up of a vanilla JavaScript or Typescript class, with a corresponding HTML template.

//app.js
export class App {
  welcome = "Welcome to Aurelia";

  quests = [
    "To seek the holy grail",
    "To take the ring to Mordor",
    "To rescue princess Leia"
  ];
}
<!-- app.html -->
<form>
  <label>
    <span>What is your name?</span>
    <input value.bind="name & debounce:500">
  </label>

  <label>
    <span>What is your quest?</span>
    <select value.bind="quest">
      <option></option>
      <option repeat.for="q of quests">${q}</option>
    </select>
  </label>
</form>

<p if.bind="name">${welcome}, ${name}!</p>
<p if.bind="quest">Now set forth ${quest.toLowerCase()}!</p>

This example shows you some of the powerful features of the aurelia binding syntax. To learn further, please see our documentation.

Feeling excited? Check out how to use makes to get started in the next section.

Note: Please keep in mind that Aurelia 2 is still in beta. A number of features and use cases around the public API are still untested and there will be a few more breaking changes.

Getting Started

First, ensure that you have Node.js v8.9.0 or above installed on your system. Next, using npx, a tool distributed as part of Node.js, we'll create a new Aurelia 2 app. At a command prompt, run the following command:

npx makes aurelia

This will cause npx to download the makes scaffolding tool, along with the aurelia generator, which it will use to guide you through the setup process. Once complete, you'll have a new Aurelia 2 project ready to run. For more information on Aurelia's use of makes, see here. If you aren't interested in taking our preferred approach to generating a project, you can also see the examples folder in this repo for pure JIT setups (no conventions) with various loaders and bundlers.

Documentation

You can read the documentation on Aurelia 2 here. Our new docs are currently a work-in-progress, so the most complete documentation is available in our getting started section. If you've never used Aurelia before, you'll want to begin with our Quick Start Guide.

Contributing

If you are interested in contributing to Aurelia, please see our contributor documentation for more information. You'll learn how to build the code and run tests, how best to engage in our social channels, how to submit PRs, and even how to contribute to our documentation. We welcome you and thank you in advance for joining with us in this endeavor.

Staying Up-to-Date

To keep up to date on Aurelia, please visit and subscribe to the official blog and our email list. We also invite you to follow us on twitter. If you have questions, have a look around our Discourse forum. For chat on Aurelia 2, join our new Aurelia 2 community on Discord. If you'd like to join the growing list of Aurelia sponsors, please back us on Open Collective.

License

Aurelia is MIT licensed. You can find out more and read the license document here.

pal-nodejs's People

Contributors

3cp avatar alexander-taran avatar bigopon avatar devanp92 avatar doktordirk avatar eisenbergeffect avatar fkleuver avatar jeroenvinke avatar martingust avatar meirionhughes avatar mkohlmyr avatar niieani avatar strahilkazlachev avatar strepon avatar timfish avatar zewa666 avatar

Stargazers

 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pal-nodejs's Issues

Basic usage

Hi,

Is the library usable for basic markup ? Can you provide some documentation on how use this ?

nodejs process doesn't terminate

Version: 1.0.0-alpha.2

integrating aurelia with latest version leads to a lock up of of the nodejs process. Mostly likely due to the timers used by the mutation observer.

Need an option to disable/tear-down the mutation-observer's dirty checking to allow the node process to terminate.

SVGElement is not properly polyfilled

It's not implemented in JSDOM :(

jsdom/jsdom#1423

We should at least make it an fallback to an empty class for now, cause I'm getting unhandled rejections now from aurelia-binding that does instanceof SVGElement checks:

<rejected> TypeError: Right-hand side of 'instanceof' is not an object
    at ObserverLocator.getAccessor (./node_modules/aurelia-binding/dist/commonjs/aurelia-binding.js:4612:59)

Security issue in jsdom dependency

I'm submitting a bug report

  • Library Version:
    2.0.0

Please tell us about your environment:

  • Operating System:
    Linux Ubuntu

  • Node Version:
    10.16.0

  • NPM Version:
    6.9.0

  • JSPM OR Webpack AND Version
    npm - using this on the server

  • Browser:
    N/A

  • Language:
    Typescript
    4.1.5

Current behavior:
Security issue reported by snyk:
Run 'snyk test' and you get

  โœ— Prototype Pollution [High Severity][https://snyk.io/vuln/SNYK-JS-AJV-584908] in [email protected]
    introduced by [email protected] > [email protected] > [email protected] > [email protected] > [email protected] and 1 other path(s)
  This issue was fixed in versions: 6.12.3

Expected/desired behavior:
No security issues

  • What is the expected behavior?
    No security issues

  • What is the motivation / use case for changing the behavior?
    Security

I think it may be a case of rebuilding the package and re-publishing but not 100%.

NodeList not available in context of testing with Jest

I'm submitting a bug report

  • Library Version:
    1.0.0-beta.3.0.0

Please tell us about your environment:

  • Operating System:
    Windows 10

  • Node Version:
    8.5.0

  • NPM Version:
    yarn 1.3.2

  • Language:
    TypeScript 2.7.1

Current behavior:
https://github.com/aurelia/testing/blob/b0fb939fa40f1067ac72d84c7775088f8b8068a6/src/wait.ts#L27
When tests are run with jest there is no instanceof NodeList.
It is though under global.window, not under global though.
So even though the element is successfully found by waitForElement - it is not returned.

  • What is the expected behavior?
    waitForElement returns an element when using Jest to run tests.

  • What is the motivation / use case for changing the behavior?
    being able to waitForElement in tests

can be closed with #28

same issue in testing repo aurelia/testing#83

Implement

  • Implement Platform
  • Implement Dom
  • Implement MutationObserver
    • Attribute Mutation
    • Content Mutation
    • ChildList Mutation
    • SubTree Mutation
  • Test Platform
  • Test Dom
  • Test MutationObserver
    • Attribute Mutation
    • Content Mutation
    • ChildList Mutation
    • SubTree Mutation

Trigger Mutation Search only on change.

Currently the mutation searcher operates via a timer. With many observers this is likely to be a performance drain. Most importantly, using repeating timers locks the process open and requires explicit clean up (See #12).

  • add `MutationNotifier singleton, extend EventEmitter
    • notifychanged(node:Node) emits "changed" (node:Node)
  • have all MutationObserver subscribe to MutationNotifier
    • on "changed" call setTimeout, if null
  • patch jsdom prototype methods to call MutationNotifier.instance().notifychanged(this)
  • Node
    • "appendChild" method;
    • "insertBefore" method;
    • "removeChild" method;
    • "replaceChild" method;
    • "nodeValue" setter;
    • "textContent" setter;
  • Element
    • "setAttribute" method;
    • "removeAttribute" method;
    • "removeAttributeNode" method;
    • "removeAttributeNS" method;

Not writable "undefined" property with jsdom 19

I'm submitting a bug report

  • Library Version:
    3.0.0-rc.1

Please tell us about your environment:

  • Operating System:
    Linux (Ubuntu 23.04)

  • Node Version:
    18.16.1

  • NPM Version:
    9.5.1

Current behavior:
After upgrading aurelia-pal-nodejs from 2.0.0 (with jsdom 15) to 3.0.0-rc.1 (with jsdom 19), my components tests using aurelia-testing stopped to work because the initialization of ComponentTester (its create method) fails with: TypeError: Cannot assign to read only property 'undefined' of object '#<Object>' at this line.

This happens because of upgraded jsdom package whose version 16 adds not writable undefined property to its window.

Is this supposed to work? Or is there maybe anything wrong in my setup?

Integration Testing

  • Load index.html with jsdom not-applicable.
  • bootstrap aurelia and global resources.
  • deal with any loader issues (if any).
  • Serialise HTML AST with jsdom
  • ensure "hello world" added to DOM by aurelia

Refreshing current page after initial load returns an Internal Server Error

I'm submitting a bug report

  • Library Version:
    1.2.0

Please tell us about your environment:

  • Operating System:
    Windows 10

  • Node Version:
    8.12.0

  • NPM Version:
    6.4.1
  • JSPM OR Webpack AND Version
    webpack ^4.1.1
  • Browser:
    all
  • Language:
    ESNext

Current behavior:
Building an SSR-enabled site with aurelia, and after I've updated the aurelia-cli to version 1.0.0-beta.12 (both globally and with --save-dev I've started getting exceptions upon refreshing the page.

The first run of the site after npm run server works fine, hoewever, as soon as you press F5 to refresh whichever page you're on, the page only displays Internal server error, and I get one of two exceptions.

First I aways get this aurelia-pal-nodejs exception:


  TypeError: Cannot set property XMLHttpRequest of #<NodeJsPlatform> which has only a getter
      at Function.assign (<anonymous>)
      at aurelia_pal_1.initializePAL (C:\Software Development\Projects\Gigantisch\TrappenGigant\TrappenGigant\node_modules\aurelia-pal-nodejs\dist\index.js:18:16)
      at Object.initializePAL (C:\Software Development\Projects\Gigantisch\TrappenGigant\TrappenGigant\node_modules\aurelia-pal\dist\commonjs\aurelia-pal.js:96:3)
      at Object.initialize (C:\Software Development\Projects\Gigantisch\TrappenGigant\TrappenGigant\node_modules\aurelia-pal-nodejs\dist\index.js:17:19)
      at Object.151 (C:\Software Development\Projects\Gigantisch\TrappenGigant\TrappenGigant\dist\server.bundle.js:1:136916)
      at r (C:\Software Development\Projects\Gigantisch\TrappenGigant\TrappenGigant\dist\server.bundle.js:1:194)
      at Object.62 (C:\Software Development\Projects\Gigantisch\TrappenGigant\TrappenGigant\dist\server.bundle.js:1:409630)
      at r (C:\Software Development\Projects\Gigantisch\TrappenGigant\TrappenGigant\dist\server.bundle.js:1:194)
      at module.exports.0.t.__esModule (C:\Software Development\Projects\Gigantisch\TrappenGigant\TrappenGigant\dist\server.bundle.js:1:1219)
      at Object.<anonymous> (C:\Software Development\Projects\Gigantisch\TrappenGigant\TrappenGigant\dist\server.bundle.js:1:1229)
      at Module._compile (module.js:653:30)
      at Object.Module._extensions..js (module.js:664:10)
      at Module.load (module.js:566:32)
      at tryModuleLoad (module.js:506:12)
      at Function.Module._load (module.js:498:3)
      at Module.require (module.js:597:17)

And if I press F5 again on the page, the aurelia-ssr-engine exception comes up (I've made and issue on that repo as well):

  TypeError: Cannot read property 'reconfigure' of undefined
      at start (C:\Software Development\Projects\Gigantisch\TrappenGigant\TrappenGigant\node_modules\aurelia-ssr-engine\dist\commonjs\aurelia-ssr-engine.js:53:20)
      at render (C:\Software Development\Projects\Gigantisch\TrappenGigant\TrappenGigant\node_modules\aurelia-ssr-engine\dist\commonjs\aurelia-ssr-engine.js:25:12)
      at C:\Software Development\Projects\Gigantisch\TrappenGigant\TrappenGigant\custom-middleware-koa.js:14:12
      at app.use (C:\Software Development\Projects\Gigantisch\TrappenGigant\TrappenGigant\server.js:85:9)
      at dispatch (C:\Software Development\Projects\Gigantisch\TrappenGigant\TrappenGigant\node_modules\koa-compose\index.js:42:32)
      at app.use (C:\Software Development\Projects\Gigantisch\TrappenGigant\TrappenGigant\server.js:57:16)
      at dispatch (C:\Software Development\Projects\Gigantisch\TrappenGigant\TrappenGigant\node_modules\koa-compose\index.js:42:32)
      at app.use (C:\Software Development\Projects\Gigantisch\TrappenGigant\TrappenGigant\server.js:38:18)
      at dispatch (C:\Software Development\Projects\Gigantisch\TrappenGigant\TrappenGigant\node_modules\koa-compose\index.js:42:32)
      at C:\Software Development\Projects\Gigantisch\TrappenGigant\TrappenGigant\node_modules\koa-http-request\index.js:14:11
      at dispatch (C:\Software Development\Projects\Gigantisch\TrappenGigant\TrappenGigant\node_modules\koa-compose\index.js:42:32)
      at serve (C:\Software Development\Projects\Gigantisch\TrappenGigant\TrappenGigant\node_modules\koa-static\index.js:53:15)
      at <anonymous>`

Note that I'm using two forks by @JeroenVinke (sorry for the tag, dude) of the aurelia-ssr-engine and aurelia-ssr-bootstrapper-webpack:

"aurelia-ssr-bootstrapper-webpack": "github:JeroenVinke/ssr-bootstrapper-webpack-1#error-handling-build",
"aurelia-ssr-engine": "github:JeroenVinke/ssr-engine#meta-tags-build",

Also relevant might be the custom middleware for Koa that we use, which has been in place for months and has worked perfectly until this update of the cli:

const {render} = require("aurelia-ssr-engine");

function aureliaKoaMiddleware (renderOptions, initializationOptions) {
  return function (ctx, next) {
    const url = ctx.request.URL;
    const pathname = url.pathname;

    // skip requests where urls have an extension
    const extensionMatcher = /^.*\.[^\\]+$/;
    if (pathname.match(extensionMatcher)) {
      return next();
    }

    return render(Object.assign({ url }, renderOptions), initializationOptions)
    .then((html) => {
      ctx.body = html;
    })
    .catch((e) => {
      // if there is an error, call next middleware (which serve the default html template without SSR)
      console.log(e);
      return next();
    });
  };
};

module.exports = {
  aureliaKoaMiddleware
};

Expected/desired behavior:

  • What is the expected behavior?
    I can refresh the page as many times as I want without getting exceptions

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.