Skip to content
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

About Private properties # need babel support #180

Closed
liuzeyang opened this issue Nov 30, 2023 · 7 comments
Closed

About Private properties # need babel support #180

liuzeyang opened this issue Nov 30, 2023 · 7 comments

Comments

@liuzeyang
Copy link

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
Copy link
Contributor

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
Copy link
Author

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
Copy link
Contributor

why close this issue?

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

Best regards

@mamedbekovruslan
Copy link

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
Copy link

lidy996 commented Dec 6, 2023

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
Copy link

Not work
I tryed

@XiayidanAlimu
Copy link

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. [email protected]
  2. [email protected]
  3. [email protected]

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants