New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Built-in attributes are missing when using configureAliases with reflect-metadata #209

Closed
timfish opened this Issue Apr 12, 2017 · 13 comments

Comments

Projects
None yet
3 participants
@timfish
Contributor

timfish commented Apr 12, 2017

I've opened a new issue to cover my findings at the end of this issue.

When using the new configureAliases methods with reflect-metadata, aurelia is missing all the built in attributes from aurelia-templating-resources and so any basic app will not load.

This can be reproduced by:

  • Taking the basic Typescript skeleton
  • Add i18n and use the new configureAliases methods
  • jspm install reflect-metadata
  • Add import 'reflect-metadata'; to the top of main.ts

This repo also reproduces the issue: https://github.com/timfish/aurelia-i18n-issue192

@EisenbergEffect

This comment has been minimized.

Show comment
Hide comment
@EisenbergEffect

EisenbergEffect Apr 12, 2017

Member

@zewa666 Can you look into this?

Member

EisenbergEffect commented Apr 12, 2017

@zewa666 Can you look into this?

@EisenbergEffect EisenbergEffect added the bug label Apr 12, 2017

@zewa666

This comment has been minimized.

Show comment
Hide comment
@zewa666

zewa666 Apr 12, 2017

Member

@EisenbergEffect sure, @timfish I can't start with the repo mentioned since its lacking a input-placeholder whatever. Can you try to bring the repo to a buildable state?

Member

zewa666 commented Apr 12, 2017

@EisenbergEffect sure, @timfish I can't start with the repo mentioned since its lacking a input-placeholder whatever. Can you try to bring the repo to a buildable state?

@timfish

This comment has been minimized.

Show comment
Hide comment
@timfish

timfish Apr 12, 2017

Contributor

Sorry, my bad. Check this one out: https://github.com/timfish/aurelia-i18n-issue-209

First commit - Initial add skeleton
Second commit - Basic i18n working with configureAliases
Third commit - Simply added reflect-metadata

image

Contributor

timfish commented Apr 12, 2017

Sorry, my bad. Check this one out: https://github.com/timfish/aurelia-i18n-issue-209

First commit - Initial add skeleton
Second commit - Basic i18n working with configureAliases
Third commit - Simply added reflect-metadata

image

@zewa666

This comment has been minimized.

Show comment
Hide comment
@zewa666

zewa666 Apr 13, 2017

Member

@EisenbergEffect wow that seems to be something really strange. Its not related to the aliases at all but if I do the following:

import 'bootstrap';
import {Aurelia} from 'aurelia-framework';
import { I18N, TCustomAttribute, TParamsCustomAttribute } from 'aurelia-i18n';
import * as Backend from 'i18next-xhr-backend';
import 'reflect-metadata';

export function configure(aurelia: Aurelia) {
  console.log(TCustomAttribute)
}

It's already enough to raise the issue.
Could it be that the bootstrapper/framework is not done yet and thus creating the issue?

Member

zewa666 commented Apr 13, 2017

@EisenbergEffect wow that seems to be something really strange. Its not related to the aliases at all but if I do the following:

import 'bootstrap';
import {Aurelia} from 'aurelia-framework';
import { I18N, TCustomAttribute, TParamsCustomAttribute } from 'aurelia-i18n';
import * as Backend from 'i18next-xhr-backend';
import 'reflect-metadata';

export function configure(aurelia: Aurelia) {
  console.log(TCustomAttribute)
}

It's already enough to raise the issue.
Could it be that the bootstrapper/framework is not done yet and thus creating the issue?

@EisenbergEffect

This comment has been minimized.

Show comment
Hide comment
@EisenbergEffect

EisenbergEffect Apr 13, 2017

Member

Possibly, reflect-metadata is added too late....and so you get one method of storing metadata being replaced by another and they aren't reading the metadata from the same spot. Just a guess...

Member

EisenbergEffect commented Apr 13, 2017

Possibly, reflect-metadata is added too late....and so you get one method of storing metadata being replaced by another and they aren't reading the metadata from the same spot. Just a guess...

@zewa666

This comment has been minimized.

Show comment
Hide comment
@zewa666

zewa666 Apr 13, 2017

Member

@EisenbergEffect you're right. @timfish in your example if I remove the import of reflect-metadata in main.ts and change the index.html to look like:

<script src="jspm_packages/system.js"></script>
    <script src="config.js"></script>
    <script src="jspm_packages/npm/bluebird@3.4.1/js/browser/bluebird.min.js"></script>
    <script>
      System.import('reflect-metadata').then( () => {
        System.import('aurelia-bootstrapper');  
      });
    </script>

everything works properly

@EisenbergEffect how do we go about this? Is this a known issue or do we have a way to fix that somehow?

Member

zewa666 commented Apr 13, 2017

@EisenbergEffect you're right. @timfish in your example if I remove the import of reflect-metadata in main.ts and change the index.html to look like:

<script src="jspm_packages/system.js"></script>
    <script src="config.js"></script>
    <script src="jspm_packages/npm/bluebird@3.4.1/js/browser/bluebird.min.js"></script>
    <script>
      System.import('reflect-metadata').then( () => {
        System.import('aurelia-bootstrapper');  
      });
    </script>

everything works properly

@EisenbergEffect how do we go about this? Is this a known issue or do we have a way to fix that somehow?

@timfish

This comment has been minimized.

Show comment
Hide comment
@timfish

timfish Apr 13, 2017

Contributor

@zewa666 Thanks for tracking this down.

It fixes the issue on my large project. Its probably just enough to document this somewhere?

Contributor

timfish commented Apr 13, 2017

@zewa666 Thanks for tracking this down.

It fixes the issue on my large project. Its probably just enough to document this somewhere?

@zewa666

This comment has been minimized.

Show comment
Hide comment
@zewa666

zewa666 Apr 13, 2017

Member

I mean it would be nice if we could track down the reason why it doesn't work, but I suspect this will quite hard so for the begin a update for the docs would be the way to go.
Could you create a PR for that @timfish and reference this issue?

Member

zewa666 commented Apr 13, 2017

I mean it would be nice if we could track down the reason why it doesn't work, but I suspect this will quite hard so for the begin a update for the docs would be the way to go.
Could you create a PR for that @timfish and reference this issue?

@timfish

This comment has been minimized.

Show comment
Hide comment
@timfish

timfish Apr 13, 2017

Contributor

Before #typescript-support I could add a reflect-metadata heading with some details, the above code and link to this issue?

Contributor

timfish commented Apr 13, 2017

Before #typescript-support I could add a reflect-metadata heading with some details, the above code and link to this issue?

@zewa666

This comment has been minimized.

Show comment
Hide comment
@zewa666

zewa666 Apr 13, 2017

Member

yeah that sounds good

Member

zewa666 commented Apr 13, 2017

yeah that sounds good

@timfish

This comment has been minimized.

Show comment
Hide comment
@timfish

timfish Apr 13, 2017

Contributor

#210

Is this an issue with Webpack/CLI too?

Contributor

timfish commented Apr 13, 2017

#210

Is this an issue with Webpack/CLI too?

@zewa666

This comment has been minimized.

Show comment
Hide comment
@zewa666

zewa666 Apr 13, 2017

Member

hm I guess so

Member

zewa666 commented Apr 13, 2017

hm I guess so

@zewa666

This comment has been minimized.

Show comment
Hide comment
@zewa666

zewa666 Apr 18, 2017

Member

I'm closing this for now since it is documented. If we experience further issues we can reopen this one

Member

zewa666 commented Apr 18, 2017

I'm closing this for now since it is documented. If we experience further issues we can reopen this one

@zewa666 zewa666 closed this Apr 18, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment