fix: compile nmp library as 'commonjs' module#1666
Merged
michael-valdron merged 3 commits intodevfile:mainfrom Feb 6, 2025
Merged
fix: compile nmp library as 'commonjs' module#1666michael-valdron merged 3 commits intodevfile:mainfrom
michael-valdron merged 3 commits intodevfile:mainfrom
Conversation
Signed-off-by: vitaliy-guliy <vgulyy@redhat.com>
Closed
3 tasks
dkwon17
reviewed
Jan 7, 2025
dkwon17
approved these changes
Jan 24, 2025
Member
michael-valdron
left a comment
There was a problem hiding this comment.
@vitaliy-guliy Thank you for your contribution!
Just have one suggestion about adding to the documentation, looks good to me otherwise.
Signed-off-by: vitaliy-guliy <vgulyy@redhat.com>
Signed-off-by: vitaliy-guliy <vgulyy@redhat.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: dkwon17, michael-valdron, svor, vitaliy-guliy The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of Changes
Compile generated
@devfile/apinode package ascommonjsmodule instead ofnode:module.It was around two years ago when the
@devfile/apipackage was published ascommonjsmodule https://www.npmjs.com/package/@devfile/api/v/2.2.1-alpha-1667236163?activeTab=codeSince that time all the node libraries generated by openapi-generator are being compiled as
node:module.( go to https://www.npmjs.com/package/@devfile/api?activeTab=code, open
package.jsonand look attypeproperty )Both Che Dashboard and Che Code projects are compiled as
commonjs.There is a well known restriction, that
node:moduecannot be included intocommonjsmodule usingimport,requireshould be used instead.Che Dashboard and Che Code projects both use
@devfile/api. When we package dashboard and che-code with webpack, we do not have any issues ( btw, this is a reason why we didn't have the problem for a long time). But when we try to compile the project without using webpack and then run it in a development mode (browser downloads a thousand of separate files), we face a problem with loading some files from@devfile/api.The original issue highlighting a problem eclipse-che/che#23163
A workaround after which I decided to open this PR che-incubator/che-code#472
Tests Performed
Explain what tests you personally ran to ensure the changes are functioning as expected.
How To Test
Instructions for the reviewer on how to test your changes.
Notes To Reviewer
Any notes you would like to include for the reviewer.