mljs / matrix

Matrix manipulation and computation library
https://mljs.github.io/matrix/
MIT License
353 stars 54 forks source link

About Private properties # need babel support #180

Closed liuzeyang closed 9 months ago

liuzeyang commented 9 months ago

image

i find error in matrix, need add babel plugin to support that "plugins": [ "@babel/plugin-proposal-private-methods", "@babel/plugin-proposal-private-property-in-object" ]

tpoisseau commented 9 months ago

Hello,

I'm sorry it breaks on your code. Our publishing policy is to not transpile our code and expect a reasonable modern runtime to run it.

According to "Can I use" public, private class fields and private methods have been supported for 2 years. So we estimate that it is OK to use it.

Thanks for your feedback and your workaround. I hope it will be useful if someone else has the same error.

Best regards

liuzeyang commented 9 months ago

Hello,

I'm sorry it breaks on your code. Our publishing policy is to not transpile our code and expect a reasonable modern runtime to run it.

According to "Can I use" public, private class fields and private methods have been supported for 2 years. So we estimate that it is OK to use it.

Thanks for your feedback and your workaround. I hope it will be useful if someone else has the same error.

Best regards

I have submitted an issue to @antv/layout 0.3.x and will temporarily use resolutions to lock the version. Thank you for your reply.

tpoisseau commented 9 months ago

why close this issue?

Because we will keep usage of private fields / methods , and will not transpile to old target.

Best regards

mamedbekovruslan commented 9 months ago

I have some kind of this issue, but your resolve doesn`t work for me ...

What i do wrong ?

Failed to compile.

This my issue

./node_modules/ml-matrix/src/symmetricMatrix.js 7:2
Module parse failed: Unexpected character '#' (7:2)
File was processed with these loaders:
 * ./node_modules/babel-loader/lib/index.js
You may need an additional loader to handle the result of these loaders.
| export class SymmetricMatrix extends AbstractMatrix {
|   /** @type {Matrix} */
>   #matrix;
|   get size() {
|     return this.#matrix.size;
lidy996 commented 9 months ago

I have some kind of this issue, but your resolve doesn`t work for me ...

What i do wrong ?

Failed to compile.

This my issue

./node_modules/ml-matrix/src/symmetricMatrix.js 7:2
Module parse failed: Unexpected character '#' (7:2)
File was processed with these loaders:
 * ./node_modules/babel-loader/lib/index.js
You may need an additional loader to handle the result of these loaders.
| export class SymmetricMatrix extends AbstractMatrix {
|   /** @type {Matrix} */
>   #matrix;
|   get size() {
|     return this.#matrix.size;

Lock the ml-matrix on "6.10.8", It`s work for me "resolutions": { "ml-matrix": "6.10.8" }

mamedbekovruslan commented 9 months ago

Not work I tryed

XiayidanAlimu commented 2 months ago

Question

Attempt to import package butterfly-dag by loading on demand, but this introduces an compiling error in my project, this error is related to one of its dependencies: ml-matrix

Environment

  1. ml-matrix@6.11.0
  2. butterfly-dag@4.3.29
  3. vue@2.7.8

Steps to reproduce

importing butterfly-dag from fully import to load on demande

before ( fully import )

import { Node, Tips } from 'butterfly-dag'

This works all fine, but the bundled package size is too much, I want to reduce the package size for optimization concern.

after (load on demande )

import { Node, Tips } from 'butterfly-dag/pack/index.js'

Solutions Tried

I tried to add the following configurations as mentioned above in my project ./vue.config.js :

"plugins": [
"@babel/plugin-proposal-private-methods",
"@babel/plugin-proposal-private-property-in-object"
]

but I still have this error : image

I see in some issues answer, which suggest changing the version of ml-matrix, but in my context, this is a dependency imported by another dependency, so I may could not specify the version of the package ml-matrix