profile
viewpoint
遗忘
carvin carvinlo Front-End Engineer TypeScript + VSCode

carvinlo/101 0

A modern JS utility library

carvinlo/12-javascript-quirks 0

javascript 的 12 个怪癖(quirks)

carvinlo/angular-node-express-jade-phonecat 0

这是AngularJS官方入门教程项目(phonecat)的 angular+node+express+jade的实现版本

carvinlo/angularjs-book 0

Examples and Code snippets from the AngularJS O'Reilly book

carvinlo/angularjs-cn 0

AngularJS

carvinlo/AngularjsTutorial_cn 0

AngularJS入门教程——AngularJS中文社区提供

carvinlo/babel-loader-lerna-cra 0

Transpile Create-React-App imports in Lerna projects.

carvinlo/blog 0

没事写写文章

carvinlo/blog-1 0

Here is my blog

issue commentFlorianRappl/kras

proxy discards cookies and custom headers

The DEFAULT is just the aggregation of the default list. Maybe add a defaultHeaders(Boolean|Array) option to allow users to enable or disable or override this implicit default request header instead of this DEFAULT. Some scenes:

default list contains: authorization, accept, content-type req.headers contains: authorization, accept, content-type, cookie, x-csrf-token, host, referer

{
  "name": "kras",
  ...
  "injectors": {
    "proxy": {
      "active": true,
      "defaultHeaders": true,
      "permitHeaders": ["cookie", "x-csrf-token"]
    }
  },
  ...
}

Finally allow Headers: authorization, accept, content-type, cookie, x-csrf-token 2.

{
  "name": "kras",
  ...
  "injectors": {
    "proxy": {
      "active": true,
      "defaultHeaders": false,
      "discardHeaders": ["host", "referer"]
    }
  },
  ...
}

Finally allow Headers: authorization, accept, content-type, cookie, x-csrf-token 3. And so on...

It may be that I made it complicated, anyway, your plan can already meet the current needs!

carvinlo

comment created time in 15 hours

issue commentFlorianRappl/kras

proxy discards cookies and custom headers

  • If permitHeaders and discardHeaders are configured at the same time, discardHeaders is excluded based on permitHeaders, such as:
{
  "name": "kras",
  ...
  "injectors": {
    "proxy": {
      "active": true,
      "permitHeaders": ["DEFAULT", "cookie"],
      "discardHeaders": ["authorization"]
    }
  },
  ...
}

The DEFAULT element in permitHeaders is equivalent to default list.

  • else discardHeaders is excluded based on headers of the request object, such as:
{
  "name": "kras",
  ...
  "injectors": {
    "proxy": {
      "active": true,
      "discardHeaders": ["authorization"]
    }
  },
  ...
}
carvinlo

comment created time in a day

issue commentFlorianRappl/kras

proxy discards cookies and custom headers

The permit list is sufficient for most scenarios. Users can decide whether to allow or deny certain request headers. I'm not sure if these new request headers are safe, or perhaps remain the same until a new request is made by the user.

carvinlo

comment created time in 2 days

issue commentFlorianRappl/kras

proxy discards cookies and custom headers

Very good suggestion, how to add the following two configurations to the proxy-injector: .krasrc

{
  "name": "kras",
  ...
  "injectors": {
    "proxy": {
      "active": true,
      "followRedirect": false,
      "permitHeaders": ["cookie", "x-csrf-token"]
    }
  },
  ...
}
carvinlo

comment created time in 2 days

issue openedFlorianRappl/kras

proxy discards cookies and custom headers

  1. proxy discards cookies and custom headers such as csrf token.
  2. When the authentication expires, the json content-type is requested but the html content-type of 200 status is returned. If the followRedirect option can be set by the user, then the 302 status can be returned to the browser for processing. That's the patch

created time in 4 days

push eventcarvinlo/kras

carvin

commit sha f256e61cc789813fce0d7ec82772ea2ad96196a0

discards cookies and custom headers discards cookies and custom headers such as csrf token

view details

push time in 4 days

fork carvinlo/kras

Efficient server proxying and mocking in Node.js. :muscle:

fork in 4 days

PR closed smapiot/piral

Support https cli enhancement

New Pull Request

For more information, see the CONTRIBUTING guide.

Prerequisites

Please make sure you can check the following boxes:

  • [x] I have read the CONTRIBUTING document
  • [ ] My code follows the code style of this project
  • [ ] All new and existing tests passed

Type(s) of Changes

Contribution Type

What types of changes does your code introduce? Put an x in all the boxes that apply:

  • [x] Bug fix (non-breaking change which fixes an issue, please reference the issue id)
  • [ ] New feature (non-breaking change which adds functionality, make sure to open an associated issue first)
  • [ ] Breaking change (fix or feature that would cause existing functionality to change)
  • [ ] I have updated the documentation accordingly
  • [ ] I have added tests to cover my changes

Description

[Place a meaningful description here]

Remarks

[Optionally place any follow-up comments, remarks, observations, or notes here for future reference]

+7 -3

1 comment

1 changed file

carvinlo

pr closed time in 7 days

pull request commentsmapiot/piral

Support https

Clean up the commit, pull a new PR.

carvinlo

comment created time in 7 days

PR opened smapiot/piral

Support https

Support https

New Pull Request

For more information, see the CONTRIBUTING guide.

Prerequisites

Please make sure you can check the following boxes:

  • [ ] I have read the CONTRIBUTING document
  • [ ] My code follows the code style of this project
  • [ ] All new and existing tests passed

Type(s) of Changes

Contribution Type

What types of changes does your code introduce? Put an x in all the boxes that apply:

  • [ ] Bug fix (non-breaking change which fixes an issue, please reference the issue id)
  • [ ] New feature (non-breaking change which adds functionality, make sure to open an associated issue first)
  • [ ] Breaking change (fix or feature that would cause existing functionality to change)
  • [ ] I have updated the documentation accordingly
  • [ ] I have added tests to cover my changes

Description

[Place a meaningful description here]

Remarks

[Optionally place any follow-up comments, remarks, observations, or notes here for future reference]

+5 -1

0 comment

1 changed file

pr created time in 7 days

push eventcarvinlo/piral

carvin

commit sha c03da6db3c4f9a40a43cc6b52f2368010f113bb2

Support https Support https

view details

push time in 7 days

push eventcarvinlo/piral

carvin

commit sha 73cd3b615440c9afb6efc933a4296b3b33631b84

Fix Protocol type Fix Protocol type

view details

push time in 8 days

push eventcarvinlo/piral

carvin

commit sha 127c481774d62d86ab2f249c23c1182e2e65835f

Remove ssl from injector config Remove ssl from injector config

view details

push time in 8 days

push eventcarvinlo/piral

carvin

commit sha eea430e586ed4498abf6e7f6f4801c03f8672f4e

Improved protocol Improved protocol

view details

push time in 8 days

Pull request review commentsmapiot/piral

Support https

 export interface PiletInjectorConfig extends KrasInjectorConfig { export default class PiletInjector implements KrasInjector {   public config: PiletInjectorConfig;   private port: number;+  private https: boolean;

ok

carvinlo

comment created time in 8 days

Pull request review commentsmapiot/piral

Support https

 export interface PiletInjectorConfig extends KrasInjectorConfig { export default class PiletInjector implements KrasInjector {   public config: PiletInjectorConfig;   private port: number;+  private https: boolean;    constructor(options: PiletInjectorConfig, config: KrasConfiguration, core: EventEmitter) {     this.config = options;     this.port = config.port;+    this.https = !!config.ssl;

Thanks for pointing right

carvinlo

comment created time in 8 days

Pull request review commentsmapiot/piral

Support https

 export async function debugPilet(baseDir = process.cwd(), options: DebugPiletOpt   }    const injectorConfig = {+    ssl: krasConfig.ssl,

Thanks for pointing right

carvinlo

comment created time in 8 days

PR opened smapiot/piral

Support https

New Pull Request

For more information, see the CONTRIBUTING guide.

Prerequisites

Please make sure you can check the following boxes:

  • [ ] I have read the CONTRIBUTING document
  • [ ] My code follows the code style of this project
  • [ ] All new and existing tests passed

Type(s) of Changes

Contribution Type

What types of changes does your code introduce? Put an x in all the boxes that apply:

  • [ ] Bug fix (non-breaking change which fixes an issue, please reference the issue id)
  • [ ] New feature (non-breaking change which adds functionality, make sure to open an associated issue first)
  • [ ] Breaking change (fix or feature that would cause existing functionality to change)
  • [ ] I have updated the documentation accordingly
  • [ ] I have added tests to cover my changes

Description

[Place a meaningful description here]

Remarks

[Optionally place any follow-up comments, remarks, observations, or notes here for future reference]

+6 -3

0 comment

2 changed files

pr created time in 8 days

push eventcarvinlo/piral

amu

commit sha 39587c5052de8839b01c80523ecaa8e952cc4a22

Support https

view details

push time in 8 days

fork carvinlo/piral

Framework for next generation web apps using microfrontends. :rocket:

https://piral.io

fork in 8 days

Pull request review commentsmapiot/piral

WIP: return absolute path for pilet link in emulator environment

 export default class PiletInjector implements KrasInjector {   setOptions() {}    getMetaOf(index: number) {-    const { api, pilets } = this.config;+    const { port, api, pilets } = this.config;     const { bundler, root, requireRef } = pilets[index];     const def = JSON.parse(readFileSync(join(root, 'package.json'), 'utf8'));     const file = bundler.bundle.name.replace(/^\//, '');     return {       name: def.name,       version: def.version,-      link: `${api}/${index}/${file}`,+      link: `http://localhost:${port}${api}/${index}/${file}`,

Hi, here is the background

lamson

comment created time in 9 days

startedtholman/elevator.js

started time in 11 days

PR opened smapiot/piral

Also filter out things like "@scope/redux-saga/effects"

Dependency names like "@scope/redux-saga/effects" are not valid

New Pull Request

For more information, see the CONTRIBUTING guide.

Prerequisites

Please make sure you can check the following boxes:

  • [ ] I have read the CONTRIBUTING document
  • [ ] My code follows the code style of this project
  • [ ] All new and existing tests passed

Type(s) of Changes

Contribution Type

What types of changes does your code introduce? Put an x in all the boxes that apply:

  • [ ] Bug fix (non-breaking change which fixes an issue, please reference the issue id)
  • [ ] New feature (non-breaking change which adds functionality, make sure to open an associated issue first)
  • [ ] Breaking change (fix or feature that would cause existing functionality to change)
  • [ ] I have updated the documentation accordingly
  • [ ] I have added tests to cover my changes

Description

[Place a meaningful description here]

Remarks

[Optionally place any follow-up comments, remarks, observations, or notes here for future reference]

+2 -2

0 comment

1 changed file

pr created time in 15 days

push eventcarvinlo/piral

carvin

commit sha 616bfaf47a0e1a55ed99a61882ab32d0e5055e69

Also filter out things like "@scope/redux-saga/effects" Dependency names like "@scope/redux-saga/effects" are not valid

view details

push time in 15 days

issue commentFlorianRappl/kras

Support to use faker in the injector

What I meant was that the swagger-injector plugin for kras never finished as I did not see anyone using this feature instead of more explicit mocks.

Understood!

Happy to continue there, or do you want to contribute?

I'm very sorry for this. I am not good at the development of back-end tools and have no experience in back-end development.

carvinlo

comment created time in 22 days

issue commentFlorianRappl/kras

Support to use faker in the injector

Swagger injector never finished - I started it but did not see much use unless someone wants it / finds it useful.

Yep, it seems that there are few projects using swagger. If the backend development uses swagger, this is very useful for front-end developers (used to monitor the response content field changes and export swagger files can be used to mock data).

carvinlo

comment created time in 22 days

issue commentFlorianRappl/kras

Support to use faker in the injector

Maybe,

  1. Using a mustache string format in the response content of json-injector, like {{image.imageUrl}}

During use, it was found that the response content only supports string and buffer types, and support for the json type is more convenient for modifying complex response content.

  1. Built-in faker.js in script-injector.
  2. Added faker type in swagger-injector, like the x-faker of prism

By the way, is there any documents about swagger-injector

carvinlo

comment created time in 22 days

issue openedFlorianRappl/kras

Support to use faker in the injector

The experience of using kras is very good, you can quickly switch between mock and proxy, if it can support the use of faker in the injector, it will be more perfect, like the x-faker of prism :100:

created time in 22 days

issue closedFlorianRappl/piral-cli-webpack

Errors raised by WebSocket

Bug Report

For more information, see the CONTRIBUTING guide.

Prerequisites

  • [ ] Can you reproduce the problem in a MWE?
  • [ ] Are you running the latest version?
  • [x] Did you perform a search in the issues?

Environment Details and Version

piral-cli@0.11.5 IE11 piral-cli-webpack@0.5.3

Description

The page refresh is always triggered by webpack-dev-server. Under IE11, const ws = new WebSocket(updateTarget); will trigger a read ECONNRESET error after the page is automatically refreshed.

Steps to Reproduce

  1. Debug pilet in ie11
  2. Manually refresh the ie browser or modify the code to trigger the page to automatically refresh
  3. webpack-dev-server crashed and output an error in the console:
Unhandled 'error' event
Error: read ECONNRESET
  1. Works well on chrome browser

Expected behavior

[What you expected to happen]

Actual behavior

[What actually happened]

Possible Origin / Solution

If comment out this socket code, it works well on ie11. When I replace WebSocket with sockjs-client to be compatible with IE11(the code), it works fine on chrome and ie11. Is this feasible?

closed time in 23 days

carvinlo

issue commentFlorianRappl/piral-cli-webpack

Errors raised by WebSocket

Work fine with kras under ie11! perfect!

carvinlo

comment created time in 23 days

startedFlorianRappl/kras

started time in 25 days

startedFlorianRappl/kras-swagger-injector

started time in 25 days

issue commentsmapiot/piral

Make Webpack a First Class Option

The information you provided is very helpful. I also verified that piral is working well as expected, and continue to pay attention to the new features of piral, thank you!

FlorianRappl

comment created time in a month

issue commentsmapiot/piral

Make Webpack a First Class Option

Got it, you are the most responsive developer I have ever seen, and thank you for your patience and precious time for such a detailed answer. Thanks again!

FlorianRappl

comment created time in a month

issue commentsmapiot/piral

Make Webpack a First Class Option

I'm sorry I didn't re-view the new version of the document and only saw the discussion:

By default, this flag would pick the first integrated bundler (or install / try to choose Parcel or the bundler from the .piralrc file), however, it could be also just picked --bundler webpack: If not installed a plugin with that name will be resolved (piral-cli-webpack). Misunderstanding that all commands are compiled using webpack in the same way. So, following your instructions, re-use the 0.11.7-pre.1433 version, and found that the third-party (e.g., redux) shared dependencies are not excluded, and are included in the bundle package of the shell application and the pilet application: app-shell package.json

{
  "name": "app-shell",
  "dependencies": {
    "redux": "latest"
  },
  "pilets": {
    "externals": [
      "redux"
    ]
  }
}

pilet package.json

{
  "name": "sample-pilet",
  "dependencies": {
    "redux": "latest"
  },
  "piral": {
    "comment": "Keep this section to use the Piral CLI.",
    "name": "app-shell"
  }
}

Search for the redux code snippet in the browser, that still included in the bundle package of the shell application and the pilet application. Screenshot: image Here is the sample

FlorianRappl

comment created time in a month

push eventcarvinlo/piral-sample

amu

commit sha 75fef4e225ee927132fbcb1b1b0f2b8d5027501e

Getting Started

view details

push time in a month

create barnchcarvinlo/piral-sample

branch : master

created branch time in a month

created repositorycarvinlo/piral-sample

created time in a month

issue commentsmapiot/piral

Make Webpack a First Class Option

I updated to piral-cli@0.11.7-pre.1433, then used pilet debug --bundler webpack, and then showed ʻUnrecognized option: bundler`

FlorianRappl

comment created time in a month

issue commentsmapiot/piral

Make Webpack a First Class Option

In debug pilet mode, seems the shared dependencies did not work, and found that this code always didn't execute.

FlorianRappl

comment created time in a month

issue commentsmapiot/piral

Make Webpack a First Class Option

Can I test with the latest version now? If it is now, I will reproduce the issue that appears to you. If this function is still being tested, please ignore this message, thanks!

FlorianRappl

comment created time in a month

fork carvinlo/piral

Framework for next generation web apps using microfrontends. :rocket:

https://piral.io

fork in a month

startedsmapiot/piral

started time in a month

issue commentsmapiot/piral

Sanity Check for Multi-Pilet Debugging

  • the shared dependencies

Does this include scanning for dependencies that are not explicitly shared between the app shell and the pilet (including third-party dependencies)? The current idea is to use webpack-bundle-analyzer to scan the app-shell to get the results, visually check the relatively large dependencies and then summarize them in pilets.externals.

FlorianRappl

comment created time in a month

issue commentFlorianRappl/piral-cli-webpack

Errors raised by WebSocket

Do you mean this problem does not exist after switching to kras middleware?

carvinlo

comment created time in a month

issue commentFlorianRappl/piral-cli-webpack

Errors raised by WebSocket

Perhaps, temporarily block out the socket in the Internet Explorer browser to ensure that it does not crash under Internet Explorer?

carvinlo

comment created time in a month

issue commentsmapiot/piral

Errors raised by WebSocket

I raised the issue here #21. :smile_cat:

carvinlo

comment created time in a month

issue openedFlorianRappl/piral-cli-webpack

Errors raised by WebSocket

Bug Report

For more information, see the CONTRIBUTING guide.

Prerequisites

  • [ ] Can you reproduce the problem in a MWE?
  • [ ] Are you running the latest version?
  • [x] Did you perform a search in the issues?

Environment Details and Version

piral-cli@0.11.5 IE11 piral-cli-webpack@0.5.3

Description

The page refresh is always triggered by webpack-dev-server. Under IE11, const ws = new WebSocket(updateTarget); will trigger a read ECONNRESET error after the page is automatically refreshed.

Steps to Reproduce

  1. Debug pilet in ie11
  2. Manually refresh the ie browser or modify the code to trigger the page to automatically refresh
  3. webpack-dev-server crashed and output an error in the console:
Unhandled 'error' event
Error: read ECONNRESET
  1. Works well on chrome browser

Expected behavior

[What you expected to happen]

Actual behavior

[What actually happened]

Possible Origin / Solution

If comment out this socket code, it works well on ie11. When I replace WebSocket with sockjs-client to be compatible with IE11(the code), it works fine on chrome and ie11. Is this feasible?

created time in a month

push eventcarvinlo/piral

carvin

commit sha 869856dc462af23db65c679d4515f9ef00fe85f9

Compatible with IE11 Replace WebSocket with sockjs-client to be compatible with IE11

view details

push time in a month

fork carvinlo/piral

Framework for next generation web apps using microfrontends. :rocket:

https://piral.io

fork in a month

issue openedsmapiot/piral

Errors raised by WebSocket

Bug Report

For more information, see the CONTRIBUTING guide.

Prerequisites

  • [ ] Can you reproduce the problem in a MWE?
  • [ ] Are you running the latest version?
  • [ ] Did you perform a search in the issues?

Environment Details and Version

piral-cli@0.11.5 IE11 piral-cli-webpack@0.5.3

Description

The page refresh is always triggered by webpack-dev-server. Under IE11, const ws = new WebSocket(updateTarget); will trigger a read ECONNRESET error after the page is automatically refreshed.

Steps to Reproduce

  1. Debug pilet in ie11
  2. Manually refresh the ie browser or modify the code to trigger the page to automatically refresh
  3. webpack-dev-server crashed and output an error in the console:
Unhandled 'error' event
Error: read ECONNRESET
```

## Expected behavior

[What you expected to happen]

## Actual behavior

[What actually happened]

## Possible Origin / Solution

[Optionally, share your idea to fix the issue]

created time in a month

pull request commentsmapiot/piral

Added default configuration for browserslist

Yeah I thought about it for a bit - I think the best approach would not be a new template, but rather having support for variables in the template. Then there could be a variable like ie11 (or in general - "legacy browser support"), which would add a lot of that stuff we've seen in the PRs.

It would be opt-in and come only when you want that support.

Is a good choice.

carvinlo

comment created time in a month

pull request commentFlorianRappl/piral-cli-webpack

Support IE11

(Still no version / CHANGELOG has been updated, so this will fail publishing ...)

After updating change.log, it still fail publishing...

carvinlo

comment created time in a month

push eventcarvinlo/piral-cli-webpack

carvin

commit sha 80dc76179c5d52b939962045e4bcc1b6b762b3fe

Update CHANGELOG.md

view details

push time in a month

PR closed smapiot/piral

Added default configuration for browserslist

Added default configuration for browserslist

New Pull Request

For more information, see the CONTRIBUTING guide.

Prerequisites

Please make sure you can check the following boxes:

  • [ ] I have read the CONTRIBUTING document
  • [ ] My code follows the code style of this project
  • [ ] All new and existing tests passed

Type(s) of Changes

Contribution Type

What types of changes does your code introduce? Put an x in all the boxes that apply:

  • [ ] Bug fix (non-breaking change which fixes an issue, please reference the issue id)
  • [ ] New feature (non-breaking change which adds functionality, make sure to open an associated issue first)
  • [ ] Breaking change (fix or feature that would cause existing functionality to change)
  • [ ] I have updated the documentation accordingly
  • [ ] I have added tests to cover my changes

Description

[Place a meaningful description here]

Remarks

Support IE11

+1 -0

1 comment

1 changed file

carvinlo

pr closed time in a month

pull request commentsmapiot/piral

Added default configuration for browserslist

understood :smiley: At present, the logic of the piral-cli template is not very clear, and a set of templates will be output when the follow-up work progresses here, thank you.

carvinlo

comment created time in a month

PR closed smapiot/piral

Support IE11 configuration

Support IE11 configuration

New Pull Request

For more information, see the CONTRIBUTING guide.

Prerequisites

Please make sure you can check the following boxes:

  • [ ] I have read the CONTRIBUTING document
  • [ ] My code follows the code style of this project
  • [ ] All new and existing tests passed

Type(s) of Changes

Contribution Type

What types of changes does your code introduce? Put an x in all the boxes that apply:

  • [ ] Bug fix (non-breaking change which fixes an issue, please reference the issue id)
  • [ ] New feature (non-breaking change which adds functionality, make sure to open an associated issue first)
  • [ ] Breaking change (fix or feature that would cause existing functionality to change)
  • [ ] I have updated the documentation accordingly
  • [ ] I have added tests to cover my changes

Description

[Place a meaningful description here]

Remarks

Support IE11

+11 -8

2 comments

1 changed file

carvinlo

pr closed time in a month

pull request commentsmapiot/piral

Support IE11 configuration

understood :smiley:

carvinlo

comment created time in a month

PR closed smapiot/piral

Support IE11 configuration

Support IE11 configuration

New Pull Request

For more information, see the CONTRIBUTING guide.

Prerequisites

Please make sure you can check the following boxes:

  • [ ] I have read the CONTRIBUTING document
  • [ ] My code follows the code style of this project
  • [ ] All new and existing tests passed

Type(s) of Changes

Contribution Type

What types of changes does your code introduce? Put an x in all the boxes that apply:

  • [ ] Bug fix (non-breaking change which fixes an issue, please reference the issue id)
  • [ ] New feature (non-breaking change which adds functionality, make sure to open an associated issue first)
  • [ ] Breaking change (fix or feature that would cause existing functionality to change)
  • [ ] I have updated the documentation accordingly
  • [ ] I have added tests to cover my changes

Description

[Place a meaningful description here]

Remarks

Support IE11

+11 -8

2 comments

1 changed file

carvinlo

pr closed time in a month

pull request commentsmapiot/piral

Support IE11 configuration

understand :smiley:

carvinlo

comment created time in a month

PR opened smapiot/piral

Added default configuration for browserslist

Added default configuration for browserslist

New Pull Request

For more information, see the CONTRIBUTING guide.

Prerequisites

Please make sure you can check the following boxes:

  • [ ] I have read the CONTRIBUTING document
  • [ ] My code follows the code style of this project
  • [ ] All new and existing tests passed

Type(s) of Changes

Contribution Type

What types of changes does your code introduce? Put an x in all the boxes that apply:

  • [ ] Bug fix (non-breaking change which fixes an issue, please reference the issue id)
  • [ ] New feature (non-breaking change which adds functionality, make sure to open an associated issue first)
  • [ ] Breaking change (fix or feature that would cause existing functionality to change)
  • [ ] I have updated the documentation accordingly
  • [ ] I have added tests to cover my changes

Description

[Place a meaningful description here]

Remarks

Support IE11

+1 -0

0 comment

1 changed file

pr created time in a month

PR opened smapiot/piral

Support IE11 configuration

Support IE11 configuration

New Pull Request

For more information, see the CONTRIBUTING guide.

Prerequisites

Please make sure you can check the following boxes:

  • [ ] I have read the CONTRIBUTING document
  • [ ] My code follows the code style of this project
  • [ ] All new and existing tests passed

Type(s) of Changes

Contribution Type

What types of changes does your code introduce? Put an x in all the boxes that apply:

  • [ ] Bug fix (non-breaking change which fixes an issue, please reference the issue id)
  • [ ] New feature (non-breaking change which adds functionality, make sure to open an associated issue first)
  • [ ] Breaking change (fix or feature that would cause existing functionality to change)
  • [ ] I have updated the documentation accordingly
  • [ ] I have added tests to cover my changes

Description

[Place a meaningful description here]

Remarks

Support IE11

+11 -8

0 comment

1 changed file

pr created time in a month

PR opened smapiot/piral

Support IE11 configuration

Support IE11 configuration

New Pull Request

For more information, see the CONTRIBUTING guide.

Prerequisites

Please make sure you can check the following boxes:

  • [ ] I have read the CONTRIBUTING document
  • [ ] My code follows the code style of this project
  • [ ] All new and existing tests passed

Type(s) of Changes

Contribution Type

What types of changes does your code introduce? Put an x in all the boxes that apply:

  • [ ] Bug fix (non-breaking change which fixes an issue, please reference the issue id)
  • [ ] New feature (non-breaking change which adds functionality, make sure to open an associated issue first)
  • [ ] Breaking change (fix or feature that would cause existing functionality to change)
  • [ ] I have updated the documentation accordingly
  • [ ] I have added tests to cover my changes

Description

[Place a meaningful description here]

Remarks

Support IE11

+11 -8

0 comment

1 changed file

pr created time in a month

push eventcarvinlo/piral

carvin

commit sha ad2c72209285d0021f6b62c4d98d98cfcfa972ba

Support IE11 configuration Support IE11 configuration

view details

push time in a month

push eventcarvinlo/piral

carvin

commit sha 810e0a1e5e9b011876370ad002909c3264193378

Support IE11 configuration Support IE11 configuration

view details

push time in a month

push eventcarvinlo/piral

carvin

commit sha 3c6b93691ef41a8cee58989d1f812791830ba7c9

Added default configuration for browserslist Added default configuration for browserslist

view details

push time in a month

Pull request review commentFlorianRappl/piral-cli-webpack

Support IE11

 export function getRules(baseDir: string): Array<RuleSetRule> {       use: [styleLoader, 'css-loader'],     },     {-      test: /\.m?jsx?$/i,+      test: /\.m?[jt]sx?$/i,       use: [         {           loader: 'babel-loader',           options: {-            presets: ['@babel/preset-env', '@babel/preset-react'],+            presets: [+              [+                '@babel/preset-env',+                {+                  targets: {+                    browsers: 'ie >= 9',+                    node: '6.1.0',+                    esmodules: false,+                  },+                  modules: false,+                  debug: true,+                  include: [],+                  exclude: [],+                  useBuiltIns: false,+                  forceAllTransforms: false,+                  shippedProposals: false,+                },+              ],+              '@babel/preset-react',+              // When ts-loader is used with `@babel/plugin-transform-runtime`, it fails to convert jsx well, for example: arrow function is not converted, so it is replaced with `@babel/preset-typescript`.+              '@babel/preset-typescript',+            ],+            plugins: [+              [+                '@babel/plugin-transform-runtime',+                {+                  corejs: 3,+                  helpers: true,+                  regenerator: true,+                  useESModules: false,+                },+              ],+              '@babel/plugin-proposal-object-rest-spread',+              '@babel/plugin-transform-modules-commonjs',+              ['@babel/plugin-proposal-decorators', { legacy: true }],+              ['@babel/plugin-proposal-class-properties', { loose: true }],+            ],           },         },       ],       exclude: nodeModules,     },-    {

The problem has been resolved and verified

carvinlo

comment created time in a month

push eventcarvinlo/piral-cli-webpack

carvin

commit sha a5ff4507f7be3756e787d5ac21ca98cbe064b0cd

Remove `@babel/preset-typescript` dependency Remove `@babel/preset-typescript` dependency

view details

push time in a month

push eventcarvinlo/piral-cli-webpack

carvin

commit sha cb3d6c2924266d2681eca9806de40e8daba06228

Improve configuration Switch back to ts-loader and move the browser supports configuration to pakcage.json of shell application

view details

push time in a month

Pull request review commentFlorianRappl/piral-cli-webpack

Support IE11

 export function getRules(baseDir: string): Array<RuleSetRule> {       use: [styleLoader, 'css-loader'],     },     {-      test: /\.m?jsx?$/i,+      test: /\.m?[jt]sx?$/i,       use: [         {           loader: 'babel-loader',           options: {-            presets: ['@babel/preset-env', '@babel/preset-react'],+            presets: [+              [+                '@babel/preset-env',+                {+                  targets: {+                    browsers: 'ie >= 9',+                    node: '6.1.0',+                    esmodules: false,+                  },+                  modules: false,+                  debug: true,+                  include: [],+                  exclude: [],+                  useBuiltIns: false,+                  forceAllTransforms: false,+                  shippedProposals: false,+                },+              ],+              '@babel/preset-react',+              // When ts-loader is used with `@babel/plugin-transform-runtime`, it fails to convert jsx well, for example: arrow function is not converted, so it is replaced with `@babel/preset-typescript`.+              '@babel/preset-typescript',+            ],+            plugins: [+              [+                '@babel/plugin-transform-runtime',+                {+                  corejs: 3,+                  helpers: true,+                  regenerator: true,+                  useESModules: false,+                },+              ],+              '@babel/plugin-proposal-object-rest-spread',+              '@babel/plugin-transform-modules-commonjs',+              ['@babel/plugin-proposal-decorators', { legacy: true }],+              ['@babel/plugin-proposal-class-properties', { loose: true }],+            ],           },         },       ],       exclude: nodeModules,     },-    {

Aha, you may be right, I mistaken the tsconfig.json in the piral-cli-webpack directory for the tsconfig.json in the shell application directory, and I will return after verifying that there is no problem submitted.

carvinlo

comment created time in a month

Pull request review commentFlorianRappl/piral-cli-webpack

Support IE11

 export function getStyleLoader() {  export function getRules(baseDir: string): Array<RuleSetRule> {   const styleLoader = getStyleLoader();-  const nodeModules = resolve(baseDir, 'node_modules');++  const PATH_DELIMITER = '[\\\\/]'; // match 2 antislashes or one slash

my mistake.

carvinlo

comment created time in a month

Pull request review commentFlorianRappl/piral-cli-webpack

Support IE11

 export function getRules(baseDir: string): Array<RuleSetRule> {       use: [styleLoader, 'css-loader'],     },     {-      test: /\.m?jsx?$/i,+      test: /\.m?[jt]sx?$/i,       use: [         {           loader: 'babel-loader',           options: {-            presets: ['@babel/preset-env', '@babel/preset-react'],+            presets: [+              [+                '@babel/preset-env',+                {+                  targets: {

You are right, moving the configuration to the package.json of the shell application is a more flexible and free configuration method. I strongly agree to remove the support of ie <11 and there are still some users who have a demand for ie11.

carvinlo

comment created time in a month

Pull request review commentFlorianRappl/piral-cli-webpack

Support IE11

 export function getRules(baseDir: string): Array<RuleSetRule> {       use: [styleLoader, 'css-loader'],     },     {-      test: /\.m?jsx?$/i,+      test: /\.m?[jt]sx?$/i,       use: [         {           loader: 'babel-loader',           options: {-            presets: ['@babel/preset-env', '@babel/preset-react'],+            presets: [+              [+                '@babel/preset-env',+                {+                  targets: {+                    browsers: 'ie >= 9',+                    node: '6.1.0',+                    esmodules: false,+                  },+                  modules: false,+                  debug: true,+                  include: [],+                  exclude: [],+                  useBuiltIns: false,+                  forceAllTransforms: false,+                  shippedProposals: false,+                },+              ],+              '@babel/preset-react',+              // When ts-loader is used with `@babel/plugin-transform-runtime`, it fails to convert jsx well, for example: arrow function is not converted, so it is replaced with `@babel/preset-typescript`.+              '@babel/preset-typescript',+            ],+            plugins: [+              [+                '@babel/plugin-transform-runtime',+                {+                  corejs: 3,+                  helpers: true,+                  regenerator: true,+                  useESModules: false,+                },+              ],+              '@babel/plugin-proposal-object-rest-spread',+              '@babel/plugin-transform-modules-commonjs',+              ['@babel/plugin-proposal-decorators', { legacy: true }],+              ['@babel/plugin-proposal-class-properties', { loose: true }],+            ],           },         },       ],       exclude: nodeModules,     },-    {

Do you mean to remove @babel/preset-typescript? I haven't figured out why the ts-loader did not convert the arrow function of the component.

carvinlo

comment created time in a month

PR opened FlorianRappl/piral-cli-webpack

Support IE11

Isolate the impact of the shell application on the global native objects of the pilet and reduce the bundle size of the shell application. Use useBuiltIns to support IE11.

+64 -16

0 comment

4 changed files

pr created time in a month

push eventcarvinlo/piral-cli-webpack

amu

commit sha 55480ae8d9b5fbc630c7138eac86d3fc709b7429

Code comments

view details

push time in a month

push eventcarvinlo/piral-cli-webpack

amu

commit sha 14f0ef478e91e3df983eee717508e12e877c1cb1

Support IE11

view details

push time in a month

fork carvinlo/piral-cli-webpack

Integrates webpack for debugging and building pilets. :rocket:

https://piral.io

fork in a month

PR opened FlorianRappl/piral-cli-webpack

Support https and custom host

Remove protocol and host for automatic adaptation. image Works fine on chrome of mac notebook.

+1 -1

0 comment

1 changed file

pr created time in a month

push eventcarvinlo/piral-cli-webpack

carvin

commit sha 76abd99e1fec1997b8c27f5b15df790a9579d776

Support https and custom host Remove protocol and host for automatic adaptation.

view details

push time in a month

issue closedpiral-samples/piral-microfrontend-demo

There is a short "Error: not_found` transition screen

image It seems to be because of the asynchronous problem. Is it adjusted to the following to fix this problem? image

Here is just an example, you may have a better solution, in the logic of controlling the loading of the pilet.

closed time in a month

carvinlo

issue commentpiral-samples/piral-microfrontend-demo

There is a short "Error: not_found` transition screen

The error page transition screen has been fixed. Awesome !🎉 At the same time, through your explanation, I have a deeper understanding of the loading logic, thank you!

carvinlo

comment created time in a month

issue closedpiral-samples/piral-microfrontend-demo

Need to support the new `integrity` feature

On the webpack branch, something went wrong: image

closed time in a month

carvinlo

issue commentpiral-samples/piral-microfrontend-demo

Need to support the new `integrity` feature

Tried to use the latest version piral-cli@0.11.6-pre.1324, but an error occurred while building the app-shell: image

carvinlo

comment created time in a month

issue openedpiral-samples/piral-microfrontend-demo

There is a short "Error: not_found` transition screen

image It seems to be because of the asynchronous problem. Is it adjusted to the following to fix this problem? image

created time in a month

startedsmapiot/piral-inspector

started time in 2 months

issue openedFlorianRappl/piral-cli-webpack

After reinstalling dependencies using `yarn`,` yarn build` went wrong

image It seems that the schema-utils package officially released a compatibility issue caused by the new version

created time in 2 months

startedFlorianRappl/mkdocs-material

started time in 2 months

issue closedsmapiot/piral

Use Pub / Sub to dispatch to update the state and get the old value

Bug Report

For more information, see the CONTRIBUTING guide.

Prerequisites

  • [ ] Can you reproduce the problem in a MWE?
  • [x] Are you running the latest version?
  • [ ] Did you perform a search in the issues?

Environment Details and Version

piral-cli@0.11.5

Description

The piral-i18n plugin updates the language state and emits an event to notify another piral-antd to update the provider, but the provider rendered by the app-shell is still the old value.

Steps to Reproduce

  1. piral-i18n
export function getLanguage(ctx: any){
 return ctx.readState((state: any) => state.i18n.language);
}
export function changeLanguage(ctx: any, language: string) {
  ctx.dispatch((state: any) => {
    ctx.emit('change-language', {
      current: language,
      previous: state.i18n.language,
    }
    return {
      ...state,
      i18n: {
       language: language,
      }
    }
  })
}
  1. piral-antd
import { LocaleProvider } from 'antd';
const EnProviderLocale = require('antd/lib/locale-provider/en_US');
const OtherProviderLocale = ...
const language = context.getLanguage();
const LocaleProvider = createElement(
context.includeProvider(createElement(LocaleProvider, { locale: language === 'en' ? EnProviderLocale : OtherProviderLocale }));
context.saveOriginProvider(LocaleProvider, { locale: language === 'en' ? EnProviderLocale : OtherProviderLocale });

context.on('change-language', ({current, previous}) => {
  context.updateOriginProvider(LocaleProvider, { locale: current === 'en' ? EnProviderLocale : OtherProviderLocale });
});

actions.ts

function reIncludeProvider(providers, propses, index): any {
  const provider = providers[index];
  const prop = propses[index];
  const providerComponent = createElement(provider, prop);
  if(index > 0){
   return props => createElement(reIncludeProvider(providers, propses, index - 1), undefined, cloneElement(providerComponent, props));
  }else{
    return props => cloneElement(providerComponent, props);
  }
}

export function updateOriginProvider(ctx: any, provider: any, props: any){
  const originProvider = ctx.readState((state: any) => state.originProvider) || [];
  const providerProps = ctx.readState((state: any) => state.providerProps) || [];
  let providers = ctx.readState((state: any) => state.provider) || React.Fragment;
  const providerIndex = originProvider.indexOf(provider);
  if(providerIndex){
    providerProps.splice(providerIndex, 1, props);
    provider = reIncludeProvider(originProvider, providerProps, originProvider.length - 1);
    ctx.dispatch((state: any) => {
      return {
        ...state,
        providerProps,
        provider: providers,
      }
    })
  }
}
export function saveOriginProvider(ctx: any, provider: any, props: any) {
  ctx.dispatch((state: any) => {
    return {
      ...state,
        providerProps: [...(state.providerProps || []), props],
        originProvider: [...(state.originProvider || []), provider],
    }
  }
}

Expected behavior

When I switch languages, the provider will update.

Actual behavior

When I switch languages, debugging finds that the provider is still the old value.

Possible Origin / Solution

It was located because after the change-language was emitted, the latest provider was updated, and then the language was updated. At this time, the old value was re-acquired, so after adding setTimeout to emit, it worked as expected.

export function changeLanguage(ctx: any, language: string) {
  ctx.dispatch((state: any) => {
    setTimeout(() => {
      ctx.emit('change-language', {
        current: language,
        previous: state.i18n.language,
      }
    }, 100);
    return {
      ...state,
      i18n: {
       language: language,
      }
    }
  })
}

Although the dispatch was executed to update the state in the expected order, it also caused the page to be rendered twice. Is there a better way?

closed time in 2 months

carvinlo

issue commentsmapiot/piral

Use Pub / Sub to dispatch to update the state and get the old value

Please ignore it, it has been solved.

export function changeLanguage(ctx: any, language: string) {
  ctx.dispatch((state: any) => {
    return {
      ...state,
      i18n: {
       language: language,
      }
    }
  })
  ctx.emit('change-language', {
    current: language,
    previous: ctx.getLanguage(),
  }
}
carvinlo

comment created time in 2 months

issue commentsmapiot/piral

`includeProvider` discards props

Please ignore it, it has been solved.

carvinlo

comment created time in 2 months

issue commentsmapiot/piral

`includeProvider` discards props

I implemented an updated provider props, but encountered another problem. Use Pub / Sub to dispatch to update the state and get the old value

carvinlo

comment created time in 2 months

issue openedsmapiot/piral

Use Pub / Sub to dispatch to update the state and get the old value

Bug Report

For more information, see the CONTRIBUTING guide.

Prerequisites

  • [ ] Can you reproduce the problem in a MWE?
  • [ ] Are you running the latest version?
  • [ ] Did you perform a search in the issues?

Environment Details and Version

piral-cli@0.11.5

Description

The piral-i18n plugin updates the language state and emits an event to notify another piral-antd to update the provider, but the provider rendered by the app-shell is still the old value.

Steps to Reproduce

  1. piral-i18n
export function getLanguage(ctx: any){
 return ctx.readState((state: any) => state.i18n.language);
}
export function changeLanguage(ctx: any, language: string) {
  ctx.dispatch((state: any) => {
    ctx.emit('change-language', {
      current: language,
      previous: state.i18n.language,
    }
    return {
      ...state,
      i18n: {
       language: language,
      }
    }
  })
}
  1. piral-antd
import { LocaleProvider } from 'antd';
const EnProviderLocale = require('antd/lib/locale-provider/en_US');
const OtherProviderLocale = ...
const language = context.getLanguage();
const LocaleProvider = createElement(
context.includeProvider(createElement(LocaleProvider, { locale: language === 'en' ? EnProviderLocale : OtherProviderLocale }));
context.saveOriginProvider(LocaleProvider, { locale: language === 'en' ? EnProviderLocale : OtherProviderLocale });

context.on('change-language', ({current, previous}) => {
  context.updateOriginProvider(LocaleProvider, { locale: current === 'en' ? EnProviderLocale : OtherProviderLocale });
});

actions.ts

function reIncludeProvider(providers, propses, index): any {
  const provider = providers[index];
  const prop = propses[index];
  const providerComponent = createElement(provider, prop);
  if(index > 0){
   return props => createElement(reIncludeProvider(providers, propses, index - 1), undefined, cloneElement(providerComponent, props));
  }else{
    return props => cloneElement(providerComponent, props);
  }
}

export function updateOriginProvider(ctx: any, provider: any, props: any){
  const originProvider = ctx.readState((state: any) => state.originProvider) || [];
  const providerProps = ctx.readState((state: any) => state.providerProps) || [];
  let providers = ctx.readState((state: any) => state.provider) || React.Fragment;
  const providerIndex = originProvider.indexOf(provider);
  if(providerIndex){
    providerProps.splice(providerIndex, 1, props);
    provider = reIncludeProvider(originProvider, providerProps, originProvider.length - 1);
    ctx.dispatch((state: any) => {
      return {
        ...state,
        providerProps,
        provider: providers,
      }
    })
  }
}
export function saveOriginProvider(ctx: any, provider: any, props: any) {
  ctx.dispatch((state: any) => {
    return {
      ...state,
        providerProps: [...(state.providerProps || []), props],
        originProvider: [...(state.originProvider || []), provider],
    }
  }
}

Expected behavior

When I switch languages, the provider will update.

Actual behavior

When I switch languages, debugging finds that the provider is still the old value.

Possible Origin / Solution

It was located because after the change-language was emitted, the latest provider was updated, and then the language was updated. At this time, the old value was re-acquired, so after adding setTimeout to emit, it worked as expected.

export function changeLanguage(ctx: any, language: string) {
  ctx.dispatch((state: any) => {
    setTimeout(() => {
      ctx.emit('change-language', {
        current: language,
        previous: state.i18n.language,
      }
    }, 100);
    return {
      ...state,
      i18n: {
       language: language,
      }
    }
  })
}

Although the dispatch was executed to update the state in the expected order, it also caused the page to be rendered twice. Is there a better way?

created time in 2 months

fork carvinlo/react-atom

A simple way manage state in React, inspired by Clojure(Script) and reagent.cljs

https://derrickbeining.github.io/react-atom

fork in 2 months

issue commentsmapiot/piral

`includeProvider` discards props

It works fine ! :+1:

carvinlo

comment created time in 2 months

issue commentsmapiot/piral

Support Lazy Loading with Dependencies

Of course, it is an honor!

carvinlo

comment created time in 2 months

issue commentsmapiot/piral

Support Lazy Loading with Dependencies

I use it in various scenarios: Before the page is rendered, request the common data that the page depends on and set it in the redux store for the page to use.

const TranslatePage = () => import('./translatepage').then(m => m.default);
const common = () => import('./common');
const prerequest = () =>
  fetch('/somedata').then(res => {
    return import('./setstore').then(m => m.default(res));
  });
...
  app.defineDependency('common', common);
  app.defineDependency('prerequest', prerequest);
  app.registerPage('/translate', app.fromLazy(TranslatePage, ['common', 'prerequest']));

./setstore.ts

export default res => {
  console.log(res);
};

piral-lazy is great after improvement !

carvinlo

comment created time in 2 months

issue closedFlorianRappl/piral-cli-webpack

Error: No converter for component of type "undefined" registered.

Bug Report

For more information, see the CONTRIBUTING guide.

Prerequisites

  • [ ] Can you reproduce the problem in a MWE?
  • [x] Are you running the latest version?
  • [ ] Did you perform a search in the issues?

Environment Details and Version

piral-cli@0.11.5 piral-cli-webpack@0.5.3 Chrome@latest

Description

update piral-cli@0.11.5 and use piral-lazy

import { PiletApi } from '<name-of-piral-instance>';

export function setup(piral: PiletApi) {
  const LazyPage = piral.fromLazy(() => import('./MyPage'));
  piral.registerPage('/sample', LazyPage);
}

Steps to Reproduce

  1. [First Step]
  2. [next step...]

Expected behavior

[What you expected to happen]

Actual behavior

[What actually happened]

Possible Origin / Solution

[Optionally, share your idea to fix the issue]

closed time in 2 months

carvinlo

issue commentFlorianRappl/piral-cli-webpack

Error: No converter for component of type "undefined" registered.

Great, It works fine !

carvinlo

comment created time in 2 months

more