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

build: bump lowest supported node version to node14.13 #1052

Closed
wants to merge 8 commits into from

Conversation

Shinigami92
Copy link
Member

This bumps the target to the lowest supported target

https://esbuild.github.io/api/#target

It could be that this doesn't change anything, but we are more safe with that

@Shinigami92 Shinigami92 added p: 1-normal Nothing urgent c: refactor PR that affects the runtime behavior, but doesn't add new features or fixes bugs labels Jun 10, 2022
@Shinigami92 Shinigami92 self-assigned this Jun 10, 2022
@Shinigami92 Shinigami92 added this to the v7 - Current Major milestone Jun 10, 2022
@Shinigami92
Copy link
Member Author

CI -> ERROR: This version of pnpm requires at least Node.js v14.19 👀

I would be okay with that 🤔
What do others say?

@codecov
Copy link

codecov bot commented Jun 10, 2022

Codecov Report

Merging #1052 (5fb943b) into main (5ea8252) will increase coverage by 0.00%.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             main    #1052   +/-   ##
=======================================
  Coverage   99.64%   99.65%           
=======================================
  Files        2135     2135           
  Lines      229160   229160           
  Branches      979      983    +4     
=======================================
+ Hits       228357   228378   +21     
+ Misses        782      761   -21     
  Partials       21       21           
Impacted Files Coverage Δ
src/modules/internet/user-agent.ts 93.04% <0.00%> (+6.08%) ⬆️

@Shinigami92 Shinigami92 added the s: on hold Blocked by something or frozen to avoid conflicts label Jun 10, 2022
@import-brain
Copy link
Member

CI -> ERROR: This version of pnpm requires at least Node.js v14.19 👀

I would be okay with that 🤔 What do others say?

I would be okay with that too.

@Shinigami92
Copy link
Member Author

Await merge of #1060

@Shinigami92 Shinigami92 removed the s: on hold Blocked by something or frozen to avoid conflicts label Jun 11, 2022
@Shinigami92
Copy link
Member Author

> @faker-js/faker@7.2.0 build:code /home/runner/work/faker/faker
> esno ./scripts/bundle.ts
file:///home/runner/work/faker/faker/node_modules/.pnpm/@esbuild-kit+esm-loader@2.1.5/node_modules/@esbuild-kit/esm-loader/dist/index.js:1
import g from"path";import{installSourceMapSupport as w,resolveTsPath as T,transform as y,transformDynamicImport as _}from"@esbuild-kit/core-utils";import l from"get-tsconfig";import h from"fs";import{fileURLToPath as I}from"url";const p=/\.([cm]?ts|[tj]sx)$/,j=t=>{const r=g.extname(t);if(r===".mjs"||r===".mts")return"module";if(r===".cjs"||r===".cts")return"commonjs"},i=new Map;async function $(t){if(i.has(t))return i.get(t);if(!await h.promises.access(t).then(()=>!0,()=>!1)){i.set(t,void 0);return}const s=await h.promises.readFile(t,"utf8");try{const o=JSON.parse(s);return i.set(t,o),o}catch{throw new Error(`Error parsing: ${t}`)}}async function b(t){let r=new URL("package.json",t);for(;!r.pathname.endsWith("/node_modules/package.json");){const s=I(r),o=await $(s);if(o)return o;const n=r;if(r=new URL("../package.json",r),r.pathname===n.pathname)break}}async function O(t){var r;const s=await b(t);return(r=s==null?void 0:s.type)!=null?r:"commonjs"}var x=Object.defineProperty,F=Object.defineProperties,L=Object.getOwnPropertyDescriptors,v=Object.getOwnPropertySymbols,M=Object.prototype.hasOwnProperty,A=Object.prototype.propertyIsEnumerable,k=(t,r,s)=>r in t?x(t,r,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[r]=s,P=(t,r)=>{for(var s in r||(r={}))M.call(r,s)&&k(t,s,r[s]);if(v)for(var s of v(r))A.call(r,s)&&k(t,s,r[s]);return t},E=(t,r)=>F(t,L(r));const S=w(),D=l(),V=D==null?void 0:D.config,C=[".js",".json",".ts",".tsx",".jsx"];async function U(t,r,s){let o;for(const n of C)try{return await m(t+n,r,s,!0)}catch(e){if(o===void 0){const{message:a}=e;e.message=e.message.replace(`${n}'`,"'"),e.stack=e.stack.replace(a,e.message),o=e}}throw o}async function J(t,r,s){const o=t.endsWith("/")?"index":`${g.sep}index`;try{return await U(t+o,r,s)}catch(n){const{message:e}=n;throw n.message=n.message.replace(`${o}'`,"'"),n.stack=n.stack.replace(e,n.message),n}}const m=async function(t,r,s,o){var n;if(t.startsWith("node:")&&(t=t.slice(5)),t.endsWith("/"))return await J(t,r,s);if(p.test(r.parentURL)){const c=T(t);if(c)try{return await m(c,r,s,!0)}catch(u){if(u.code!=="ERR_MODULE_NOT_FOUND")throw u}}let e;try{e=await s(t,r,s)}catch(c){if(c instanceof Error&&!o){if(c.code==="ERR_UNSUPPORTED_DIR_IMPORT")return await J(t,r,s);if(c.code==="ERR_MODULE_NOT_FOUND")return await U(t,r,s)}throw c}if(e.url.endsWith(".json"))return E(P({},e),{format:"json"});let{format:a}=e;return e.url.startsWith("file:")&&(a=(n=j(e.url))!=null?n:a,a||(a=await O(e.url))),E(P({},e),{format:a})},q=async function(t,r,s){process.send&&process.send({type:"dependency",path:t}),t.endsWith(".json")&&(r.importAssertions||(r.importAssertions={}),r.importAssertions.type="json");const o=await s(t,r,s);if(!o.source)return o;const n=o.source.toString();if(o.format==="json"||p.test(t)){const a=await y(n,t,{format:"esm",tsconfigRaw:V});return a.map&&S.set(t,a.map),{format:"module",source:a.code}}const e=_({code:n});return e&&(o.source=e.code,e.map&&S.set(t,e.map)),o},R=l(),z=R==null?void 0:R.config,W=w(),B=async function(t,r,s){var o;return t.endsWith(".json")?{format:"module"}:t.startsWith("file:")?{format:(o=j(t))!=null?o:await O(t)}:await s(t,r,s)},H=async function(t,r,s){const{url:o}=r;if(process.send&&process.send({type:"dependency",path:o}),o.endsWith(".json")||p.test(o)){const a=await y(t.toString(),o,{format:"esm",tsconfigRaw:z});return a.map&&W.set(o,a.map),{source:a.code}}const n=await s(t,r,s),e=_({code:n.source.toString()});return e&&(n.source=e.code,e.map&&W.set(o,e.map)),n},f=[[16](https://github.com/faker-js/faker/runs/6843288459?check_suite_focus=true#step:6:17),12,0],d=process.version.slice(1).split(".").map(Number),N=(d[0]-f[0]||d[1]-f[1]||d[2]-f[2])<0,K=N?B:void 0,Q=N?H:void 0;export{K as getFormat,q as load,m as resolve,Q as transformSource};
                                                        ^^^^^^^^^^^^^
SyntaxError: The requested module '@esbuild-kit/core-utils' is expected to be of type CommonJS, which does not support named exports. CommonJS modules can be imported by importing the default export.
For example:
import pkg from '@esbuild-kit/core-utils';
const {installSourceMapSupport: w,resolveTsPath: T,transform: y,transformDynamicImport: _}from"@esbuild-kit/core-utils";import l from"get-tsconfig";import h from"fs";import{fileURLToPath: I}from"url";const p=/\.([cm]?ts|[tj]sx)$/,j=t=>{const r=g.extname(t);if(r===".mjs"||r===".mts")return"module";if(r===".cjs"||r===".cts")return"commonjs"},i=new Map;async function $(t){if(i.has(t))return i.get(t);if(!await h.promises.access(t).then(()=>!0,()=>!1)){i.set(t,void 0);return}const s=await h.promises.readFile(t,"utf8");try{const o=JSON.parse(s);return i.set(t,o),o}catch{throw new Error(`Error parsing: ${t}`)}}async function b(t){let r=new URL("package.json",t);for(;!r.pathname.endsWith("/node_modules/package.json");){const s=I(r),o=await $(s);if(o)return o;const n=r;if(r=new URL("../package.json",r),r.pathname===n.pathname)break}}async function O(t){var r;const s=await b(t);return(r=s==null?void 0:s.type)!=null?r:"commonjs"}var x=Object.defineProperty,F=Object.defineProperties,L=Object.getOwnPropertyDescriptors,v=Object.getOwnPropertySymbols,M=Object.prototype.hasOwnProperty,A=Object.prototype.propertyIsEnumerable,k=(t,r,s)=>r in t?x(t,r,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[r]=s,P=(t,r)=>{for(var s in r||(r={}))M.call(r,s)&&k(t,s,r[s]);if(v)for(var s of v(r))A.call(r,s)&&k(t,s,r[s]);return t},E=(t,r)=>F(t,L(r));const S=w(),D=l(),V=D==null?void 0:D.config,C=[".js",".json",".ts",".tsx",".jsx"];async function U(t,r,s){let o;for(const n of C)try{return await m(t+n,r,s,!0)}catch(e){if(o===void 0){const{message:a}=e;e.message=e.message.replace(`${n}'`,"'"),e.stack=e.stack.replace(a,e.message),o=e}}throw o}async function J(t,r,s){const o=t.endsWith("/")?"index":`${g.sep}index`;try{return await U(t+o,r,s)}catch(n){const{message:e}=n;throw n.message=n.message.replace(`${o}'`,"'"),n.stack=n.stack.replace(e,n.message),n}}const m=async function(t,r,s,o){var n;if(t.startsWith("node:")&&(t=t.slice(5)),t.endsWith("/"))return await J(t,r,s);if(p.test(r.parentURL)){const c=T(t);if(c)try{return await m(c,r,s,!0)}catch(u){if(u.code!=="ERR_MODULE_NOT_FOUND")throw u}}let e;try{e=await s(t,r,s)}catch(c){if(c instanceof Error&&!o){if(c.code==="ERR_UNSUPPORTED_DIR_IMPORT")return await J(t,r,s);if(c.code==="ERR_MODULE_NOT_FOUND")return await U(t,r,s)}throw c}if(e.url.endsWith(".json"))return E(P({},e),{format:"json"});let{format:a}=e;return e.url.startsWith("file:")&&(a=(n=j(e.url))!=null?n:a,a||(a=await O(e.url))),E(P({},e),{format:a})},q=async function(t,r,s){process.send&&process.send({type:"dependency",path:t}),t.endsWith(".json")&&(r.importAssertions||(r.importAssertions={}),r.importAssertions.type="json");const o=await s(t,r,s);if(!o.source)return o;const n=o.source.toString();if(o.format==="json"||p.test(t)){const a=await y(n,t,{format:"esm",tsconfigRaw:V});return a.map&&S.set(t,a.map),{format:"module",source:a.code}}const e=_({code:n});return e&&(o.source=e.code,e.map&&S.set(t,e.map)),o},R=l(),z=R==null?void 0:R.config,W=w(),B=async function(t,r,s){var o;return t.endsWith(".json")?{format:"module"}:t.startsWith("file:")?{format:(o=j(t))!=null?o:await O(t)}:await s(t,r,s)},H=async function(t,r,s){const{url:o}=r;if(process.send&&process.send({type:"dependency",path:o}),o.endsWith(".json")||p.test(o)){const a=await y(t.toString(),o,{format:"esm",tsconfigRaw:z});return a.map&&W.set(o,a.map),{source:a.code}}const n=await s(t,r,s),e=_({code:n.source.toString()});return e&&(n.source=e.code,e.map&&W.set(o,e.map)),n},f=[16,12,0],d=process.version.slice(1).split(".").map(Number),N=(d[0]-f[0]||d[1]-f[1]||d[2]-f[2])<0,K=N?B:void 0,Q=N?H:void 0;export{K: getFormat,q: load,m: resolve,Q: transformSource} = pkg;
    at ModuleJob._instantiate (internal/modules/esm/module_job.js:98:[21](https://github.com/faker-js/faker/runs/6843288459?check_suite_focus=true#step:6:22))
    at async ModuleJob.run (internal/modules/esm/module_job.js:137:5)
    at async Loader.import (internal/modules/esm/loader.js:162:[24](https://github.com/faker-js/faker/runs/6843288459?check_suite_focus=true#step:6:25))
    at async internal/process/esm_loader.js:57:9
    at async Object.loadESM (internal/process/esm_loader.js:67:5)
 ELIFECYCLE  Command failed with exit code 1.
ERROR: "build:code" exited with 1.

@ST-DDT
Copy link
Member

ST-DDT commented Jun 11, 2022

We probably have to take this into consideration when releasing.

@Shinigami92
Copy link
Member Author

We probably have to take this into consideration when releasing.

Yes, I need to find out what's going on here and if we need to up our supported node version or something else
But I do this when I have the will and time for that, maybe this evening, maybe next few days...
I highly assume this has something todo with the esm / webpack bug(s).
But I'm not sure yet if this is a esbuild bug or something wrong by us 🤔

@import-brain import-brain added the needs rebase There is a merge conflict label Jun 12, 2022
@Shinigami92 Shinigami92 added do NOT merge yet Do not merge this PR into the target branch yet and removed needs rebase There is a merge conflict labels Jun 14, 2022
@Shinigami92
Copy link
Member Author

I tested it now with several node v14.x versions

image

Is this a bug in esbuild? @evanw

@Shinigami92 Shinigami92 added the s: on hold Blocked by something or frozen to avoid conflicts label Jun 14, 2022
@Shinigami92 Shinigami92 removed the s: on hold Blocked by something or frozen to avoid conflicts label Jun 14, 2022
@Shinigami92 Shinigami92 changed the title build: use lowest supported target build: bump lowest supported node version to node14.13 Jun 14, 2022
@Shinigami92 Shinigami92 removed the do NOT merge yet Do not merge this PR into the target branch yet label Jun 14, 2022
@Shinigami92
Copy link
Member Author

superseded by

@Shinigami92 Shinigami92 deleted the use-lowest-supported-target branch June 18, 2022 14:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: refactor PR that affects the runtime behavior, but doesn't add new features or fixes bugs p: 1-normal Nothing urgent
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants